diff options
author | Chris Morgan | 2021-07-01 03:40:07 +1000 |
---|---|---|
committer | Chris Morgan | 2021-07-01 03:57:44 +1000 |
commit | 3d5d8ce8f12def7440b3647adc2773aa3cb5d115 (patch) | |
tree | 83dd1ce54b7aa85849e855c24f3b7fe98460ba98 | |
parent | 176cee3ccf838dd5d6224c8b8ec39b4cd7ba9160 (diff) | |
download | aur-3d5d8ce8f12def7440b3647adc2773aa3cb5d115.tar.gz |
Various improvements, most significantly gimp-2.99
• Improved version numbers: upstream changed from `v.234` to `v.2.3.4`,
which messed up the ordering, since `v.2.9.7` (the latest version of
gmic-qt) sorted earlier than `v.218` (the last commit of this
package). I resolved this by stripping the `v.` prefix, since `v`
sorts earlier than `2`, so order is retained without needing an epoch.
• gimp-2.99 is now supported (and, in anticipation, gimp-3.0), in
addition to gimp-2.0. They’re packaged as mutually exclusive here for
now, which is probably not great, but it’ll do for now. I put the gimp
major version number in the pkgver; that might be something, I guess.
I will note here that I actually haven’t verified this on the
extra/gimp package (gimp-2.0), only on aur/gimp-devel (gimp-2.99).
But I believe it should work.
• Fixed the missing wget make dependency (gmic requires it).
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 70 |
2 files changed, 65 insertions, 11 deletions
@@ -1,11 +1,12 @@ pkgbase = gimp-plugin-gmic-git pkgdesc = Front-end to the image processing framework G'MICQ - pkgver = v.218.r4.g6267a65 - pkgrel = 2 + pkgver = 2.9.7.r82.gda87d71.gimp.2.0 + pkgrel = 1 url = https://github.com/c-koi/gmic-qt arch = i686 arch = x86_64 license = GPL3 + makedepends = wget depends = gimp depends = libpng depends = zlib @@ -18,4 +19,3 @@ pkgbase = gimp-plugin-gmic-git md5sums = SKIP pkgname = gimp-plugin-gmic-git - @@ -1,19 +1,64 @@ pkgname='gimp-plugin-gmic-git' _name='gmic' -pkgver=v.218.r4.g6267a65 -pkgrel=2 +pkgver=2.9.7.r82.gda87d71.gimp.2.0 +pkgrel=1 pkgdesc="Front-end to the image processing framework G'MICQ" url="https://github.com/c-koi/${_name}-qt" depends=('gimp' 'libpng' 'zlib' 'fftw' 'curl' 'qt5-base') +makedepends=('wget') license=('GPL3') arch=('i686' 'x86_64') source=("git+${url}.git" "git+https://github.com/dtschump/${_name}.git") md5sums=('SKIP' 'SKIP') +_try_gimp_version() { + case "$1" in + 2.0) + _host=gimp + _plugin_dir=/usr/lib/gimp/$1/plug-ins/ + _builder=qmake + ;; + 2.99|3.0) + _host=gimp3 + _plugin_dir=/usr/lib/gimp/$1/plug-ins/gmic_gimp_qt/ + # https://github.com/c-koi/gmic-qt/pull/104 added experimental gimp3 support, but it only covers the cmake approach, not qmake. + _builder=cmake + ;; + *) + return 1 + ;; + esac +} + +# _gimp_version should be "2.0", "2.99" or "3.0"; it can be specified by passing an environment variable in, or it can be discovered. +# (Ideally this might possibly be multiple distinct packages, but I’m not sure, since packages like gimp and gimp-devel conflict anyway, so at the least I don’t think they’d be produced from a common pkgbase.) +msg "Choosing GIMP major version to build for..." +if [ -n "$_gimp_version" ]; then + if _try_gimp_version "$_gimp_version"; then + msg2 "Using $_gimp_version (from _gimp_version environment variable)" + else + error "_gimp_version was manually set to '$_gimp_version', but I don’t know what to do with that (known values are '2.0', '2.99' and '3.0')" + exit 1 + fi +else + for f in /usr/share/gimp/?.*/; do + if _try_gimp_version "${f:16:-1}"; then + _gimp_version="${f:16:-1}" + break + fi + done + if [ -n "$_gimp_version" ]; then + msg2 "Using $_gimp_version (found installed locally)" + else + error "Couldn’t determine GIMP version, make sure you have a GIMP package installed" + exit 1 + fi +fi + pkgver() { cd "${_name}-qt" ( set -o pipefail - git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v\.//;s/$/.gimp.'"$_gimp_version"'/' || printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" ) } @@ -22,13 +67,22 @@ build() { cd "${srcdir}" make -C ${_name}/src CImg.h gmic_stdlib.h cd "${_name}-qt" - qmake HOST=gimp - make + if [ $_builder = cmake ]; then + mkdir -p build + cd build + cmake .. -DGMIC_QT_HOST=$_host + make + else + qmake HOST=$_host + make + fi } package() { cd "${srcdir}/${_name}-qt" - mkdir -p "${pkgdir}/usr/lib/gimp/2.0/plug-ins/" - cp ${_name}_gimp_qt ${pkgdir}/usr/lib/gimp/2.0/plug-ins/ + mkdir -p "${pkgdir}${_plugin_dir}" + if [ $_builder = cmake ]; then + cd build + fi + cp ${_name}_gimp_qt "${pkgdir}${_plugin_dir}" } - |