source: trunk/dports/science/uhd/Portfile @ 145762

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

uhd-devel: update to 1fd73de7 (20160215).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.5 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 145762 2016-02-16 15:56:20Z michaelld@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake 1.0
6PortGroup           github 1.0
7PortGroup           muniversal 1.0
8
9name                uhd
10categories          science comms
11maintainers         michaelld
12description         USRP Hardware Driver for Ettus Research Products
13license             GPL-3+
14platforms           darwin
15
16# common directory for storing downloaded tarballs
17
18dist_subdir         uhd
19
20if {${subport} eq ${name}} {
21
22    long_description ${description}: \
23Provides the release version, which is typically updated every month or so.
24
25    set base_version 3.9.2
26    github.setup    EttusResearch uhd 00[join [split ${base_version} "."] "_00"] release_
27    version         ${base_version}
28    conflicts       uhd-devel
29    checksums       rmd160 836b8f311ec52ecbbdb28a112f413ff8caa45d6d \
30                    sha256 0c3812c09236f8e5a7b9c2e71d2a2c242888557faeb9fe3e92574ad295faa783
31
32    # set the version override string
33
34    set UHD_VERSION_INFO "Release"
35
36    # overload the github livecheck regex to look for versions that
37    # are just numbers and '_', no letters (e.g., "3.7.3_rc2").
38
39    livecheck.regex archive/[join ${github.tag_prefix} ""](\[0-9_\]+)${extract.suffix}
40
41}
42
43subport uhd-devel {
44
45    long_description ${description}: \
46Provides the UHD GIT maint or master branch, depending on which is more advanced, and is typically updated every few days to week.
47
48    name            uhd-devel
49    conflicts       uhd
50    github.setup    EttusResearch uhd 1fd73de7d40459f231c969f27ef63dc62f2b5e82
51    version         20160215
52    checksums       rmd160 b363e76b5cc94fc750a055d6dbdbc6623b8040b4 \
53                    sha256 36e26f10e441ed17e9c484086b6c3fd723226139d65e792a70aab5bd2da855c6
54
55    # overload the github livecheck URL with the maint branch,
56    # when it is more advanced; comment out for master.
57
58    # livecheck.url   ${github.homepage}/commits/maint.atom
59
60    # set the version override string
61
62    set UHD_VERSION_INFO "git-[string range ${github.version} 0 7](${version})"
63
64}
65
66# override the github Portgroup's homepage setting
67
68homepage             http://uhd.ettus.com/
69
70depends_lib-append   port:boost port:ncurses
71
72depends_build-append port:pkgconfig
73
74# do VPATH (out of source tree) build
75
76cmake.out_of_source yes
77
78# remove top-level library path, such that internal libraries are used
79# instead of any already-installed ones.
80
81configure.ldflags-delete -L${prefix}/lib
82
83# set last configure argument to the relative path
84# to the top-level cmake source
85
86configure.post_args ../${worksrcdir}/host
87
88# explicitly set CMake flags to get MacPorts' curses;
89# these are used by some variants, and won't hurt the others.
90
91configure.args-append \
92    -DCURSES_CURSES_LIBRARY=${prefix}/lib/libcurses.dylib \
93    -DCURSES_FORM_LIBRARY=${prefix}/lib/libform.dylib \
94    -DCURSES_INCLUDE_PATH=${prefix}/include \
95    -DCURSES_LIBRARY=${prefix}/lib/libcurses.dylib \
96    -DCURSES_NCURSES_LIBRARY=${prefix}/lib/libncurses.dylib
97
98# override default version string to be MacPorts-specific
99
100configure.args-append \
101    -DUHD_GIT_COUNT="MacPorts" \
102    -DUHD_GIT_HASH="${UHD_VERSION_INFO}"
103
104# directory to install shared UHD files
105# (examples, images, modules, tests, utilities)
106
107configure.args-append \
108    -DPKG_LIB_DIR=${prefix}/share/uhd
109
110# directory to install all CMake files; internal appends "uhd"
111
112configure.args-append \
113    -DCMAKE_MODULES_DIR=${prefix}/share/cmake
114
115# per user concensus: enable all variants except +debug and +universal
116
117default_variants +docs +examples +libusb +manual +test +manpages
118
119# select Python to use; default to 2.7
120
121variant python27 conflicts python34 description {Build using Python 2.7} {}
122variant python34 conflicts python27 description {Build using Python 3.4} {}
123
124if {![variant_isset python27] && ![variant_isset python34]} {
125    default_variants +python27
126}
127
128if {![variant_isset python27] && ![variant_isset python34]} {
129    ui_error "\n\nYou must select either the +python27 or +python34 variant.\n"
130    return -code error "Invalid variant selection"
131}
132
133set PythonVersionNoDot ""
134if {[variant_isset python27]} {
135    set PythonVersionNoDot "27"
136} else {
137    set PythonVersionNoDot "34"
138}
139set PythonVersionWithDot [join [split ${PythonVersionNoDot} ""] "."]
140
141# required Python
142
143depends_lib-append \
144    port:python${PythonVersionNoDot} \
145    port:py${PythonVersionNoDot}-requests \
146    port:py${PythonVersionNoDot}-mako
147
148# specify the Python version to use
149
150set PythonExe "${prefix}/bin/python${PythonVersionWithDot}"
151
152configure.args-append \
153    -DPYTHON_EXECUTABLE=${PythonExe}
154
155# after destroot, have uhd fetch its images into the
156# destroot area, so that they are also tracked by MacPorts
157
158post-destroot {
159
160    ui_debug "Fetching images:"
161    ui_debug "${PythonExe} ${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --install-location=${destroot}${prefix}/share/uhd/images"
162    system "${PythonExe} ${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --verbose --install-location=${destroot}${prefix}/share/uhd/images"
163
164}
165
166variant test description {enable tests} {
167    configure.args-append -DENABLE_TESTS=ON
168    test.run yes
169}
170
171if {![variant_isset test]} {
172    configure.args-append -DENABLE_TESTS=OFF
173}
174
175variant examples description {enable examples} {
176    configure.args-append -DENABLE_EXAMPLES=ON
177}
178
179if {![variant_isset examples]} {
180    configure.args-append -DENABLE_EXAMPLES=OFF
181}
182
183variant libusb description {enable USB support via libusb version 1.0} {
184    depends_lib-append path:lib/libusb-1.0.dylib:libusb
185    configure.args-append \
186        -DENABLE_USB=ON \
187        -DLIBUSB_INCLUDE_DIRS=${prefix}/include/libusb-1.0
188}
189
190if {![variant_isset libusb]} {
191    configure.args-append -DENABLE_USB=OFF
192} else {
193    # if using +libusb, enable E300 too
194    configure.args-append -DENABLE_E300=ON
195}
196
197variant docs description {build documentation} {
198    depends_lib-append port:doxygen
199    configure.args-append -DENABLE_DOXYGEN=ON
200}
201
202if {![variant_isset docs]} {
203    configure.args-append -DENABLE_DOXYGEN=OFF
204}
205
206variant manual description {build manual} {
207    depends_lib-append port:py${PythonVersionNoDot}-docutils
208    configure.args-append -DENABLE_MANUAL=ON
209}
210
211if {![variant_isset manual]} {
212    configure.args-append -DENABLE_MANUAL=OFF
213}
214
215variant manpages description {build man pages} {
216    depends_run-append port:gzip
217    configure.args-append -DENABLE_MAN_PAGES=ON
218}
219
220if {![variant_isset manpages]} {
221    configure.args-append -DENABLE_MAN_PAGES=OFF
222}
Note: See TracBrowser for help on using the repository browser.