# -*- 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 github 1.0 PortGroup legacysupport 1.0 # clock_gettime legacysupport.newest_darwin_requires_legacy 15 name hamlib categories science license LGPL GPL maintainers {ra1nb0w @ra1nb0w} openmaintainer description Ham Radio Control Libraries long_description Flexible and portable shared libraries that offer a \ standardized API to control any radio oriented equipment \ through a computer interface. homepage https://hamlib.github.io subport hamlib-devel {} if {[string first "-devel" $subport] > 0} { github.setup Hamlib Hamlib d06244c47f4dffdf9f47172385c8dfac738c24e2 version 20230305-[string range ${github.version} 0 7] checksums rmd160 a89e2e1bc1d3b4ee2cc95db7ea4e514020a38d55 \ sha256 c9af3aee0728341954bb19f51a8a89cdb56f238994e9bb5473e8ae20a1c41230 \ size 2163459 revision 0 github.tarball_from archive name hamlib-devel long_description ${long_description} This port is kept up with the Hamlib \ GIT 'master' branch, is typically updated weekly to monthly. conflicts hamlib use_autoconf yes autoconf.cmd ./bootstrap # need for autoconf depends_build-append \ port:autoconf \ port:automake \ port:libtool } else { github.setup Hamlib Hamlib 4.5.5 github.tarball_from releases checksums rmd160 c69dd7fdaa720dcd5ac30dd3f66e6d0cdd7e681b \ sha256 601c89f32ed225e9527ade3d64d0d05d23202c05ae21ffa77e59d70ee4597fcd \ size 2603846 revision 0 distname hamlib-${version} conflicts hamlib-devel } depends_build-append \ port:pkgconfig depends_lib-append \ port:libtool \ port:libusb-compat \ port:libxml2 compiler.cxx_standard 2011 set python_versions { 2.7 3.6 3.7 3.8 3.9 3.10 } # python binding is not enabled by default set default_python_variant "" # Define the available variants foreach py_ver ${python_versions} { set py_ver_no_dot [join [split ${py_ver} "."] ""] set variant_line {variant python${py_ver_no_dot} description "Build with python ${py_ver} support"} foreach py_over ${python_versions} { if { ${py_ver} == ${py_over} } { continue } set py_over_no_dot [join [split ${py_over} "."] ""] append variant_line " conflicts python${py_over_no_dot}" } append variant_line { { } } eval $variant_line if {[variant_isset python${py_ver_no_dot}]} { if {${default_python_variant} != "+python${py_ver_no_dot}"} { set default_python_variant "" } } } # set default python variant if not selected if {${default_python_variant} != ""} { default_variants-append "${default_python_variant}" } # If a python variant is enabled, activate it set active_python_version "" set active_python_version_no_dot "" foreach py_ver ${python_versions} { set py_ver_no_dot [join [split ${py_ver} "."] ""] if {[variant_isset python${py_ver_no_dot}]} { set active_python_version ${py_ver} set active_python_version_no_dot ${py_ver_no_dot} depends_build-append \ port:swig-python depends_lib-append \ port:python${active_python_version_no_dot} configure.args-append \ --with-python-binding # fixup configure for the correct python3.X-config post-patch { reinplace "s@python3-config@python${active_python_version}-config@g" \ ${worksrcpath}/configure } # specify the Python version to use set python_framework_dir ${frameworks_dir}/Python.framework/Versions/${active_python_version} configure.args-append \ PYTHON=${python_framework_dir}/bin/python${active_python_version} \ PYTHON_EXECUTABLE=${python_framework_dir}/bin/python${active_python_version} \ PYTHON_INCLUDE_DIR=${python_framework_dir}/Headers \ PYTHON_LIBRARY=${python_framework_dir}/Python \ PYTHON_VERSION=${py_ver} # install the binding in the right directory set python_site_dir ${python_framework_dir}/lib/python${active_python_version}/site-packages destroot.args-append \ pythondir=${python_site_dir} \ pyexecdir=${python_site_dir} \ pkgpythondir=${python_site_dir}/${name} \ pkgpyexecdir=${python_site_dir}/${name} } }