# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# should match gimp2 version
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description GIMP.app application bundle
long_description ${description}
homepage https://www.gimp.org/
set branch [join [lrange [split ${version} .] 0 1] .]
master_sites gimp:gimp/v${branch}/osx
# name has an architecture in it, but we delete architecture dependent components
distfiles gimp-${version}-x86_64.dmg
checksums rmd160 e73dbbf4a5963803bb008303101780cac2f96ecd \
sha256 8b964ad3dbbe31d0fa48fb834aa4c17fc0eb81becbc4595a57b04e3d4fc6efeb \
conflicts-append gimp-app
depends_run-append path:bin/gimp:gimp2
patchfiles-append patch-Info.plist.diff
move ${worksrcpath}/GIMP-[join [lrange [split ${version} .] 0 1] .].app ${worksrcpath}/GIMP.app
delete ${worksrcpath}/GIMP.app/Contents/Resources/etc
delete ${worksrcpath}/GIMP.app/Contents/Resources/share
delete ${worksrcpath}/GIMP.app/Contents/Resources/include
delete ${worksrcpath}/GIMP.app/Contents/Resources/lib
delete {*}[glob ${worksrcpath}/GIMP.app/Contents/MacOS/*]
set script [open "${worksrcpath}/GIMP.app/Contents/MacOS/GIMP" w 0755]
puts ${script} "#!/bin/sh"
puts ${script} "exec ${prefix}/bin/gimp \"$@\""
copy ${worksrcpath}/GIMP.app ${destroot}${applications_dir}
livecheck.url https://download.gimp.org/pub/gimp/v2.10/osx/
livecheck.regex {gimp-(\d+(?:\.\d+)*)-.*\.dmg}