# -*- 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 PortSystem 1.0 PortGroup cmake 1.1 PortGroup github 1.0 PortGroup muniversal 1.0 PortGroup compiler_blacklist_versions 1.0 PortGroup boost 1.0 # Volk requires C/C++11 as of release 2.0.0 compiler.c_standard 2011 compiler.cxx_standard 2011 # some older Clang say they support SIMD when they don't compiler.blacklist-append {clang < 900} name volk categories science comms maintainers {michaelld @michaelld} description Vector-Optimized Library of Kernels long_description VOLK is the Vector-Optimized Library of Kernels, a library that contains kernels of hand-written single-instruction multiple data (SIMD) code for different mathematical operations, providing portable SIMD code that is optimized for a variety of platforms. long_description {*}${long_description} ${subport} \ provides the release version, which is typically updated every month or so. license GPL-3 platforms darwin homepage https://libvolk.org/ github.setup gnuradio volk 2.5.0 v revision 0 epoch 2 # 1: bump the epoch because I moved the version from 20150707 to 1.0.1 # # 2: because 2.5.1 requires std::filesystem, which requires updated libc++, # which is not easily doable on 10.[7-14]; see also # https://trac.macports.org/ticket/65377 and # https://github.com/macports/macports-ports/pull/15205 # # Volk requires the submodule "cpu_features" as found here: < # https://github.com/google/cpu_features >. Because we're not # cloning into a GIT module in the first place, we can't use the # git submodule feature, and instead have to download separately # and install into the correct location to get this port to work! # Which means we need a cpu_features branch and so forth # ... basically replicate what the github PG does but without # using it since it is not designed to be used for multiple # downloads. set cpu_features_github_author google set cpu_features_github_project cpu_features set cpu_features_github_branch a8397ba4591237c17d18e4acc091f5f3ebe7391e set main_distname ${distname} set main_distfile ${distfiles} set cpu_features_distname ${cpu_features_github_project}-${cpu_features_github_branch} set cpu_features_distfile ${cpu_features_distname}${extract.suffix} distfiles ${main_distfile}:tagone \ ${cpu_features_distfile}:tagtwo master_sites ${github.homepage}/archive/${git.branch}:tagone \ https://github.com/${cpu_features_github_author}/${cpu_features_github_project}/archive/${cpu_features_github_branch}:tagtwo checksums ${main_distfile} \ rmd160 e109ad2361dfa2ab8908aff644b067fcd832028d \ sha256 468bebdb8c2ae9b82837ad08abd146dd9a9a48d3de7bea2d0095e4b1557b5299 \ size 357828 \ ${cpu_features_distfile} \ rmd160 7221e014514170ed24a1d0294b8195cecd9b7465 \ sha256 b47031a2a9ab04cb6514285103e51ba92c8f0bf28470cce911ac0c9af781c307 \ size 63263 post-extract { # put the cpu_features_github_project directory into position # remove the original directory ui_debug "delete ${worksrcpath}/cpu_features" delete ${worksrcpath}/cpu_features ui_debug "move ${workpath}/${cpu_features_distname} ${worksrcpath}/cpu_features" move ${workpath}/${cpu_features_distname} ${worksrcpath}/cpu_features } # fix cpu_features to work with ARM64 patchfiles-append patch-cpu_features-add-support-for-ARM64.diff # done with special git command replication depends_build-append port:pkgconfig # Volk doesn't understand build type "MacPorts"; use release unless +debug is set if {[variant_isset debug]} { cmake.build_type Debug } else { cmake.build_type Release } configure.checks.implicit_function_declaration.whitelist-append vst1_u8 # remove use of CPATH, as it is not needed compiler.cpath # remove top-level library path, such that internal libraries are used # instead of any already-installed ones. configure.ldflags-delete -L${prefix}/lib # remove top-level include path, such that internal headers are used # instead of any already-installed ones. configure.cppflags-delete -I${prefix}/include # specify the Python dependencies; these are checked for at configure, # then used for building, but not at runtime. set pythons_suffixes {35 36 37 38 39 310} set pythons_ports {} foreach s ${pythons_suffixes} { lappend pythons_ports python${s} } proc python_dir {} { global pythons_suffixes foreach s ${pythons_suffixes} { if {[variant_isset python${s}]} { set p python[string index ${s} 0].[string range ${s} 1 end] return [file normalize [exec ${p} -c "import sys; print(sys.prefix)"]/lib/${p}/site-packages] } } error "Python support not enabled." } foreach s ${pythons_suffixes} { set p python${s} set v [string index ${s} 0].[string range ${s} 1 end] set i [lsearch -exact ${pythons_ports} ${p}] set c [lreplace ${pythons_ports} ${i} ${i}] variant ${p} description "Build Volk using Python ${v}" conflicts {*}${c} " # required Python depends_lib-append \ port:${p} depends_build-append \ port:py${s}-six \ port:py${s}-mako # specify the Python version to use configure.args-append \ -DPYTHON_EXECUTABLE=${frameworks_dir}/Python.framework/Versions/${v}/bin/python${v} \ -DVOLK_PYTHON_DIR=${frameworks_dir}/Python.framework/Versions/${v}/lib/python${v}/site-packages " } if {![variant_isset debug]} { set selected_python python310 foreach s ${pythons_suffixes} { if {[variant_isset python${s}]} { set selected_python python${s} } } default_variants +${selected_python} } # override default version string to be MacPorts-specific # git / "devel" only for now set VOLK_VERSION_INFO "git-[string range ${github.version} 0 7](${version})" configure.args-append \ -DVOLK_GIT_COUNT="MacPorts" \ -DVOLK_GIT_HASH="${VOLK_VERSION_INFO}" # install CMake files into this directory configure.args-append \ -DCMAKE_MODULES_DIR=${prefix}/share/cmake default_variants +docs +orc variant docs description "Install Volk documentation" { depends_build-append \ path:bin/doxygen:doxygen configure.args-append \ -DDOXYGEN_EXECUTABLE=${prefix}/bin/doxygen } if {![variant_isset docs]} { configure.args-append \ -DDOXYGEN_EXECUTABLE= } variant orc description "Install Volk with support for ORC" { depends_lib-append \ port:orc configure.args-append \ -DORCC_EXECUTABLE=${prefix}/bin/orcc \ -DORC_INCLUDE_DIR=${prefix}/include/orc-0.4 \ -DORC_LIBRARY_DIR=${prefix}/lib } if {![variant_isset orc]} { configure.args-append \ -DORCC_EXECUTABLE= \ -DORC_INCLUDE_DIR= \ -DORC_LIBRARY_DIR= }