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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           xcode 1.0

github.setup        i0ntempest Browserino 1.2.1 v
github.tarball_from archive
name                [string tolower ${github.project}]
revision            0
categories          aqua www
platforms           {macosx >= 23}
supported_archs     arm64 x86_64
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             GPL-3

description         Native browser selector for macOS
long_description    ${github.project} lets you choose which browser or application \
                    opens a link, with keyboard shortcuts and domain-based rules.

checksums           rmd160  87286c80181834be885d78bce39ee957f9117762 \
                    sha256  27f7d5421a24b38c54c2c0eeb57fbcd059abd9ad7e8137bed225548de517022b \
                    size    2238979

xcode.project       ${github.project}.xcodeproj
xcode.scheme        ${github.project}
xcode.configuration Release

# Keep Xcode/Swift caches writable inside the MacPorts sandbox. Swift compiler
# macros fail to launch a nested sandbox without -disable-sandbox.
build.pre_args-append \
                    -derivedDataPath ${workpath}/DerivedData
xcode.build.settings-append \
                    OTHER_SWIFT_FLAGS='-disable-sandbox' \
                    CLANG_MODULE_CACHE_PATH=${workpath}/ModuleCache \
                    CODE_SIGN_IDENTITY=-

universal_variant   no

destroot {
    copy ${worksrcpath}/build/${xcode.configuration}/${github.project}.app ${destroot}${applications_dir}
}

notes "
    Open ${github.project} from ${applications_dir} and use its General preferences
    to make it your default browser and configure shortcuts.
"
