# -*- 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
PortGroup           muniversal 1.1

github.setup        yonaskolb XcodeGen 2.45.4
name                [string tolower ${github.project}]
revision            2
github.tarball_from archive

categories          devel
license             MIT
maintainers         {i0ntempest @i0ntempest} openmaintainer

description         Swift command line tool for generating your Xcode project
long_description    ${name} is a command line tool written in Swift that generates your Xcode project\
                    using your folder structure and a project spec.

checksums           rmd160  0c60d6ad45d7fc8f136e3f9bee0449018a4d3819 \
                    sha256  90705e5c410a980f7d98f75462bba2120de7c94b721cc06fd3f7e52a52a1aeed \
                    size    1566196

# needs XCTest
use_xcode           yes
use_configure       no
universal_variant   yes

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

if {${universal_possible} && [variant_isset universal]} {
    foreach arch "${muniversal.architectures}" {
        build.args.${arch}-append --arch "${arch}"
    }
}

destroot {
    xinstall -m 755 ${worksrcpath}/.build/release/${name} ${destroot}${prefix}/bin/
    xinstall -d ${destroot}${prefix}/share/${name}
    copy ${worksrcpath}/SettingPresets ${destroot}${prefix}/share/${name}
}
