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

name                talloc
conflicts           samba3
version             2.1.12
set major           [lindex [split ${version} .] 0]
categories          devel
# mostly LGPL, but a few files are GPL
license             GPL-3+
platforms           darwin
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  87ee29aafe57689320e68ae8b80fe9e3e2c3b0c6 \
                    sha256  987c0cf6815e948d20caaca04eba9b823e67773f361ffafe676e24b953cc604b

post-patch {
    # PG waf does not allow setting location of ./waf
    ln -sf ${worksrcpath}/buildtools/bin/waf  ${worksrcpath}/
    reinplace "s|../../third_party/waf|third_party/waf|" ${worksrcpath}/waf
}

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

post-destroot {
    system "install_name_tool -id ${prefix}/lib/libtalloc.${major}.dylib ${destroot}${prefix}/lib/libtalloc.${major}.dylib"
}

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