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

github.setup        XcodesOrg xcodes 1.6.2
github.tarball_from archive
revision            0
categories          devel
license             MIT
maintainers         {i0ntempest @i0ntempest} openmaintainer
supported_archs     x86_64 arm64

checksums           rmd160  5137f27e98e5775ef597ae22db544fa31aa088d2 \
                    sha256  0c38a39ecd527d15c3343da9b9bc57c9f0d5217f4c9d36fc3879c3ae423b1295 \
                    size    288284

description         The best command-line tool to install and switch between multiple versions of Xcode
long_description    {*}${description}

use_configure       no
use_xcode           yes

build.type          xcode
build.cmd           swift
build.args          --configuration release -Xswiftc -Onone --disable-sandbox
build.target        build

platform darwin {
    if { ${os.major} < 21 } {
        known_fail  yes
        pre-fetch {
            ui_error "${subport} requires macOS 12 or later"
            return -code error "incompatible macOS version"
        }
    }
}

destroot {
    xinstall -m 755 ${worksrcpath}/.build/release/xcodes ${destroot}${prefix}/bin/
}
