# -*- 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.0
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
categories          devel
license             MIT
maintainers         nomaintainer
supported_archs     x86_64 arm64

checksums           rmd160  b62652369d28e485c277a2ad444a4dd08ac5f54e \
                    sha256  91332284661500cc9d1ff30b4d50c936d3059c119e2e8086f3ef869400ce005c \
                    size    288124

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