source: trunk/dports/science/gr-osmosdr/Portfile

Last change on this file was 153032, checked in by michaelld@…, 10 months ago

gr-osmosdr: "${prefix}/Library/Frameworks" -> "${frameworks_dir}".

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 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 153032 2016-09-22 14:30:23Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6PortGroup           active_variants 1.1
7
8name                gr-osmosdr
9maintainers         michaelld openmaintainer
10
11description         gr-osmosdr provides support for OsmoSDR hardware within GNU Radio
12long_description    Includes OSMO SDR support GNU Radio source and sink blocks in C++, Python, and GNU Radio Companion (grc).  This port also offers a wrapper functionality for the FunCube Dongle, FunCube Dongle Pro+, HackRF, RFSpace, Ettus UHD, and rtl-sdr radios and software.  By using gr-osmosdr source you can take advantage of a common software API in your applications independent of the underlying radio hardware. This port is kept up with the gr-osmosdr GIT 'master' branch, which is typically updated weekly to monthly, providing compatibility with GNU Radio release 3.7 API: the gnuradio and gnuradio-devel ports.
13
14categories          science comms
15homepage            http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
16license             GPL-3
17platforms           darwin macosx
18
19set commit          164a09fc11cec2d8b15b38e8b512fa542d6cecc7
20version             20160228
21revision            3
22distname            ${name}-${commit}
23checksums           ${distname}.tar.gz \
24                    rmd160 1971a00f876eac172cf7e19c43bf736e566a01d6 \
25                    sha256 0b10cd56a9c0319ff60f60fcf4f59e996a855b5f7b2efea55afc0d5a876d8bd6
26
27master_sites        http://cgit.osmocom.org/gr-osmosdr/snapshot/
28
29# allow gr-osmosdr to work with both gnuradio and gnuradio-devel ...
30
31depends_lib-append  path:lib/libgnuradio-runtime.dylib:gnuradio
32
33# ... but not with gnuradio-next
34
35pre-fetch {
36    if {![catch {set installed [lindex [registry_active gnuradio-next] 0]}]} {
37        # gnuradio-next is installed; this version of gr-osmosdr does not work with gnuradio-next
38        ui_msg "\nError: ${name} requires the gnuradio or gnuradio-devel port, and will not work with the gnuradio-next port.  deactivate gnuradio-next, and then install or activate gnuradio or gnuradio-devel.\n"
39        return -code error "Invalid port dependency: gnuradio-next"
40    }
41}
42
43livecheck.url       http://cgit.osmocom.org/gr-osmosdr/log/?h=master
44livecheck.version   ${commit}
45livecheck.regex     id=(\[a-f0-9\]+).*>HEAD<
46
47# do VPATH (out of source tree) build
48
49cmake.out_of_source yes
50
51# remove top-level library path, such that internal libraries are used
52# instead of any already-installed ones.
53
54configure.ldflags-delete -L${prefix}/lib
55
56# per user concensus: enable all variants except +debug and +universal
57
58default_variants +docs +uhd +swig +hackrf +fcdproplus +rtlsdr +bladeRF +airspy +soapysdr +sdrplay
59
60# common configure flags
61
62configure.args-append \
63    -DENABLE_IQBALANCE=OFF \
64    -DENABLE_OSMOSDR=OFF \
65    -DENABLE_FCD=ON \
66    -DENABLE_FILE=ON \
67    -DENABLE_MIRI=OFF \
68    -DENABLE_RFSPACE=ON \
69    -DENABLE_REDPITAYA=OFF
70
71# specify the Python dependencies
72
73depends_lib-append \
74    port:python27
75
76# specify the Python version to use
77
78configure.args-append \
79    -DPYTHON_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7 \
80    -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/Headers \
81    -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.7/Python \
82    -DGR_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
83
84variant docs description "Install ${name} documentation" {
85
86    depends_build-append \
87        port:doxygen \
88        path:bin/dot:graphviz
89
90    configure.args-append \
91        -DDOXYGEN_DOT_EXECUTABLE=${prefix}/bin/dot \
92        -DDOXYGEN_EXECUTABLE=${prefix}/bin/doxygen
93
94}
95
96if {![variant_isset docs]} {
97
98    configure.args-append \
99        -DDOXYGEN_DOT_EXECUTABLE= \
100        -DDOXYGEN_EXECUTABLE=
101
102}
103
104variant uhd description "Install ${name} with support for UHD" {
105
106    # allow uhd or uhd-devel
107
108    depends_lib-append \
109        path:lib/libuhd.dylib:uhd
110
111    # require gnuradio to also have this variant
112
113    require_active_variants \
114        path:lib/libgnuradio-runtime.dylib:gnuradio uhd
115
116    configure.args-append \
117        -DENABLE_UHD=ON \
118        -DGNURADIO_UHD_INCLUDE_DIRS=${prefix}/include \
119        -DGNURADIO_UHD_LIBRARIES=${prefix}/lib/libgnuradio-uhd.dylib \
120        -DUHD_INCLUDE_DIRS=${prefix}/include/uhd \
121        -DUHD_LIBRARIES=${prefix}/lib/libuhd.dylib
122
123}
124
125if {![variant_isset uhd]} {
126
127    configure.args-append \
128        -DENABLE_UHD=OFF \
129        -DGNURADIO_UHD_INCLUDE_DIRS= \
130        -DGNURADIO_UHD_LIBRARIES= \
131        -DUHD_INCLUDE_DIRS= \
132        -DUHD_LIBRARIES=
133
134}
135
136variant swig description "Install ${name} with support for SWIG-base Python bindings" {
137
138    depends_lib-append \
139        port:swig-python
140
141    # require gnuradio to also have this variant
142
143    require_active_variants \
144        path:lib/libgnuradio-runtime.dylib:gnuradio swig
145
146    configure.args-append \
147        -DSWIG_EXECUTABLE=${prefix}/bin/swig
148
149}
150
151if {![variant_isset swig]} {
152
153    configure.args-append \
154        -DSWIG_EXECUTABLE=
155
156}
157
158variant hackrf description "Install ${name} with support for hackrf" {
159
160    depends_lib-append port:hackrf
161    configure.args-append -DENABLE_HACKRF=ON
162
163}
164
165if {![variant_isset hackrf]} {
166
167    configure.args-append -DENABLE_HACKRF=OFF
168
169}
170
171variant fcdproplus description "Install ${name} with support for FunCube Dongle Pro+ (fcdproplus)" {
172
173    depends_lib-append port:gr-fcdproplus
174    configure.args-append -DENABLE_FCDPP=ON
175
176}
177
178if {![variant_isset fcdproplus]} {
179
180    configure.args-append -DENABLE_FCDPP=OFF
181
182}
183
184variant rtlsdr description "Install ${name} with support for rtl-sdr" {
185
186    depends_lib-append port:rtl-sdr
187    configure.args-append -DENABLE_RTL=ON -DENABLE_RTL_TCP=ON
188
189}
190
191if {![variant_isset rtlsdr]} {
192
193    configure.args-append -DENABLE_RTL=OFF -DENABLE_RTL_TCP=OFF
194
195}
196
197variant bladeRF description "Install ${name} with support for bladeRF" {
198
199    depends_lib-append port:bladeRF
200    configure.args-append -DENABLE_BLADERF=ON
201
202}
203
204if {![variant_isset bladeRF]} {
205
206    configure.args-append -DENABLE_BLADERF=OFF
207
208}
209
210variant airspy description "Install ${name} with support for airspy" {
211
212    depends_lib-append port:airspy
213    configure.args-append -DENABLE_AIRSPY=ON
214
215}
216
217if {![variant_isset airspy]} {
218
219    configure.args-append -DENABLE_AIRSPY=OFF
220
221}
222
223variant soapysdr description "Install ${name} with support for SoapySDR" {
224
225    depends_lib-append port:soapysdr
226    configure.args-append -DENABLE_SOAPY=ON
227
228}
229
230if {![variant_isset soapysdr]} {
231
232    configure.args-append -DENABLE_SOAPY=OFF
233
234}
235
236variant sdrplay description "Install ${name} with support for SDRplay" {
237
238    depends_lib-append port:sdrplay
239    configure.args-append -DENABLE_NONFREE=ON -DENABLE_SDRPLAY=ON
240
241}
242
243if {![variant_isset sdrplay]} {
244
245    configure.args-append -DENABLE_NONFREE=OFF -DENABLE_SDRPLAY=OFF
246
247}
Note: See TracBrowser for help on using the repository browser.