# -*- 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.1
github.tarball_from archive
revision            0
categories          devel
license             MIT
maintainers         {i0ntempest @i0ntempest} openmaintainer
supported_archs     x86_64 arm64

checksums           rmd160  f57153c31275ff145cc90c3bc57128095e481f0b \
                    sha256  e57f4e663c2e447bdd4a0f669dff7ad0155e4ac1fdd1720ff9a48b41f7cb9f9c \
                    size    288191

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/
}
