# -*- 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.3
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  14c2985aea2a361e0faa26078c7877528d6cf5ba \
                sha256  ab9393168fe03654f6c4adea37ee2e9daa71c772b77683a1a2c94731c4cf394a \
                size    15616172

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