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

github.setup        libyal libuna 20260522
revision            0
categories          devel textproc
maintainers         nomaintainer
license             LGPL-3+
description         Library to support Unicode and ASCII (byte string) conversions
long_description    ${description}
distname            ${name}-alpha-${version}
checksums           rmd160  462b96e2ed7a460660f6517db89e61c0a48a0be2 \
                    sha256  3e507ccf04cdb9cc3eb54238d3b64ce0c1fc3819f1b426c34a19bee7c1109080 \
                    size    1952342
github.tarball_from releases

worksrcdir          ${name}-${version}

depends_build-append \
                    port:gettext \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:gettext-runtime \
                    port:libcerror \
                    port:libiconv

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

if {${subport} eq ${name}} {
    post-destroot {
        delete -f ${destroot}${prefix}/bin
        # Delete man for unaexport tool:
        delete -f ${destroot}${prefix}/share/man/man1
    }
}

# We separate installation of tools from the library it a somewhat ugly way,
# because there is no configure argument for that, but it is needed
# due to a circular dependency between libcfile, libuna and unatools.
subport unatools {
    description     Tools to support Unicode and ASCII (byte string) conversions

    depends_lib-append \
                    port:libcdatetime \
                    port:libcfile \
                    port:libclocale \
                    port:libcnotify \
                    port:libuna

    post-destroot {
        delete -f ${destroot}${prefix}/include
        delete -f ${destroot}${prefix}/lib
        # Delete man for libuna:
        delete -f ${destroot}${prefix}/share/man/man3
    }
}
