source: trunk/dports/science/uhd/Portfile

Last change on this file was 154356, checked in by michaelld@…, 13 months ago

uhd-devel: update to 945fd653 (20161027).

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