-
Notifications
You must be signed in to change notification settings - Fork 40
/
gnuradio.rb
73 lines (67 loc) · 2.17 KB
/
gnuradio.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
require "formula"
class Gnuradio < Formula
homepage "http://gnuradio.org"
head "https://github.com/gnuradio/gnuradio.git"
url "http://gnuradio.org/releases/gnuradio/gnuradio-3.7.8.tar.gz"
sha256 "fe19cb54b5d77fb76dde61d5cf184c6dee7066779b45c51676bae6e6d0cd4172"
option "without-qt", "Build with QT widgets in addition to wxWidgets"
option "without-docs", "Build gnuradio documentation"
depends_on :python
build.without? "python-deps"
depends_on "Cheetah" => :python
depends_on "lxml" => :python
depends_on "matplotlib" => :python
depends_on "numpy" => :python
depends_on "scipy" => :python
depends_on "docutils" => :python
depends_on :fortran => :build
depends_on "swig" => :build
depends_on "cmake" => :build
depends_on "boost"
depends_on "cppunit"
depends_on "gsl"
depends_on "fftw"
depends_on "sip"
depends_on "pygobject"
depends_on "pygtk"
depends_on "sdl"
depends_on "libusb"
depends_on "orc"
depends_on "pyqt" if build.with? "qt"
depends_on "pyqwt" if build.with? "qt"
depends_on "sphinx" if build.with? "docs"
depends_on "sphinx" => :python if build.with? "docs"
depends_on "wxpython"
depends_on "wxmac"
depends_on "freetype"
def install
mkdir "build" do
args = %W[
-DCMAKE_PREFIX_PATH=#{prefix}
-DENABLE_DOXYGEN=Off
-DCMAKE_C_COMPILER=#{ENV.cc}
-DCMAKE_CXX_COMPILER=#{ENV.cxx}
]
# Find the right python, system or homebrew.
args << "-DPYTHON_EXECUTABLE='#{%x(python-config --prefix).chomp}/bin/python'"
args << "-DPYTHON_INCLUDE_DIR='#{%x(python-config --prefix).chomp}/include/python2.7'"
args << "-DPYTHON_LIBRARY='#{%x(python-config --prefix).chomp}/lib/libpython2.7.dylib'"
if build.with? "docs"
args << "-DENABLE_SPHINX=ON"
else
args << "-DENABLE_SPHINX=OFF"
end
if build.with? "qt"
args << "-DENABLE_GR_QTGUI=ON"
else
args << "-DENABLE_GR_QTGUI=OFF"
end
system "cmake", "..", *args, *std_cmake_args
system "make"
system "make install"
inreplace "#{prefix}/etc/gnuradio/conf.d/grc.conf" do |s|
s.gsub! "#{prefix}/", "#{HOMEBREW_PREFIX}/"
end
end
end
end