From 49629afcc3d345bcf2301c92c99247b930edf7c9 Mon Sep 17 00:00:00 2001 From: FX Coudert Date: Sun, 1 Sep 2019 20:54:10 +0200 Subject: [PATCH] gnuradio 3.8.0.0 * Add click and click-plugins for gr_modtool * Explicitly enable gr_modtool since we use it in the test * Install python modules to site-packages * Use upstream patch for log4cpp * Remove old features that no longer exist Co-authored-by: Jonathan Chang --- Formula/gnuradio.rb | 88 ++++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/Formula/gnuradio.rb b/Formula/gnuradio.rb index 98b60174c137..f6d49e5dbd01 100644 --- a/Formula/gnuradio.rb +++ b/Formula/gnuradio.rb @@ -1,9 +1,8 @@ class Gnuradio < Formula desc "SDK providing the signal processing runtime and processing blocks" homepage "https://gnuradio.org/" - url "https://gnuradio.org/releases/gnuradio/gnuradio-3.7.13.4.tar.gz" - sha256 "c536c268b1e9c24f1206bbc881a5819ac46e662f4e8beaded6f3f441d3502f0d" - revision 9 + url "https://www.gnuradio.org/releases/gnuradio/gnuradio-3.8.0.0.tar.xz" + sha256 "1980b4b5c29679b1c8d0804032e412c9a9cae8dd27362cbe032b9152dc2b852b" head "https://github.com/gnuradio/gnuradio.git" bottle do @@ -20,65 +19,77 @@ class Gnuradio < Formula depends_on "boost" depends_on "fftw" depends_on "gsl" + depends_on "log4cpp" depends_on "numpy" + depends_on "orc" depends_on "portaudio" - depends_on "python@2" + depends_on "python" depends_on "uhd" depends_on "zeromq" + patch do + url "https://github.com/gnuradio/gnuradio/commit/23bf13685faabe40fed4314534ae71936cdbeece.diff?full_index=1" + sha256 "777b44aad8db1df5fd7b02cbc09885935f4d8448e6f31b692e70a80b51463c41" + end + # cheetah starts here resource "Markdown" do - url "https://files.pythonhosted.org/packages/b3/73/fc5c850f44af5889192dff783b7b0d8f3fe8d30b65c8e3f78f8f0265fecf/Markdown-2.6.11.tar.gz" - sha256 "a856869c7ff079ad84a3e19cd87a64998350c2b94e9e08e44270faef33400f81" + url "https://files.pythonhosted.org/packages/ac/df/0ae25a9fd5bb528fe3c65af7143708160aa3b47970d5272003a1ad5c03c6/Markdown-3.1.1.tar.gz" + sha256 "2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a" end resource "Cheetah" do - url "https://files.pythonhosted.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz" - sha256 "be308229f0c1e5e5af4f27d7ee06d90bb19e6af3059794e5fd536a6f29a9b550" + url "https://files.pythonhosted.org/packages/3e/16/c711180492c9f40fb64dffb436fe1b91e3031637b478edb8de3c4b74097a/Cheetah3-3.2.3.tar.gz" + sha256 "7c450bce04a82d34cf6d48992c736c2048246cbc00f7b4903a39cf9a8ea3990c" end # cheetah ends here resource "lxml" do - url "https://files.pythonhosted.org/packages/54/a6/43be8cf1cc23e3fa208cab04ba2f9c3b7af0233aab32af6b5089122b44cd/lxml-4.2.3.tar.gz" - sha256 "622f7e40faef13d232fb52003661f2764ce6cdef3edb0a59af7c1559e4cc36d1" + url "https://files.pythonhosted.org/packages/c4/43/3f1e7d742e2a7925be180b6af5e0f67d38de2f37560365ac1a0b9a04c015/lxml-4.4.1.tar.gz" + sha256 "c81cb40bff373ab7a7446d6bbca0190bccc5be3448b47b51d729e37799bb5692" end resource "MarkupSafe" do - url "https://files.pythonhosted.org/packages/4d/de/32d741db316d8fdb7680822dd37001ef7a448255de9699ab4bfcbdf4172b/MarkupSafe-1.0.tar.gz" - sha256 "a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" + url "https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz" + sha256 "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b" end resource "Mako" do - url "https://files.pythonhosted.org/packages/eb/f3/67579bb486517c0d49547f9697e36582cd19dafb5df9e687ed8e22de57fa/Mako-1.0.7.tar.gz" - sha256 "4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae" + url "https://files.pythonhosted.org/packages/b0/3c/8dcd6883d009f7cae0f3157fb53e9afb05a0d3d33b3db1268ec2e6f4a56b/Mako-1.1.0.tar.gz" + sha256 "a36919599a9b7dc5d86a7a8988f23a9a3a3d083070023bab23d64f7f1d1e0a4b" end resource "six" do - url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz" - sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + url "https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz" + sha256 "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" end - resource "cppzmq" do - url "https://raw.githubusercontent.com/zeromq/cppzmq/46fc0572c5e9f09a32a23d6f22fd79b841f77e00/zmq.hpp" - sha256 "964031c0944f913933f55ad1610938105a6657a69d1ac5a6dd50e16a679104d5" + resource "click" do + url "https://files.pythonhosted.org/packages/f8/5c/f60e9d8a1e77005f664b76ff8aeaee5bc05d0a91798afd7f53fc998dbc47/Click-7.0.tar.gz" + sha256 "5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7" end - # patch for boost 1.70.0, remove after next release - patch do - url "https://github.com/gnuradio/gnuradio/commit/6dc8229fd0dda25c054c2194ee2c9b28affe92d8.patch?full_index=1" - sha256 "9836235ea69b3d66b5cd4b2cdc89f80d010797d2bd59dc5c6631a96af921db8c" + resource "click-plugins" do + url "https://files.pythonhosted.org/packages/5f/1d/45434f64ed749540af821fd7e42b8e4d23ac04b1eda7c26613288d6cd8a8/click-plugins-1.1.1.tar.gz" + sha256 "46ab999744a9d831159c3411bb0c79346d94a444df9a3a3742e9ed63645f264b" end - def install - ENV.prepend_path "PATH", "/System/Library/Frameworks/Python.framework/Versions/2.7/bin" + resource "cppzmq" do + url "https://raw.githubusercontent.com/zeromq/cppzmq/f5b36e56/zmq.hpp" + sha256 "cdb75e90ff173e13b060906a63bc42bec6c1c1d8d30944acd7896ab1e7a52498" + end + def install ENV["CHEETAH_INSTALL_WITHOUT_SETUPTOOLS"] = "1" ENV["XML_CATALOG_FILES"] = etc/"xml/catalog" - ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" + ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version - %w[Markdown Cheetah MarkupSafe Mako six].each do |r| + xy = Language::Python.major_minor_version "python3" + ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages" + + %w[Markdown Cheetah MarkupSafe Mako six click click-plugins].each do |r| resource(r).stage do - system "python", *Language::Python.setup_install_args(libexec/"vendor") + system "python3", *Language::Python.setup_install_args(libexec/"vendor") end end @@ -99,13 +110,14 @@ def install -DGR_PKG_CONF_DIR=#{etc}/gnuradio/conf.d -DGR_PREFSDIR=#{etc}/gnuradio/conf.d -DENABLE_DEFAULT=OFF + -DPYTHON_EXECUTABLE=#{Formula["python"].bin}/python3 + -DGR_PYTHON_DIR=lib/python#{xy}/site-packages ] - enabled = %w[GR_ANALOG GR_FFT VOLK GR_FILTER GNURADIO_RUNTIME - GR_BLOCKS GR_PAGER GR_NOAA GR_CHANNELS GR_AUDIO - GR_FCD GR_VOCODER GR_FEC GR_DIGITAL GR_DTV GR_ATSC - GR_TRELLIS GR_ZEROMQ GR_WAVELET GR_UHD DOXYGEN SPHINX - PYTHON GR_UTILS] + enabled = %w[DOXYGEN GNURADIO_RUNTIME GR_ANALOG GR_AUDIO GR_BLOCKS + GR_CHANNELS GR_DIGITAL GR_DTV GR_FEC GR_FFT GR_FILTER + GR_MODTOOL GR_TRELLIS GR_UHD GR_UTILS GR_VOCODER GR_WAVELET + GR_ZEROMQ PYTHON SPHINX VOLK] enabled.each do |c| args << "-DENABLE_#{c}=ON" end @@ -153,9 +165,11 @@ class top_block : public gr::top_block { top.run(); } EOS - system ENV.cxx, "-L#{lib}", "-L#{Formula["boost"].opt_lib}", - "-lgnuradio-blocks", "-lgnuradio-runtime", "-lgnuradio-pmt", - "-lboost_system", testpath/"test.c++", "-o", testpath/"test" + + system ENV.cxx, "-std=c++11", "-L#{lib}", "-L#{Formula["boost"].opt_lib}", + "-L#{Formula["log4cpp"].opt_lib}", "-lgnuradio-blocks", + "-lgnuradio-runtime", "-lgnuradio-pmt", + "-lboost_system", "-llog4cpp", "test.c++", "-o", "test" system "./test" (testpath/"test.py").write <<~EOS @@ -182,7 +196,7 @@ def main(top_block_cls=top_block, options=None): main() EOS - system "python2.7", testpath/"test.py" + system "python3", testpath/"test.py" cd testpath do system "#{bin}/gr_modtool", "newmod", "test"