# -*- 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.0.6
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  c76e90edd8a0ce56ea29e4e1148b93e096053b8c \
                sha256  c046077783e0e7928dce6e2b0af7a104004f28e95091ed587903403ba4a60268 \
                size    15597107

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