source: trunk/dports/science/gr-fcdproplus/Portfile @ 117736

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

gnuradio dependents: Rev-bump for new 3.7.3 release libraries.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 117736 2014-03-10 13:23:45Z michaelld@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6PortGroup           github 1.0
7PortGroup           active_variants 1.1
8
9github.setup        dl1ksv gr-fcdproplus 457ab712f331fc086952036bd889d58a99b2c9ae
10
11categories          science comms
12maintainers         michaelld openmaintainer
13description         Implements a funcube dongle pro+ source in GNU Radio.
14long_description    ${description}
15license             GPL-3
16platforms           darwin
17
18version             20140121
19revision            1
20checksums           rmd160 b5b05bf8ec9b3f86a078a98a014c37807148f879 \
21                    sha256 ff8a5d622ca294689725e7286424c4e4399adc5c929da4bf3e8396d3f86ffabf
22
23depends_build-append port:pkgconfig
24depends_lib-append      port:boost \
25                    port:doxygen \
26                    port:libusb \
27                    port:swig
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-legacy or gnuradio-next
34
35pre-fetch {
36    if {![catch {set installed [lindex [registry_active gnuradio-legacy] 0]}]} {
37        # gnuradio-legacy is installed; this version of gr-osmosdr does not work with gnuradio-legacy
38        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"
39        return -code error "Invalid port dependency: gnuradio-legacy"
40    }
41    if {![catch {set installed [lindex [registry_active gnuradio-next] 0]}]} {
42        # gnuradio-next is installed; this version of gr-osmosdr does not work with gnuradio-next
43        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"
44        return -code error "Invalid port dependency: gnuradio-next"
45    }
46}
47
48# do VPATH build
49
50post-extract        { file mkdir ${workpath}/build }
51configure.dir       ${workpath}/build
52build.dir           ${workpath}/build
53
54# remove top-level include path, such that internal headers are used
55# instead of any already-installed ones.
56
57configure.cppflags-delete -I${prefix}/include
58
59# remove top-level library path, such that internal libraries are used
60# instead of any already-installed ones.
61
62configure.ldflags-delete -L${prefix}/lib
63
64# set last configure argument to the reletive path
65# to the top-level cmake source
66
67configure.post_args ../${worksrcdir}
68
69# be verbose when building, for debugging purposes
70
71build.post_args VERBOSE=1
72
73# set Python variants
74
75set pythons_suffixes {26 27}
76global chosen_python_suffix
77set chosen_python_suffix ""
78
79set pythons_ports {}
80foreach s ${pythons_suffixes} {
81    lappend pythons_ports python${s}
82}
83
84foreach s ${pythons_suffixes} {
85    set p python${s}
86    set v [join [split ${s} ""] "."]
87    set i [lsearch -exact ${pythons_ports} ${p}]
88    set c [lreplace ${pythons_ports} ${i} ${i}]
89    eval [subst {
90        variant ${p} description "Build UHD for Python ${v}" \
91            conflicts ${c} {
92
93            set chosen_python_suffix ${s}
94
95            # require gnuradio to also have this Python variant
96
97            require_active_variants \
98                path:lib/libgnuradio-runtime.dylib:gnuradio ${p}
99
100            depends_lib-append \
101                port:${p}
102
103            # specify that Python version to use
104            configure.args-append \
105                -DPYTHON_EXECUTABLE=${prefix}/bin/python${v} \
106                -DPYTHON_INCLUDE_DIR=${prefix}/Library/Frameworks/Python.framework/Versions/${v}/Headers \
107                -DPYTHON_LIBRARY=${prefix}/Library/Frameworks/Python.framework/Versions/${v}/Python \
108                -DGR_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/${v}/lib/python${v}/site-packages
109        }
110    }]
111}
112
113# if no python variant is set, default to 2.7
114if {![variant_isset python26] &&
115    ![variant_isset python27]} {
116    default_variants +python27
117}
118
119# make sure -python27 was not used alone
120if {![variant_isset python26] &&
121    ![variant_isset python27]} {
122    return -code error "Exactly one Python variant must be selected."
123}
Note: See TracBrowser for help on using the repository browser.