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

name                bindfs
version             1.18.1
revision            0

categories          fuse
license             GPL-2+
maintainers         {i0ntempest @i0ntempest} openmaintainer

description         mirrors or overlays a local directory with altered permissions
long_description    bindfs is a FUSE filesystem for mirroring a directory to another \
                    directory, similarly to mount --bind. The permissions of the \
                    mirrored directory can be altered in various ways.

homepage            https://bindfs.org/
master_sites        ${homepage}downloads/

checksums           rmd160  4fac375071e5c89cbbae99df4be2e4f7a051ee53 \
                    sha256  2a7064d993a5f255c52d72385ef14e349c131bc44195766e2173428e06d279fd \
                    size    431995

patchfiles-append   patch-revert-3293dc98e37eed0fb0cbfcbd40434d3c37c69480.patch

configure.cflags-append \
                    -D_DARWIN_C_SOURCE
if {${os.platform} eq "darwin" && ${os.major} > 22} {
    configure.cflags-append \
                    -Wno-error=incompatible-function-pointer-types
}
configure.args-append \
                    --with-core-foundation \
                    --with-fuse2 \
                    --disable-macos-fs-link
# Port builds with fuse 3 but has bugs when running

variant fs_link description "Link ${name} to a .fs bundle in /Library/Filesystems" {
    configure.args-delete \
                    --disable-macos-fs-link

    destroot.violate_mtree \
                    yes

    notes-append "
        With +fs_link, you may use \'mount -t ${name}\' and use ${name} in /etc/fstab.
    "
}
