# -*- 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.25
revision            0
checksums           rmd160  799f3fbe8906ca72621fe39db8c4375fdb420357 \
                    sha256  36edf43ac00b4d6304baea91387e65ab05118bf65c921f73d3b08828e5a6ec0b \
                    size    1735230

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.14
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

patchfiles          patch-units_cur-deprecated.diff patch-units_cur-http-404.diff

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
}
