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

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

volk:
+ update to 83b09941 (20150504);
+ remove now-unnecessary patch, instead blacklisting GCC < 4.3 since they do not provide <cpuid.h>, which is now a required header when compiling using GCC.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.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 135847 2015-05-05 15:06:12Z michaelld@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6PortGroup           github 1.0
7PortGroup           muniversal 1.0
8PortGroup           compiler_blacklist_versions 1.0
9
10github.setup        gnuradio volk 83b0994162f512a40fd34dd435e68837b0e224fa
11version             20150504
12checksums           rmd160 be648b9f5f213dc6b4d6d573b9ab429ea1be0a62 \
13                    sha256 476d88d3ef7a8db7686945c118909a9af0056ae323fa01259df4bcbd84f304cb
14
15# gnuradio legacy still provides volk
16
17conflicts           gnuradio-legacy
18
19categories          science comms
20maintainers         michaelld openmaintainer
21description         Vector-Optimized Library of Kernels
22long_description    ${description}
23license             GPL-3
24platforms           darwin
25
26# override githib PortGroup homepage setting
27
28homepage            http://libvolk.org/
29
30depends_build-append port:pkgconfig
31depends_lib-append   port:boost
32
33# blacklist GCC < 4.3, since it does not provide <cpuid.h>, which is a
34# required header when compiling using GCC as of 4c967ef1 (2015-05-04).
35
36compiler.blacklist-append {*gcc-3*} {*gcc-4.[0-2]}
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        # GCC 3* and 4.[0-2] are already blacklisted above.
129
130        compiler.blacklist-append *clang* {*gcc-4.[3-6]}
131
132        # and whitelist those we do want to use. wish there were a better way.
133        # these will be used in the order provided.
134
135        compiler.whitelist macports-gcc-4.9 macports-gcc-4.8 macports-gcc-4.7
136
137    } else {
138
139        # using libc++;
140        # Blacklist Clang not supporting C++11 in some form and all GCC.
141
142        compiler.blacklist-append *gcc* {clang < 500}
143
144    }
145}
146
147pre-extract {
148
149    # tell the user to force deactivate gnuradio-(devel,next) if one
150    # is active and version is before Volk was split off (20150329 for
151    # devel and next). gnuradio 3.7.6.2+ provides this split, too (as
152    # of 2015-04-12).
153
154    set not_found [catch {set installed [lindex [registry_active gnuradio-devel] 0]}]
155    if {${not_found}} {
156        set not_found [catch {set installed [lindex [registry_active gnuradio-next] 0]}]
157    }
158    if {${not_found}} {
159        set not_found [catch {set installed [lindex [registry_active gnuradio] 0]}]
160    }
161    if (!${not_found}) {
162
163        set _portname [lindex ${installed} 0]
164        set _version [lindex ${installed} 1]
165
166        if {${_portname} eq "gnuradio"} {
167            set _vcmp [vercmp ${_version} 3.7.6.2]
168        } else {
169            set _vcmp [vercmp ${_version} 20150329]
170        }
171
172        if {${_vcmp} < 0} {
173
174            ui_msg "\nVolk is currently installed by the port '${_portname}'."
175            ui_msg "Use the command"
176            ui_msg "  sudo port -f deactivate ${_portname}"
177            ui_msg "to deactivate the port owning volk, then proceed with"
178            ui_msg "  sudo port upgrade ${_portname}\n"
179            return -code error "Port Needs Deactivation"
180
181        }
182    }
183}
Note: See TracBrowser for help on using the repository browser.