# -*- 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

name                gunits
version             2.24
revision            1
checksums           rmd160  1ca0be0968d71450cd5c28dd2c229f0a56520861 \
                    sha256  1e502c4edfacf20b29284716c72e5ddb51a495a2365d7b03e7960494c4a0c902 \
                    size    1493600

categories          math
license             GPL-3+
maintainers         nomaintainer

description         Unit conversion and calculation

long_description    GNU units converts quantities expressed in various \
                    scales to their equivalents in other scales.

homepage            https://www.gnu.org/software/units/
master_sites        gnu:units
distname            units-${version}

set python_version  3.13
set python_ver_no_dot [string map {. {}} ${python_version}]

depends_lib         port:py${python_ver_no_dot}-requests \
                    port:python${python_ver_no_dot} \
                    port:readline

configure.args      ac_cv_path_PYTHON=${prefix}/bin/python${python_version} \
                    --program-prefix=g \
                    --sharedstatedir=${prefix}/var/lib

compiler.c_standard 2011

# C11 floating point macros, like DBL_DECIMAL_DIG,
# were not present until (LLVM) clang 3.9
# see llvm/llvm-project issue 26657
compiler.blacklist-append   {clang < 802}

post-destroot {
    # gunits_cur wants to be able to update these files.
    file attributes ${destroot}${prefix}/var/lib/units/cpi.units      -permissions a+w
    file attributes ${destroot}${prefix}/var/lib/units/currency.units -permissions a+w
}
