# -*- 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        bootoption bootoption 0.6.0
revision            0
github.tarball_from archive

categories          sysutils
license             GPL-3
maintainers         {i0ntempest @i0ntempest} openmaintainer
# needs Swift 5
platforms           {darwin >= 18}

description         EFI boot menu manipulation for macOS, like efibootmgr
long_description    ${description}

checksums           rmd160  05c9160dcd4d1ea5f00cc152376f2fbc76e74f4a \
                    sha256  c635749ca34756c142034bfd4ffd50f541a0f2198f3058c24fcef7372affbd92 \
                    size    22576

use_configure       no
use_xcode           yes

build.cmd           swift
build.target        build
build.args          --configuration release --disable-sandbox

set builtproductdir     ${worksrcpath}/.build/release

variant universal {
    PortGroup           conflicts_build 1.0
    conflicts_build     libunwind
    build.args-append   --arch x86_64 --arch arm64
    set builtproductdir ${worksrcpath}/.build/apple/Products/Release
}

destroot {
    xinstall -m 755 ${builtproductdir}/${name} ${destroot}${prefix}/bin/
}
