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

github.setup        libyal libfsntfs 20251028
revision            0
categories          fuse
license             LGPL-3+
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         Library and tools to access the Windows New Technology File System (NTFS)
long_description    {*}${description}.
distname            ${name}-experimental-${version}
checksums           rmd160  e2c878fd45f06f3b75ae1636f0cf10f70073f7b0 \
                    sha256  9edbd1982f8868121391a35696e34c413794a5d88cd91e4ec8b183133eb577f6 \
                    size    2025278
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:libbfio \
                    port:libcaes \
                    port:libcdata \
                    port:libcerror \
                    port:libcfile \
                    port:libclocale \
                    port:libcnotify \
                    port:libcpath \
                    port:libcsplit \
                    port:libcthreads \
                    port:libfcache \
                    port:libfdata \
                    port:libfdatetime \
                    port:libfguid \
                    port:libfusn \
                    port:libfwnt \
                    port:libhmac \
                    port:libiconv \
                    port:libuna \
                    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 (and MacPorts did not use it), but why?
# https://github.com/freebsd/freebsd-ports/blob/1a66bb13094f8dd0379cf00c3a72889f4524d050/filesystems/libfsntfs/Makefile#L20
configure.args-append \
                    --enable-python \
                    --with-libiconv-prefix=${prefix} \
                    --with-libintl-prefix=${prefix} \
                    --with-openssl=no \
                    --with-pyprefix=${python_root}
