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

Last change on this file since 135414 was 135414, checked in by michaelld@…, 5 years ago

various gnuradio dependents: rev-bump for new gnuradio ABI.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.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 135414 2015-04-23 15:57:06Z michaelld@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
12
13categories          science comms
14homepage            http://sdr.osmocom.org/trac/wiki/GrOsmoSDR
15license             GPL-3
16platforms           darwin macosx
17
18set description_common {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.}
19
20if {${subport} eq ${name}} {
21
22    long_description    ${description}\
23        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.  ${description_common}
24
25    fetch.type          git
26    git.url             git://git.osmocom.org/gr-osmosdr
27    git.branch          48045b597d3a605d2cb1cd2df62d07317009b9ea
28    version             20150110
29    revision            3
30
31    conflicts           gr-osmosdr-legacy
32
33    # allow gr-osmosdr to work with both gnuradio and gnuradio-devel ...
34
35    depends_lib-append  path:lib/libgnuradio-runtime.dylib:gnuradio
36
37    # ... but not with gnuradio-legacy or gnuradio-next
38
39    pre-fetch {
40        if {![catch {set installed [lindex [registry_active gnuradio-legacy] 0]}]} {
41            # gnuradio-legacy is installed; this version of gr-osmosdr does not work with gnuradio-legacy
42            ui_msg "\nError: ${name} requires the gnuradio or gnuradio-devel port, and will not work with the gnuradio-legacy port.  deactivate gnuradio-legacy, and then install or activate gnuradio or gnuradio-devel.\n"
43            return -code error "Invalid port dependency: gnuradio-legacy"
44        }
45        if {![catch {set installed [lindex [registry_active gnuradio-next] 0]}]} {
46            # gnuradio-next is installed; this version of gr-osmosdr does not work with gnuradio-next
47            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"
48            return -code error "Invalid port dependency: gnuradio-next"
49        }
50    }
51
52    livecheck.url       http://cgit.osmocom.org/gr-osmosdr/log/?h=master
53    livecheck.version   ${git.branch}
54    livecheck.regex     id=(\[a-f0-9\]+).*>HEAD<
55
56}
57
58subport gr-osmosdr-legacy {
59
60    long_description    ${description}\
61        This port is for the gr-osmosdr gr3.6 branch, providing compatibility with GNU Radio release 3.6 API: the gnuradio-legacy port.  ${description_common}
62
63    version             20140503
64    revision            8
65
66    fetch.type          git
67    git.url             git://git.osmocom.org/gr-osmosdr
68    git.branch          c7cb045fcb091243aee3e47dd6fdfd0faba89f69
69
70    conflicts           gr-osmosdr
71
72    # gr-osmosdr-legacy works with gnuradio-legacy only
73
74    depends_lib-append  port:gnuradio-legacy
75
76    livecheck.url       http://cgit.osmocom.org/gr-osmosdr/log/?h=gr3.6
77    livecheck.version   ${git.branch}
78    livecheck.regex     id=(\[a-f0-9\]+).*>gr3.6<
79
80}
81
82# do VPATH (out of source tree) build
83
84cmake.out_of_source yes
85
86# remove top-level library path, such that internal libraries are used
87# instead of any already-installed ones.
88
89configure.ldflags-delete -L${prefix}/lib
90
91# per user concensus: enable all variants except +debug and +universal
92
93default_variants +docs +uhd +swig +hackrf +fcdproplus +rtlsdr +bladeRF +airspy
94
95# set Python legacy variants; these can be removed 2016-01-01
96
97variant python26 description {Legacy variant} {}
98variant python27 description {Legacy variant} {}
99
100# specify the Python dependencies
101
102depends_lib-append \
103    port:python27
104
105# specify the Python version to use
106
107configure.args-append \
108    -DPYTHON_EXECUTABLE=${prefix}/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 \
109    -DPYTHON_INCLUDE_DIR=${prefix}/Library/Frameworks/Python.framework/Versions/2.7/Headers \
110    -DPYTHON_LIBRARY=${prefix}/Library/Frameworks/Python.framework/Versions/2.7/Python \
111    -DGR_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
112
113variant docs description "Install ${name} documentation" {
114
115    depends_build-append \
116        port:doxygen \
117        path:bin/dot:graphviz
118
119    configure.args-append \
120        -DDOXYGEN_DOT_EXECUTABLE=${prefix}/bin/dot \
121        -DDOXYGEN_EXECUTABLE=${prefix}/bin/doxygen
122
123}
124
125if {![variant_isset docs]} {
126
127    configure.args-append \
128        -DDOXYGEN_DOT_EXECUTABLE= \
129        -DDOXYGEN_EXECUTABLE=
130
131}
132
133variant uhd description "Install ${name} with support for UHD" {
134
135    # allow uhd or uhd-devel
136
137    depends_lib-append \
138        path:lib/libuhd.dylib:uhd
139
140    # require gnuradio to also have this variant
141
142    if {${subport} eq "gr-osmosdr-legacy"} {
143
144        require_active_variants port:gnuradio-legacy uhd
145
146    } else {
147
148        require_active_variants \
149            path:lib/libgnuradio-runtime.dylib:gnuradio uhd
150
151    }
152
153    configure.args-append \
154        -DENABLE_UHD=ON \
155        -DGNURADIO_UHD_INCLUDE_DIRS=${prefix}/include \
156        -DGNURADIO_UHD_LIBRARIES=${prefix}/lib/libgnuradio-uhd.dylib \
157        -DUHD_INCLUDE_DIRS=${prefix}/include/uhd \
158        -DUHD_LIBRARIES=${prefix}/lib/libuhd.dylib
159
160}
161
162if {![variant_isset uhd]} {
163
164    configure.args-append \
165        -DENABLE_UHD=OFF \
166        -DGNURADIO_UHD_INCLUDE_DIRS= \
167        -DGNURADIO_UHD_LIBRARIES= \
168        -DUHD_INCLUDE_DIRS= \
169        -DUHD_LIBRARIES=
170
171}
172
173variant swig description "Install ${name} with support for SWIG-base Python bindings" {
174
175    depends_lib-append \
176        port:swig-python
177
178    # require gnuradio to also have this variant
179
180    if {${subport} eq "gr-osmosdr-legacy"} {
181
182        require_active_variants port:gnuradio-legacy swig
183
184    } else {
185
186        require_active_variants \
187            path:lib/libgnuradio-runtime.dylib:gnuradio swig
188
189    }
190
191    configure.args-append \
192        -DSWIG_EXECUTABLE=${prefix}/bin/swig
193
194}
195
196if {![variant_isset swig]} {
197
198    configure.args-append \
199        -DSWIG_EXECUTABLE=
200
201}
202
203variant hackrf description "Install ${name} with support for hackrf" {
204
205    depends_lib-append port:hackrf
206    configure.args-append -DENABLE_HACKRF=ON
207
208}
209
210if {![variant_isset hackrf]} {
211
212    configure.args-append -DENABLE_HACKRF=OFF
213
214}
215
216# fcdproplus works with gnuradio 3.7+ API only; it does not provide a
217# 3.6 API legacy version
218
219if {${subport} eq ${name}} {
220
221    variant fcdproplus description "Install ${name} with support for FunCube Dongle Pro+ (fcdproplus)" {
222
223        depends_lib-append port:gr-fcdproplus
224        configure.args-append -DENABLE_FCDPP=ON
225
226    }
227
228    if {![variant_isset fcdproplus]} {
229
230        configure.args-append -DENABLE_FCDPP=OFF
231
232    }
233}
234
235variant rtlsdr description "Install ${name} with support for rtl-sdr" {
236
237    depends_lib-append port:rtl-sdr
238    configure.args-append -DENABLE_RTL=ON
239
240}
241
242if {![variant_isset rtlsdr]} {
243
244    configure.args-append -DENABLE_RTL=OFF
245
246}
247
248variant bladeRF description "Install ${name} with support for bladeRF" {
249
250    depends_lib-append port:bladeRF
251    configure.args-append -DENABLE_BLADERF=ON
252
253}
254
255if {![variant_isset bladeRF]} {
256
257    configure.args-append -DENABLE_BLADERF=OFF
258
259}
260
261variant airspy description "Install ${name} with support for airspy" {
262
263    depends_lib-append port:airspy
264    configure.args-append -DENABLE_AIRSPY=ON
265
266}
267
268if {![variant_isset airspy]} {
269
270    configure.args-append -DENABLE_AIRSPY=OFF
271
272}
Note: See TracBrowser for help on using the repository browser.