├── README.md ├── gnuradio.rb ├── gr-baz.rb ├── gr-osmosdr.rb └── rtlsdr.rb /README.md: -------------------------------------------------------------------------------- 1 | # homebrew-gnuradio 2 | 3 | This is a collection of [Homebrew](https://github.com/mxcl/homebrew) recipes 4 | that makes it easier get GNU Radio and friends running on OS X. 5 | 6 | ## Installation 7 | 8 | These steps have been tested on Lion 10.7.4 with Xcode 4.3.2 and Mountain Lion 9 | 10.8 with Xcode 4.4.1. 10 | 11 | - Add this line to your profile (ie `~/.bash_profile` or `~/.zshenv`) and reload 12 | your shell (`exec $SHELL`) 13 | 14 | ```sh 15 | export PATH=/usr/local/bin:/usr/local/share/python:$PATH 16 | ``` 17 | 18 | - Install the python package prerequisites 19 | 20 | ```sh 21 | brew install python gfortran umfpack swig 22 | ``` 23 | 24 | - Install the prerequisite python packages 25 | 26 | ```sh 27 | pip install numpy Cheetah lxml 28 | pip install https://github.com/scipy/scipy/tarball/v0.11.0rc2 29 | export PKG_CONFIG_PATH="/usr/x11/lib/pkgconfig" pip install http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.1.1/matplotlib-1.1.1.tar.gz 30 | ``` 31 | 32 | - Install gnuradio (add `--with-qt` for `gr-qtgui`) 33 | 34 | ```sh 35 | brew tap titanous/homebrew-gnuradio 36 | brew install gnuradio 37 | ``` 38 | - Create the `~/.gnuradio/config.conf` config file for custom block support 39 | 40 | ```ini 41 | [grc] 42 | local_blocks_path=/usr/local/share/gnuradio/grc/blocks 43 | ``` 44 | 45 | ### Optional (for `gr-wxgui`) 46 | 47 | - Before installing `gnuradio`, install `wxmac` 2.9 with python bindings 48 | 49 | ```sh 50 | brew install wxmac --python 51 | ``` 52 | 53 | ### Optional (for rtl-sdr devices) 54 | 55 | - Install `rtlsdr` and related blocks 56 | 57 | ```sh 58 | brew install rtlsdr gr-osmosdr gr-baz --HEAD 59 | ``` 60 | -------------------------------------------------------------------------------- /gnuradio.rb: -------------------------------------------------------------------------------- 1 | require 'formula' 2 | 3 | class Gnuradio < Formula 4 | homepage 'http://gnuradio.org' 5 | url 'http://gnuradio.org/releases/gnuradio/gnuradio-3.6.5.1.tar.gz' 6 | sha1 '8d3846dc1d00c60b74f06c0bb8f40d57ee257b5a' 7 | head 'http://gnuradio.org/git/gnuradio.git' 8 | 9 | depends_on 'apple-gcc42' => :build 10 | depends_on 'cmake' => :build 11 | depends_on 'Cheetah' => :python 12 | depends_on 'lxml' => :python 13 | depends_on 'numpy' => :python 14 | depends_on 'scipy' => :python 15 | depends_on 'matplotlib' => :python 16 | depends_on 'python' 17 | depends_on 'boost' 18 | depends_on 'cppunit' 19 | depends_on 'gsl' 20 | depends_on 'fftw' 21 | depends_on 'swig' 22 | depends_on 'pygtk' 23 | depends_on 'sdl' 24 | depends_on 'libusb' 25 | depends_on 'orc' 26 | depends_on 'pyqt' if ARGV.include?('--with-qt') 27 | depends_on 'pyqwt' if ARGV.include?('--with-qt') 28 | depends_on 'doxygen' if ARGV.include?('--with-docs') 29 | 30 | fails_with :clang do 31 | build 421 32 | cause "Fails to compile .S files." 33 | end 34 | 35 | def options 36 | [ 37 | ['--with-qt', 'Build gr-qtgui.'], 38 | ['--with-docs', 'Build docs.'] 39 | ] 40 | end 41 | 42 | def patches 43 | DATA 44 | end 45 | 46 | def install 47 | 48 | # Force compilation with gcc-4.2 49 | ENV['CC'] = '/usr/local/bin/gcc-4.2' 50 | ENV['LD'] = '/usr/local/bin/gcc-4.2' 51 | ENV['CXX'] = '/usr/local/bin/g++-4.2' 52 | 53 | mkdir 'build' do 54 | args = ["-DCMAKE_PREFIX_PATH=#{prefix}", "-DQWT_INCLUDE_DIRS=#{HOMEBREW_PREFIX}/lib/qwt.framework/Headers"] + std_cmake_args 55 | args << '-DENABLE_GR_QTGUI=OFF' unless ARGV.include?('--with-qt') 56 | args << '-DENABLE_DOXYGEN=OFF' unless ARGV.include?('--with-docs') 57 | 58 | # From opencv.rb 59 | python_prefix = `python-config --prefix`.strip 60 | # Python is actually a library. The libpythonX.Y.dylib points to this lib, too. 61 | if File.exist? "#{python_prefix}/Python" 62 | # Python was compiled with --framework: 63 | args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'" 64 | if !MacOS::CLT.installed? and python_prefix.start_with? '/System/Library' 65 | # For Xcode-only systems, the headers of system's python are inside of Xcode 66 | args << "-DPYTHON_INCLUDE_DIR='#{MacOS.sdk_path}/System/Library/Frameworks/Python.framework/Versions/2.7/Headers'" 67 | else 68 | args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'" 69 | end 70 | else 71 | python_lib = "#{python_prefix}/lib/lib#{which_python}" 72 | if File.exists? "#{python_lib}.a" 73 | args << "-DPYTHON_LIBRARY='#{python_lib}.a'" 74 | else 75 | args << "-DPYTHON_LIBRARY='#{python_lib}.dylib'" 76 | end 77 | args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/include/#{which_python}'" 78 | end 79 | args << "-DPYTHON_PACKAGES_PATH='#{lib}/#{which_python}/site-packages'" 80 | 81 | system 'cmake', '..', *args 82 | system 'make' 83 | system 'make install' 84 | end 85 | end 86 | 87 | def python_path 88 | python = Formula.factory('python') 89 | kegs = python.rack.children.reject { |p| p.basename.to_s == '.DS_Store' } 90 | kegs.find { |p| Keg.new(p).linked? } || kegs.last 91 | end 92 | 93 | def caveats 94 | <<-EOS.undent 95 | If you want to use custom blocks, create this file: 96 | 97 | ~/.gnuradio/config.conf 98 | [grc] 99 | local_blocks_path=/usr/local/share/gnuradio/grc/blocks 100 | EOS 101 | end 102 | 103 | def which_python 104 | "python" + `python -c 'import sys;print(sys.version[:3])'`.strip 105 | end 106 | end 107 | 108 | __END__ 109 | diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt 110 | index f54aa4f..db0ce3c 100644 111 | --- a/grc/CMakeLists.txt 112 | +++ b/grc/CMakeLists.txt 113 | @@ -25,7 +25,7 @@ include(GrPython) 114 | GR_PYTHON_CHECK_MODULE("python >= 2.5" sys "sys.version.split()[0] >= '2.5'" PYTHON_MIN_VER_FOUND) 115 | GR_PYTHON_CHECK_MODULE("Cheetah >= 2.0.0" Cheetah "Cheetah.Version >= '2.0.0'" CHEETAH_FOUND) 116 | GR_PYTHON_CHECK_MODULE("lxml >= 1.3.6" lxml.etree "lxml.etree.LXML_VERSION >= (1, 3, 6, 0)" LXML_FOUND) 117 | -GR_PYTHON_CHECK_MODULE("pygtk >= 2.10.0" gtk "gtk.pygtk_version >= (2, 10, 0)" PYGTK_FOUND) 118 | +GR_PYTHON_CHECK_MODULE("pygtk >= 2.10.0" pygtk True PYGTK_FOUND) 119 | GR_PYTHON_CHECK_MODULE("numpy" numpy True NUMPY_FOUND) 120 | 121 | ######################################################################## 122 | diff --git a/gr-qtgui/lib/spectrumdisplayform.ui b/gr-qtgui/lib/spectrumdisplayform.ui 123 | index 049d4ff..a40502b 100644 124 | --- a/gr-qtgui/lib/spectrumdisplayform.ui 125 | +++ b/gr-qtgui/lib/spectrumdisplayform.ui 126 | @@ -518,7 +518,6 @@ 127 | 128 | 129 | 130 | - qPixmapFromMimeSource 131 | 132 | 133 | QwtWheel 134 | -------------------------------------------------------------------------------- /gr-baz.rb: -------------------------------------------------------------------------------- 1 | require 'formula' 2 | 3 | class GrBaz < Formula 4 | homepage 'http://wiki.spench.net/wiki/Gr-baz' 5 | head 'https://github.com/balint256/gr-baz.git' 6 | 7 | depends_on 'cmake' => :build 8 | depends_on 'gnuradio' 9 | 10 | def install 11 | mkdir 'build' do 12 | system 'cmake', '..', *std_cmake_args 13 | system 'make' 14 | system 'make install' 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /gr-osmosdr.rb: -------------------------------------------------------------------------------- 1 | require 'formula' 2 | 3 | class GrOsmosdr < Formula 4 | homepage 'http://sdr.osmocom.org/trac/wiki/GrOsmoSDR' 5 | head 'git://git.osmocom.org/gr-osmosdr', :branch => 'gr3.6' 6 | 7 | depends_on 'cmake' => :build 8 | depends_on 'gnuradio' 9 | depends_on 'rtlsdr' 10 | 11 | def install 12 | mkdir 'build' do 13 | system 'cmake', '..', *std_cmake_args << "-DPYTHON_LIBRARY=#{python_path}/Frameworks/Python.framework/" 14 | system 'make' 15 | system 'make install' 16 | end 17 | end 18 | 19 | def python_path 20 | python = Formula.factory('python') 21 | kegs = python.rack.children.reject { |p| p.basename.to_s == '.DS_Store' } 22 | kegs.find { |p| Keg.new(p).linked? } || kegs.last 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /rtlsdr.rb: -------------------------------------------------------------------------------- 1 | require 'formula' 2 | 3 | class Rtlsdr < Formula 4 | homepage 'http://sdr.osmocom.org/trac/wiki/rtl-sdr' 5 | head 'git://git.osmocom.org/rtl-sdr.git' 6 | 7 | depends_on 'pkg-config' => :build 8 | depends_on 'automake' => :build 9 | depends_on 'libtool' => :build 10 | depends_on 'cmake' => :build 11 | depends_on 'libusb' 12 | 13 | if MacOS.xcode_version.to_f >= 4.3 14 | depends_on 'autoconf' 15 | end 16 | 17 | def install 18 | args = ["--prefix=#{prefix}"] 19 | system "autoreconf -i" 20 | system "./configure", *args 21 | system "make install" 22 | end 23 | end 24 | --------------------------------------------------------------------------------