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

name                talloc
version             2.4.2
revision            0
checksums           rmd160  08af86413968127118174fae8444cb31aff05f44 \
                    sha256  85ecf9e465e20f98f9950a52e9a411e14320bc555fa257d87697b7e7a9b1d8a6 \
                    size    679750

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/

depends_build-append    port:python312

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

patchfiles              Makefile.patch

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

configure.python        ${prefix}/bin/python3.12

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

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

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

post-destroot {
    system "install_name_tool -id ${prefix}/lib/libtalloc.${major}.dylib [file join ${destroot}${prefix}/lib [file readlink ${destroot}${prefix}/lib/libtalloc.${major}.dylib]]"
}

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
