# -*- 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.4
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  c48608858747fdd4b9c25597221300396707fc0d \
                sha256  c49cbc6fc92dad98b79a99b357514ad999db715bc282088c043edafd91b3b0e8 \
                size    15623052

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