# -*- 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           muniversal 1.0
PortGroup           legacysupport 1.1

# renameat
legacysupport.newest_darwin_requires_legacy 13

name                talloc
version             2.4.4
revision            1
conflicts           samba3
set major           [lindex [split ${version} .] 0]
categories          devel
license             LGPL-3+
maintainers         nomaintainer
description         Hierarchical memory allocation library
long_description    talloc is a hierarchical, reference counted memory pool \
                    system with destructors. It is the core memory allocator \
                    used in Samba.
homepage            https://talloc.samba.org
master_sites        https://www.samba.org/ftp/talloc/
checksums           rmd160  78a6e9802908457aaf0a2643cae4b356b7997609 \
                    sha256  55e47994018c13743485544e7206780ffbb3c8495e704a99636503e6e77abf59 \
                    size    684541

set py_ver          3.14
set py_ver_nodot    [string map {. {}} ${py_ver}]

depends_build-append    port:python${py_ver_nodot}

depends_test-append     port:libiconv

patchfiles          patch-samba-install.diff

# Missing required TLS support in pthread library
compiler.thread_local_storage   yes

configure.args-append   --disable-python \
                        --with-libiconv=${prefix}

configure.python        ${prefix}/bin/python${py_ver}

build.env-append        PYTHON=${configure.python}

test.run                yes
test.env                {*}${build.env}

destroot.env            {*}${build.env}
