# -*- 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 libcaes 20260520
revision            0
categories          security devel crypto
license             LGPL-3+
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         Library to support cross-platform AES encryption
long_description    {*}${description}
distname            ${name}-alpha-${version}
checksums           rmd160  c0cf7444a7362a4ea32fafd92b1f05706a6c7ebe \
                    sha256  465b2f6ad1a6125a23522b517749c17445a5fa34fc9fb2c21189ad98eb60081c \
                    size    929760
github.tarball_from releases

worksrcdir          ${name}-${version}

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

depends_build-append \
                    port:gettext \
                    path:bin/pkg-config:pkgconfig \
                    port:py${py_ver_nodot}-setuptools

depends_lib-append  port:gettext-runtime \
                    port:libcerror \
                    port:libiconv \
                    port:python${py_ver_nodot}

configure.python    ${prefix}/bin/python${py_ver}
set python_root     ${frameworks_dir}/Python.framework/Versions/${py_ver}

configure.env-append \
                    PYTHON_CONFIG=${configure.python}-config

# TODO: FreeBSD disable openssl in these ports, but why?
# https://github.com/freebsd/freebsd-ports/blob/152bd88e17be1235de6f646cd8165b9b186b6860/security/libcaes/Makefile#L18
configure.args-append \
                    --enable-python \
                    --with-libiconv-prefix=${prefix} \
                    --with-libintl-prefix=${prefix} \
                    --with-openssl=no \
                    --with-pyprefix=${python_root}
