# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           xcode 1.0

github.setup        acidanthera MaciASL 1.6.5
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
categories          devel aqua
maintainers         {i0ntempest @i0ntempest} openmaintainer
license             GPL-3

description         A native AML compiler and IDE for macOS
long_description    {*}${description}, with syntax coloring, tree navigation, automated patching, \
                    online patch file repositories, and iASL binary updates. Written entirely \
                    in Cocoa, conforms to macOS guidelines.

checksums           rmd160  ffce73fc05ee8b7d4587e528e42820dc12f9db52 \
                    sha256  e6cdd7d75431ccadd9db29217863191668801c733a6291aadd26e388351d3420 \
                    size    5698920

patchfiles          patch-FSRulerView-rect.diff

depends_run-append  port:acpica

post-patch {
    delete ${worksrcpath}/Dist/iasl-dev
    set wrapper [open ${worksrcpath}/Dist/iasl-dev w]
    puts ${wrapper} "#!/bin/sh\nexec ${prefix}/bin/iasl \"\$@\""
    close ${wrapper}
    file attributes ${worksrcpath}/Dist/iasl-dev -permissions 0755
}

xcode.scheme        MaciASL
xcode.configuration Release

build.pre_args-append \
                    -derivedDataPath ${worksrcpath}/DerivedData

if {${os.major} >= 22} {
    xcode.build.settings-append \
        CODE_SIGN_IDENTITY=-
} else {
    xcode.build.settings-append \
        CODE_SIGN_IDENTITY= CODE_SIGNING_REQUIRED=NO
}

destroot {
    file copy ${worksrcpath}/build/${xcode.configuration}/MaciASL.app ${destroot}${applications_dir}
}
