# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1

# openat
legacysupport.newest_darwin_requires_legacy 10

name                minase
github.setup        SAT1226 Minase 9674dfa07945ba0d297f41b5b3064cb8b2fe2f5c
version             20230615
revision            0
categories          sysutils
license             MIT
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         ${name} is a terminal file manager
long_description    {*}${description}
checksums           rmd160  508a077b63331141d2eda27a9facb1de6e0854a1 \
                    sha256  b8cab01accd2261e96cd7a413c7d5f9cba54b4330ff0b3312882afb25a73a8fc \
                    size    204291
github.tarball_from archive

# FIXME: the port builds on ppc64 but segfaults on launch.
supported_archs     arm64 i386 ppc x86_64

patch.pre_args-replace  -p0 -p1

# https://github.com/SAT1226/Minase/pull/8
patchfiles          0001-CMakeLists-fix-handling-flags.patch \
                    0002-main.cpp-improve-portability-for-non-Linux-OS.patch

compiler.cxx_standard   2011

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

depends_lib-append  port:libiconv \
                    port:taglib \
                    port:uchardet \
                    port:zlib

depends_run-append  port:archivemount \
                    port:atool \
                    port:libsixel \
                    port:unar

# Drop unar from here with 2.11.6 release of the base.
# See: https://trac.macports.org/ticket/72940
if {${os.platform} eq "darwin" && ${os.major} < 10} {
    depends_run-delete \
                    port:archivemount \
                    port:unar
}

# For some reason, this is not being set automatically:
configure.args-append \
                    -DICONV_LIBRARIES="iconv"
