forked from rixon/homebrew-gnuradio
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgr-osmosdr.rb
44 lines (38 loc) · 1.36 KB
/
gr-osmosdr.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'formula'
class GrOsmosdr < Formula
homepage 'http://sdr.osmocom.org/trac/wiki/GrOsmoSDR'
option 'with-fcd', 'Build with fcd support'
option 'with-uhd', 'Build with Ettus USRP support'
option 'with-iio', 'Build with adi iio support'
if build.without? 'iio'
url 'git://git.osmocom.org/gr-osmosdr'
head 'git://git.osmocom.org/gr-osmosdr'
else
url 'git://github.com/csete/gr-osmosdr-gqrx/', :branch => 'plutosdr'
head 'git://github.com/csete/gr-osmosdr-gqrx/', :branch => 'plutosdr'
end
depends_on 'cmake' => :build
depends_on 'ttrftech/gnuradio/gnuradio'
depends_on 'uhd' => :optional
depends_on 'librtlsdr' => :optional
depends_on 'libbladerf' => :optional
depends_on 'airspy' => :optional
depends_on 'hackrf' => :optional
depends_on 'ttrftech/adalm-pluto/gr-iio' => :optional
def install
mkdir 'build' do
args = std_cmake_args
args << "-DENABLE_FCD=OFF" if build.without? 'fcd'
args << "-DENABLE_UHD=OFF" if build.without? 'uhd'
args << "-DPYTHON_LIBRARY=#{python_path}/Frameworks/Python.framework/"
system 'cmake', '..', *args
system 'make'
system 'make install'
end
end
def python_path
python = Formulary.factory('python')
kegs = python.rack.children.reject { |p| p.basename.to_s == '.DS_Store' }
kegs.find { |p| Keg.new(p).linked? } || kegs.last
end
end