# -*- 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 # $Id$ PortSystem 1.0 PortGroup cmake 1.0 PortGroup github 1.0 PortGroup muniversal 1.0 name uhd categories science comms maintainers michaelld description USRP Hardware Driver for Ettus Research Products license GPL-3+ platforms darwin # common directory for storing downloaded tarballs dist_subdir uhd if {${subport} eq ${name}} { long_description ${description}: \ Provides the release version, which is typically updated every month or so. set base_version "3.10.0.0" set spaced_base_version [join [split ${base_version} "."] " "] set expended_base_version [eval "format %03i_%03i_%03i_%03i ${spaced_base_version}"] github.setup EttusResearch uhd ${expended_base_version} release_ version ${base_version} conflicts uhd-devel checksums rmd160 dbe730a178e2b927de5a7bdd7948f961112add95 \ sha256 40cab577fade0d0cef7ff97beeb14538a46ef21efb205333cd1ac643ad90a16a # set the version override string set UHD_VERSION_INFO "Release" # overload the github livecheck regex to look for versions that # are just numbers and '_', no letters (e.g., "3.7.3_rc2"). livecheck.regex archive/[join ${github.tag_prefix} ""](\[0-9_\]+)${extract.suffix} } subport uhd-devel { long_description ${description}: \ Provides the UHD GIT maint or master branch, depending on which is more advanced, and is typically updated every few days to week. name uhd-devel conflicts uhd github.setup EttusResearch uhd 945fd65309bf8d557ac6759f2d61e0822456a8ac version 20161027 checksums rmd160 f6f171d89d205b12190e433ec9fff6e0851b0204 \ sha256 b110c13f4d751be1eac2cda2b02cf9b2f93eeb67f1ba2f365dbbb642e406a05f # overload the github livecheck URL with the maint branch, # when it is more advanced; comment out for master. livecheck.url ${github.homepage}/commits/maint.atom # set the version override string set UHD_VERSION_INFO "git-[string range ${github.version} 0 7](${version})" } # override the github Portgroup's homepage setting homepage http://uhd.ettus.com/ depends_lib-append port:boost port:ncurses depends_build-append port:pkgconfig # do VPATH (out of source tree) build cmake.out_of_source yes # remove top-level library path, such that internal libraries are used # instead of any already-installed ones. configure.ldflags-delete -L${prefix}/lib # set last configure argument to the relative path # to the top-level cmake source configure.post_args ../${worksrcdir}/host # explicitly set CMake flags to get MacPorts' curses; # these are used by some variants, and won't hurt the others. configure.args-append \ -DCURSES_CURSES_LIBRARY=${prefix}/lib/libcurses.dylib \ -DCURSES_FORM_LIBRARY=${prefix}/lib/libform.dylib \ -DCURSES_INCLUDE_PATH=${prefix}/include \ -DCURSES_LIBRARY=${prefix}/lib/libcurses.dylib \ -DCURSES_NCURSES_LIBRARY=${prefix}/lib/libncurses.dylib # override default version string to be MacPorts-specific configure.args-append \ -DUHD_GIT_COUNT="MacPorts" \ -DUHD_GIT_HASH="${UHD_VERSION_INFO}" # directory to install shared UHD files # (examples, images, modules, tests, utilities) configure.args-append \ -DPKG_LIB_DIR=${prefix}/share/uhd # directory to install all CMake files; internal appends "uhd" configure.args-append \ -DCMAKE_MODULES_DIR=${prefix}/share/cmake # per user concensus: enable all variants except +debug and +universal default_variants +docs +examples +libusb +manual +test +manpages # select Python to use; default to 2.7 variant python27 conflicts python34 description {Build using Python 2.7} {} variant python34 conflicts python27 description {Build using Python 3.4} {} if {![variant_isset python27] && ![variant_isset python34]} { default_variants +python27 } if {![variant_isset python27] && ![variant_isset python34]} { ui_error "\n\nYou must select either the +python27 or +python34 variant.\n" return -code error "Invalid variant selection" } set PythonVersionNoDot "" if {[variant_isset python27]} { set PythonVersionNoDot "27" } else { set PythonVersionNoDot "34" } set PythonVersionWithDot [join [split ${PythonVersionNoDot} ""] "."] # required Python depends_lib-append \ port:python${PythonVersionNoDot} \ port:py${PythonVersionNoDot}-requests \ port:py${PythonVersionNoDot}-mako # specify the Python version to use set PythonExe "${prefix}/bin/python${PythonVersionWithDot}" configure.args-append \ -DPYTHON_EXECUTABLE=${PythonExe} # after destroot, have uhd fetch its images into the # destroot area, so that they are also tracked by MacPorts post-destroot { ui_debug "Fetching images:" ui_debug "${PythonExe} ${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --install-location=${destroot}${prefix}/share/uhd/images" system "${PythonExe} ${destroot}${prefix}/share/uhd/utils/uhd_images_downloader.py --verbose --install-location=${destroot}${prefix}/share/uhd/images" } variant test description {enable tests} { configure.args-append -DENABLE_TESTS=ON test.run yes } if {![variant_isset test]} { configure.args-append -DENABLE_TESTS=OFF } variant examples description {enable examples} { configure.args-append -DENABLE_EXAMPLES=ON } if {![variant_isset examples]} { configure.args-append -DENABLE_EXAMPLES=OFF } variant libusb description {enable USB support via libusb version 1.0} { depends_lib-append path:lib/libusb-1.0.dylib:libusb configure.args-append \ -DENABLE_USB=ON \ -DLIBUSB_INCLUDE_DIRS=${prefix}/include/libusb-1.0 } if {![variant_isset libusb]} { configure.args-append -DENABLE_USB=OFF } else { # if using +libusb, enable E300 too configure.args-append -DENABLE_E300=ON } variant docs description {build documentation} { depends_lib-append port:doxygen configure.args-append -DENABLE_DOXYGEN=ON } if {![variant_isset docs]} { configure.args-append -DENABLE_DOXYGEN=OFF } variant manual description {build manual} { depends_lib-append port:py${PythonVersionNoDot}-docutils configure.args-append -DENABLE_MANUAL=ON } if {![variant_isset manual]} { configure.args-append -DENABLE_MANUAL=OFF } variant manpages description {build man pages} { depends_run-append port:gzip configure.args-append -DENABLE_MAN_PAGES=ON } if {![variant_isset manpages]} { configure.args-append -DENABLE_MAN_PAGES=OFF }