source: trunk/dports/science/volk/Portfile @ 135413

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

volk: the gnuradio release port now uses port:volk, so check for the older release version in pre-extract (along with the pre-split gnuradio-devel and gnuradio-next).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.2 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 135413 2015-04-23 15:54:50Z michaelld@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6PortGroup           github 1.0
7PortGroup           muniversal 1.0
8
9github.setup        gnuradio volk 528caa1ec03281a3013e1655c8e2546b71bda8d5
10version             20150407
11checksums           rmd160 6c212e914e35e1b198be27ecae341838ae766a0f \
12                    sha256 fad182bf5cddfd0d8be7db9d440e1a49f736a8d36d56cc9d513a9dc4d7e05714
13
14# gnuradio legacy still provides volk
15
16conflicts           gnuradio-legacy
17
18categories          science comms
19maintainers         michaelld openmaintainer
20description         Vector-Optimized Library of Kernels
21long_description    ${description}
22license             GPL-3
23platforms           darwin
24
25# override githib PortGroup homepage setting
26
27homepage            http://libvolk.org/
28
29depends_build-append port:pkgconfig
30depends_lib-append   port:boost
31
32# temporary patch to add lib/gcc_x86_cpuid.h back to the repo, since
33# it is needed by some older GCC compilers. It does not hurt newer
34# ones that provide cpuid.h.
35
36patchfiles-append   patch-lib_gcc_x86_cpuid.h.diff
37
38# do VPATH (out of source tree) build
39
40cmake.out_of_source yes
41
42# remove top-level library path, such that internal libraries are used
43# instead of any already-installed ones.
44
45configure.ldflags-delete -L${prefix}/lib
46
47# specify the Python dependencies; these are checked for at configure,
48# then used for building, but not at runtime.
49
50depends_build-append \
51    port:python27 \
52    port:py27-cheetah
53
54# override default version string to be MacPorts-specific
55# git / "devel" only for now
56
57set VOLK_VERSION_INFO "git-[string range ${github.version} 0 7](${version})"
58
59configure.args-append \
60    -DVOLK_GIT_COUNT="MacPorts" \
61    -DVOLK_GIT_HASH="${VOLK_VERSION_INFO}"
62
63# install CMake files into this directory
64
65configure.args-append \
66    -DCMAKE_MODULES_DIR=${prefix}/share/cmake
67
68# specify the Python version to use
69
70configure.args-append \
71    -DPYTHON_EXECUTABLE=${prefix}/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 \
72    -DVOLK_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
73
74default_variants +docs +orc
75
76variant docs description "Install Volk documentation" {
77
78    depends_build-append \
79        port:doxygen
80
81    configure.args-append \
82        -DDOXYGEN_EXECUTABLE=${prefix}/bin/doxygen
83}
84
85if {![variant_isset docs]} {
86
87    configure.args-append \
88        -DDOXYGEN_EXECUTABLE=
89
90}
91
92variant orc description "Install Volk with support for ORC" {
93
94    depends_lib-append \
95        port:orc
96
97    configure.args-append \
98        -DORCC_EXECUTABLE=${prefix}/bin/orcc \
99        -DORC_INCLUDE_DIR=${prefix}/include/orc-0.4 \
100        -DORC_LIBRARY_DIR=${prefix}/lib
101
102}
103
104if {![variant_isset orc]} {
105
106    configure.args-append \
107        -DORCC_EXECUTABLE= \
108        -DORC_INCLUDE_DIR= \
109        -DORC_LIBRARY_DIR=
110
111}
112
113variant cxx11 description "Compile Volk using C++11 compliance" {
114
115    # require C++11
116
117    configure.cxxflags-append -std=c++11
118
119    if {${configure.cxx_stdlib} eq "libstdc++"} {
120
121        # *clang* when using libstdc++ do not seem to support C++11;
122        # C++11 support seems to need GCC 4.7+ when using libstdc++;
123        # could use C++0x support on GCC4.[56], but just ignore it since
124        # there are newer compilers already in place as defaults.
125
126        # Blacklist GCC compilers not supporting C++11 and all CLANG.
127        # This is probably not necessary, but it's good practice.
128
129        compiler.blacklist-append *clang* {*gcc-3*} {*gcc-4.[0-6]}
130
131        # and whitelist those we do want to use. wish there were a better way.
132        # these will be used in the order provided.
133
134        compiler.whitelist macports-gcc-4.9 macports-gcc-4.8 macports-gcc-4.7
135
136    } else {
137
138        # using libc++;
139        # Blacklist Clang not supporting C++11 in some form and all GCC.
140
141        compiler.blacklist-append *gcc* {clang < 500}
142
143    }
144}
145
146pre-extract {
147
148    # tell the user to force deactivate gnuradio-(devel,next) if one
149    # is active and version is before Volk was split off (20150329 for
150    # devel and next). gnuradio 3.7.6.2+ provides this split, too (as
151    # of 2015-04-12).
152
153    set not_found [catch {set installed [lindex [registry_active gnuradio-devel] 0]}]
154    if {${not_found}} {
155        set not_found [catch {set installed [lindex [registry_active gnuradio-next] 0]}]
156    }
157    if {${not_found}} {
158        set not_found [catch {set installed [lindex [registry_active gnuradio] 0]}]
159    }
160    if (!${not_found}) {
161
162        set _portname [lindex ${installed} 0]
163        set _version [lindex ${installed} 1]
164
165        if {${_portname} eq "gnuradio"} {
166            set _vcmp [vercmp ${_version} 3.7.6.2]
167        } else {
168            set _vcmp [vercmp ${_version} 20150329]
169        }
170
171        if {${_vcmp} < 0} {
172
173            ui_msg "\nVolk is currently installed by the port '${_portname}'."
174            ui_msg "Use the command"
175            ui_msg "  sudo port -f deactivate ${_portname}"
176            ui_msg "to deactivate the port owning volk, then proceed with"
177            ui_msg "  sudo port upgrade ${_portname}\n"
178            return -code error "Port Needs Deactivation"
179
180        }
181    }
182}
Note: See TracBrowser for help on using the repository browser.