PortSystem 1.0
PortGroup       github 1.0
PortGroup       xcode 1.0
PortGroup       xcodeversion 1.0

github.setup    julienXX terminal-notifier 2.0.0
categories      aqua
platforms       darwin
license         MIT
maintainers     {raimue @raimue} \
                openmaintainer

description     A command line tool to send Mac OS X user notifications
long_description \
                ${name} is able to send notifications to the Mac OS X \
                Notification Center, which is available in Mac OS X \
                10.8 Mountain Lion or later.

minimum_xcodeversions {12 5.0}

pre-fetch {
    if {${os.platform} eq "darwin" && ${os.major} < 12} {
        ui_error "${name} only works with Mac OS X 10.8 Mountain Lion or later."
        return -code error "incompatible Mac OS X version"
    }
}

checksums       rmd160  72ddf0b935edefb734a6073bbf1a16fd4fe9452e \
                sha256  7831e92a48c041c2b1c58671a6de62d4162d7144b63cbc489fc43ac4a74e179d \
                size    662059

post-extract {
    # This icon is a copy from Apple and is protected by copyright. Delete this
    # here to avoid distributing copyright protected files in archives.
    delete ${worksrcpath}/Terminal.icns
}

patchfiles      patch-pbxproj.diff

xcode.destroot.path ${prefix}/libexec/terminal-notifier

post-destroot {
    xinstall -m 0755 ${filespath}/terminal-notifier ${destroot}${prefix}/bin/terminal-notifier
    reinplace "s:@@PREFIX@@:${prefix}:" ${destroot}${prefix}/bin/terminal-notifier
}
