# -*- 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    headkaze Hackintool 4.1.2
github.tarball_from \
                archive
revision        0
categories      sysutils aqua
maintainers     {i0ntempest @i0ntempest} openmaintainer
license         MIT

description     The Swiss army knife of vanilla Hackintoshing
long_description \
                {*}${description}

checksums       rmd160  4ba18a95db9edff12666d2649f6aa27ede64986b \
                sha256  c5bd1f2ceb17d8f717b01f168d67144d7c34064a68abe2b310438504f9ce3ef4 \
                size    15615690

platforms       macosx
compiler.cxx_standard \
                2017

depends_lib-append \
                port:pciids

xcode.target    Hackintool
xcode.configuration \
                Release

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

post-configure {
    ln -sf ${prefix}/share/pci.ids ${worksrcpath}/Resources/PCI/pci.ids
}

post-patch {
    # Disable Sparkle without messing with xib files
    system -W ${worksrcpath}/Hackintool/ "/usr/libexec/PlistBuddy -c \"Delete :SUFeedURL\" Hackintool-Info.plist"
    system -W ${worksrcpath}/Hackintool/ "/usr/libexec/PlistBuddy -c \"Add :SUEnableAutomaticChecks bool false\" Hackintool-Info.plist"
}

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