source: trunk/dports/science/gnuradio/Portfile

Last change on this file was 154468, checked in by michaelld@…, 11 months ago

gnuradio-devel: update to 3fc55073 (20161028).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.9 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 154468 2016-10-30 12:12:47Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6PortGroup           wxWidgets 1.0
7PortGroup           github 1.0
8
9wxWidgets.use       wxPython-3.0
10
11name                gnuradio
12maintainers         michaelld
13
14description         GNU Radio is Software Defined Radio (SDR)
15
16categories          science comms
17license             GPL-3
18platforms           darwin macosx
19
20dist_subdir         gnuradio
21
22if {${subport} eq ${name}} {
23
24    github.setup    gnuradio gnuradio 3.7.10.1 v
25    revision        1
26
27    long_description    ${description}: \
28        This port is kept up with the GNU Radio release, currently ${version}, which is typically updated every few months.
29
30    conflicts       gnuradio-next gnuradio-devel
31
32    checksums \
33        rmd160 3aa056006c094dd4120593ac65fbee85965a3ca1 \
34        sha256 c77cc8fefdb054b0320bc4fc906c6013a6b6518bfb4de65f5d1631dfe5d22115
35
36    # set the version override string
37
38    set GR_VERSION_INFO "Release"
39
40    # overload the github livecheck regex to look for versions that
41    # are just numbers and '.', no letters (e.g., "3.7.3git").
42
43    livecheck.regex archive/[join ${github.tag_prefix} ""](\[0-9\.\]+)${extract.suffix}
44
45}
46
47subport gnuradio-devel {
48
49    long_description    ${description}: \
50        This port is kept up with the GNU Radio GIT 'master' branch, which is typically updated daily to weekly.  This version of GNU Radio generally contains fixes to, and its API is compatible with, the current GNU Radio release, and will be incorporated in an upcoming release.  This port may or not compile or function correctly, as it represents a work in progress.  If it does not work, check back in a few days.  Or try deactivating the currently active gnuradio port, cleaning any current builds, and trying again.
51
52    name                gnuradio-devel
53    conflicts           gnuradio gnuradio-next
54
55    github.setup        gnuradio gnuradio 3fc55073f28ec97036dfe3f5ff9d9a7491f3ea80
56    version             20161028
57    checksums \
58        rmd160 1dd6b64b72536d6c6fa37bf82a909ff82ef937ae \
59        sha256 3802289737fea7e3e5b2b3563109f85117190eeed8d0e646e733aad3e5754a3c
60
61    # set the version override string
62
63    set GR_VERSION_INFO "devel-git-[string range ${github.version} 0 7](${version})"
64
65}
66
67subport gnuradio-next {
68
69    long_description    ${description}: \
70        This port is kept up with the GNU Radio GIT 'next' branch, which is typically updated daily to weekly.  This version of GNU Radio represents the next major release of GNU Radio, and hence its API is likely to be different than that provided by either gnuradio or gnuradio-devel.  This port may or not compile or function correctly, as it represents a work in progress.  If it does not work, check back in a few days.  Or try deactivating the currently active gnuradio port, cleaning any current builds, and trying again.
71
72    name                gnuradio-next
73    conflicts           gnuradio gnuradio-devel
74
75    github.setup        gnuradio gnuradio 68eb2afc2128b2fe942a6be48c903dea6b4b4489
76    version             20160816
77    revision            1
78    checksums \
79        rmd160 cb297ba374c6af5c7fded74a259333e2e171e8eb \
80        sha256 6c6353f19e5dd4c54edf99a26fef778ce440e10270e498191c13732b02e61d7f
81
82    # set the version override string
83
84    set GR_VERSION_INFO "next-git-[string range ${github.version} 0 7](${version})"
85
86    # overload the github livecheck URL with the correct branch
87
88    livecheck.url       ${github.homepage}/commits/next.atom
89
90}
91
92# temporary patch to fix header creation to be before dependencies
93# are determined, such that local (to the build) headers are found
94# before already-installed ones.
95
96if {${subport} eq "gnuradio"} {
97
98    # patches for release only
99    patchfiles-append \
100        patch-cmake-expand.release.diff
101
102} elseif {${subport} eq "gnuradio-devel"} {
103
104    # patches for devel
105    patchfiles-append \
106        patch-cmake-expand.devel.diff
107
108} else {
109   
110    # patches for next
111    patchfiles-append \
112        patch-cmake-expand.next.diff
113
114}
115
116# override githib PortGroup homepage setting
117
118homepage            http://gnuradio.org/
119
120use_parallel_build  yes
121
122depends_lib-append  \
123    port:boost \
124    port:cppunit \
125    port:fftw-3-single \
126    port:log4cpp
127
128# need matplotlib for polar encoder/decoder, runtime
129# only. This is not checked for at configure.
130
131depends_run-append port:py27-matplotlib
132
133# do VPATH (out of source tree) build
134
135cmake.out_of_source yes
136
137# remove top-level library path, such that internal libraries
138# are used instead of any already-installed ones.
139
140configure.ldflags-delete -L${prefix}/lib
141
142# install CMake files into this directory.
143
144configure.args-append \
145    -DCMAKE_MODULES_DIR=${prefix}/share/cmake
146
147# override default version string to be MacPorts-specific
148
149configure.args-append \
150    -DGR_GIT_COUNT="MacPorts" \
151    -DGR_GIT_HASH="${GR_VERSION_INFO}"
152
153# release, devel, and next can use either the Volk.
154
155depends_lib-append path:lib/libvolk.dylib:volk
156
157# disable using internal VOLK
158
159configure.args-append \
160    -DENABLE_INTERNAL_VOLK=OFF
161
162post-destroot {
163
164    # fix residual cmake module install location when
165    # CMAKE_MODULES_DIR does not do the whole trick
166
167    # GNU Radio installs cmake files as "Config*.cmake", which has the
168    # odd behavior of requiring the files to be in a top-level shared
169    # cmake directory; for MacPorts' cmake, these are, apparently:
170    # ${prefix}/lib:${prefix}/share/cmake .  I don't know why ... but
171    # I do not want cmake files installed into the former, so move
172    # them to the latter.
173
174    if {[file exists ${destroot}${prefix}/lib/cmake]} {
175        xinstall -m 755 -d ${destroot}${prefix}/share
176        move ${destroot}${prefix}/lib/cmake \
177            ${destroot}${prefix}/share
178    }
179}
180
181# per user concensus: enable all variants except +debug and +universal
182# (and, for devel and next: except +ctrlport, +performance_counters, and +zeromq);
183
184default_variants +docs +grc +qtgui +wxgui +uhd +wavelet \
185    +jack +portaudio +swig +sdl
186
187# require Python 2.7
188
189depends_lib-append \
190    port:python27
191
192# these are checked for at configure, then required for
193# runtime; so use depends_lib to get both.
194
195depends_lib-append \
196    port:py27-numpy \
197    port:py27-cheetah
198
199# these are not checked for at configure, but are required
200# for runtime; so use depends_run.
201
202depends_run-append \
203    port:py27-opengl \
204    port:py27-scipy
205
206# specify the Python version to use
207
208configure.args-append \
209    -DPYTHON_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7 \
210    -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/Headers \
211    -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.7/Python \
212    -DGR_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
213
214variant docs description "Install GNU Radio documentation" {
215
216    depends_lib-append \
217        port:doxygen \
218        path:bin/dot:graphviz \
219        port:xmlto
220
221    depends_build-append \
222        port:py27-sphinx
223
224    configure.args-append \
225        -DENABLE_DOXYGEN=ON \
226        -DENABLE_SPHINX=ON \
227        -DSPHINX_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/2.7/bin/sphinx-build
228
229}
230
231if {![variant_isset docs]} {
232
233    configure.args-append \
234        -DENABLE_DOXYGEN=OFF \
235        -DENABLE_SPHINX=OFF
236
237}
238
239variant grc requires swig description "Install GNU Radio Companion" {
240
241    configure.args-append \
242        -DENABLE_GRC=ON
243
244    # these are checked for at configure, then required
245    # for runtime; so use depends_lib to get both.
246
247    depends_lib-append \
248        port:py27-lxml \
249        port:py27-pygtk
250
251}
252
253if {![variant_isset grc]} {
254
255    configure.args-append \
256        -DENABLE_GRC=OFF
257
258}
259
260variant qtgui description "Install GNU Radio with support for Qt GUI" {
261
262    PortGroup qt4 1.0
263
264    depends_lib-append \
265        port:qwtplot3d
266
267    # pyqt4 is checked for at configure, then required for
268    # runtime; so use depends_lib to get both.  Can use
269    # either py*-pyqt4 or py*-pyqt4-devel.
270
271    depends_lib-append \
272        path:share/py27-sip/PyQt4:py27-pyqt4
273
274    # Requires qwt >= 5.2, so not the "qwt" port.  Also requires
275    # py*-pyqwt which does not compile with qwt >= 6.0; so -have- to
276    # use qwt52 for now.
277
278    depends_lib-append port:qwt52
279
280    # pyqwt is not checked for at configure, but is
281    # required for runtime; so use depends_run.
282
283    depends_run-append \
284        port:py27-pyqwt
285
286    configure.args-append \
287        -DENABLE_GR_QTGUI=ON \
288        -DQT_QMAKE_EXECUTABLE=${qt_qmake_cmd}
289
290}
291
292if {![variant_isset qtgui]} {
293
294    # qt4 portgroup provides pkgconfig, so if not using Qt need that here.
295
296    depends_build-append \
297        port:pkgconfig
298
299    configure.args-append \
300        -DENABLE_GR_QTGUI=OFF \
301        -DQT_QMAKE_EXECUTABLE=
302
303}
304
305variant wxgui description "Install GNU Radio with support for Wx GUI" {
306
307    depends_lib-append \
308        port:${wxWidgets.port}
309
310    # wxpython is checked for at configure, then required
311    # for runtime; so use depends_lib to get both.
312
313    depends_lib-append \
314        port:py27-wxpython-3.0
315
316    configure.args-append \
317        -DENABLE_GR_WXGUI=ON
318
319}
320
321if {![variant_isset wxgui]} {
322
323    configure.args-append \
324        -DENABLE_GR_WXGUI=OFF
325
326}
327
328variant uhd description "Install GNU Radio with support for UHD" {
329
330    # allow for uhd or uhd-devel
331
332    depends_lib-append \
333        path:lib/libuhd.dylib:uhd
334
335    configure.args-append \
336        -DENABLE_GR_UHD=ON \
337        -DUHD_INCLUDE_DIRS=${prefix}/include \
338        -DUHD_LIBRARIES=${prefix}/lib/libuhd.dylib
339
340}
341
342if {![variant_isset uhd]} {
343
344    configure.args-append \
345        -DENABLE_GR_UHD=OFF \
346        -DUHD_INCLUDE_DIRS= \
347        -DUHD_LIBRARIES=
348
349}
350
351variant wavelet description "Install GNU Radio Wavelet component" {
352
353    depends_lib-append \
354        port:gsl
355
356    configure.args-append \
357        -DENABLE_GR_WAVELET=ON
358
359}
360
361if {![variant_isset wavelet]} {
362
363    configure.args-append \
364        -DENABLE_GR_WAVELET=OFF
365
366}
367
368variant jack description "Install GNU Radio with support for JACK audio" {
369
370    depends_lib-append \
371        port:jack
372
373    configure.args-append \
374        -DJACK_INCLUDE_DIR=${prefix}/include \
375        -DJACK_LIBRARY=${prefix}/lib/libjack.dylib
376
377}
378
379if {![variant_isset jack]} {
380
381    configure.args-append \
382        -DJACK_INCLUDE_DIR= \
383        -DJACK_LIBRARY=
384
385}
386
387variant portaudio description "Install GNU Radio with support for portaudio audio" {
388
389    depends_lib-append \
390        port:portaudio
391
392    configure.args-append \
393        -DPORTAUDIO_INCLUDE_DIRS=${prefix}/include \
394        -DPORTAUDIO_LIBRARIES=${prefix}/lib/libportaudio.dylib
395
396}
397
398if {![variant_isset portaudio]} {
399
400    configure.args-append \
401        -DPORTAUDIO_INCLUDE_DIRS= \
402        -DPORTAUDIO_LIBRARIES=
403
404}
405
406variant swig description "Install GNU Radio with support for SWIG-base Python bindings" {
407
408    depends_build-append \
409        port:swig-python
410
411    configure.args-append \
412        -DSWIG_EXECUTABLE=${prefix}/bin/swig
413
414}
415
416if {![variant_isset swig]} {
417
418    configure.args-append \
419        -DSWIG_EXECUTABLE=
420
421}
422
423variant sdl description "Install GNU Radio with support for SDL-based video" {
424
425    depends_lib-append \
426        port:libsdl
427
428    configure.args-append \
429        -DENABLE_GR_VIDEO_SDL=ON \
430        -DSDLMAIN_LIBRARY=${prefix}/lib/libSDLmain.a \
431        -DSDL_INCLUDE_DIR=${prefix}/include/SDL
432
433}
434
435if {![variant_isset sdl]} {
436
437    configure.args-append \
438        -DENABLE_GR_VIDEO_SDL=OFF \
439        -DSDLMAIN_LIBRARY= \
440        -DSDL_INCLUDE_DIR=
441
442}
443
444variant ctrlport description {Enable control port enhancements (EXPERIMENTAL)} {
445# as of commit 2e691d87 (2014-08-08), all CTRLPORT calls are noops
446# because of an issue with ICE.  So, allow +ctrlport, but it won't do
447# anything until this is fixed.
448
449# as of commit 621c086b (2015-04-16), CTRLPORT has been moved to using
450# thrift, which needs debugging when building on OSX. Just disable
451# CTRLPORT for now.
452
453    configure.args-append -DENABLE_GR_CTRLPORT=OFF
454
455}
456
457if {![variant_isset ctrlport]} {
458
459    configure.args-append -DENABLE_GR_CTRLPORT=OFF
460
461}
462
463variant performance_counters description {Enable support for performance counters (EXPERIMENTAL)} {
464
465    # these are not checked for at configure, but are
466    # required for runtime; so use depends_run.
467
468    depends_run-append \
469        port:py27-pygraphviz \
470        port:py27-networkx
471
472    configure.args-append \
473        -DENABLE_PERFORMANCE_COUNTERS=ON
474
475}
476
477if {![variant_isset performance_counters]} {
478
479    configure.args-append \
480        -DENABLE_PERFORMANCE_COUNTERS=OFF
481
482}
483
484variant zeromq description {Install GNU Radio with support for the ZeroMQ lightweight messaging kernel (EXPERIMENTAL)} {
485
486    depends_lib-append \
487        port:cppzmq
488
489    # pyzmq is not checked for at configure, but is
490    # required for runtime; so use depends_run.
491
492    depends_run-append \
493        port:py27-zmq
494
495    configure.args-append \
496        -DENABLE_GR_ZEROMQ=ON
497
498}
499
500if {![variant_isset zeromq]} {
501
502    configure.args-append \
503        -DENABLE_GR_ZEROMQ=OFF
504
505}
506
507variant cxx11 description "Compile using C++11" {
508
509    # require C++11
510
511    configure.cxxflags-append -std=c++11
512
513    if {${configure.cxx_stdlib} eq "libstdc++"} {
514
515        # *clang* when using libstdc++ do not seem to support C++11;
516        # C++11 support seems to need GCC 4.7+ when using libstdc++;
517        # could use C++0x support on GCC4.[56], but just ignore it since
518        # there are newer compilers already in place as defaults.
519
520        # Blacklist GCC compilers not supporting C++11 and all CLANG.
521        # This is probably not necessary, but it's good practice.
522
523        compiler.blacklist-append *clang* {*gcc-3*} {*gcc-4.[0-6]}
524
525        # and whitelist those we do want to use. wish there were a better way.
526        # these will be used in the order provided.
527
528        compiler.whitelist macports-gcc-4.9 macports-gcc-4.8 macports-gcc-4.7
529
530    } else {
531
532        # using libc++;
533        # Blacklist Clang not supporting C++11 in some form and all GCC.
534
535        compiler.blacklist-append *gcc* {clang < 500}
536
537    }
538}
Note: See TracBrowser for help on using the repository browser.