PKGBUILDs/community/gmic/PKGBUILD

121 lines
3.5 KiB
Bash
Raw Normal View History

2017-12-22 12:41:15 +00:00
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
2013-09-13 14:40:59 +00:00
# Contributor: farid <farid at archlinuc-br.org>
# Contributor: Archie <Mymaud@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove -mtune=generic from makefile, replace with our CFLAGS
2020-01-23 20:22:12 +00:00
# - remove -flto from makefile
2020-03-28 20:09:40 +00:00
# - set LTO=off for gmic-qt
2013-09-13 14:40:59 +00:00
2016-09-05 17:12:01 +00:00
highmem=1
2013-09-13 14:40:59 +00:00
pkgbase=gmic
2017-12-22 12:41:15 +00:00
pkgname=(gmic zart gimp-plugin-gmic krita-plugin-gmic)
2020-03-28 19:15:51 +00:00
pkgver=2.9.0
2020-05-15 14:08:32 +00:00
pkgrel=7
2017-12-22 12:41:15 +00:00
arch=(x86_64)
2019-03-15 18:23:08 +00:00
url="https://gmic.eu/"
2017-12-22 12:41:15 +00:00
license=(custom:CeCILL)
2020-05-15 14:08:32 +00:00
makedepends=(cmake gimp qt5-base fftw openexr opencv eigen graphicsmagick qt5-tools)
2020-03-28 19:15:51 +00:00
source=(https://gmic.eu/files/source/gmic_$pkgver.tar.gz zart-opencv4.patch)
sha256sums=('6233695f9b27999dcc7cc3aa7480b0f192bd44de85209091a3b4b8a65ae8c4b5'
'f4295a2b9a6730060e1dd763c602bd5156570d623bc69c2214dfd11e94943296')
2013-09-13 14:40:59 +00:00
prepare() {
2020-05-15 14:08:32 +00:00
mkdir -p build{,-qt,-krita,-gimp,-zart}
sed -e 's|pkg_check_modules(OPENCV opencv)|pkg_check_modules(OPENCV opencv4)|' -i gmic-$pkgver/CMakeLists.txt
2018-11-24 13:40:19 +00:00
# fix build with openCV 4.0
2019-05-13 22:46:44 +00:00
cd gmic-$pkgver/zart
2019-08-24 22:49:32 +00:00
patch -p1 -i ../../zart-opencv4.patch
sed -e 's|opencv|opencv4|' -i zart.pro
2017-07-06 18:31:40 +00:00
2018-11-24 18:20:04 +00:00
cd ..
sed -i "s|-mtune=generic|${CFLAGS}|" src/Makefile
2020-01-23 20:22:12 +00:00
sed -i 's/-flto//g' src/Makefile
2013-09-13 14:40:59 +00:00
}
build() {
2020-05-15 14:08:32 +00:00
cd build
cmake ../gmic-$pkgver \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_DYNAMIC_LINKING=ON
make
2018-06-21 19:11:30 +00:00
2020-05-15 14:08:32 +00:00
export LDFLAGS="$LDFLAGS -L../build"
cd ../build-qt
cmake ../gmic-$pkgver/gmic-qt \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_DYNAMIC_LINKING=ON \
-DGMIC_PATH="$srcdir"/gmic-$pkgver/src \
-DGMIC_QT_HOST=none \
-DENABLE_LTO=OFF
2018-06-21 19:11:30 +00:00
make
2020-05-15 14:08:32 +00:00
cd ../build-gimp
cmake ../gmic-$pkgver/gmic-qt \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_DYNAMIC_LINKING=ON \
-DGMIC_PATH="$srcdir"/gmic-$pkgver/src \
-DGMIC_QT_HOST=gimp \
-DENABLE_LTO=OFF
make
cd ../build-krita
cmake ../gmic-$pkgver/gmic-qt \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_DYNAMIC_LINKING=ON \
-DGMIC_PATH="$srcdir"/gmic-$pkgver/src \
-DGMIC_QT_HOST=krita \
-DENABLE_LTO=OFF
2018-06-21 19:11:30 +00:00
make
2020-05-15 14:08:32 +00:00
cd ../build-zart
2020-04-23 18:29:56 +00:00
export CXXFLAGS=${CXXFLAGS/-O2/} # https://github.com/c-koi/zart/issues/14
2020-05-15 14:08:32 +00:00
qmake ../gmic-$pkgver/zart \
GMIC_PATH="$srcdir"/gmic-$pkgver/src GMIC_DYNAMIC_LINKING=on QMAKE_CXXFLAGS+=" -DOPENCV2_HEADERS"
2018-06-21 19:11:30 +00:00
make
2013-09-13 14:40:59 +00:00
}
package_gmic() {
pkgdesc="GREYC's Magic Image Converter: image processing framework"
2020-05-15 14:08:32 +00:00
depends=(graphicsmagick opencv fftw)
2017-12-22 12:41:15 +00:00
optdepends=('qt5-base: for the Qt UI')
2013-09-13 14:40:59 +00:00
2020-05-15 14:08:32 +00:00
cd build
make DESTDIR="$pkgdir" install
install -Dm644 ../gmic-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
cd ../build-qt
2017-12-22 12:41:15 +00:00
make DESTDIR="$pkgdir" install
2013-09-13 14:40:59 +00:00
}
package_zart() {
pkgdesc="A GUI for G'MIC real-time manipulations on the output of a webcam"
2018-06-21 19:11:30 +00:00
depends=(gmic qt5-base)
2013-09-13 14:40:59 +00:00
2020-05-15 14:08:32 +00:00
cd build-zart
install -Dm755 zart -t "$pkgdir"/usr/bin
install -Dm644 ../gmic-$pkgver/zart/Licence_CeCILL_V2-en.html -t "$pkgdir"/usr/share/licenses/$pkgname
2013-09-13 14:40:59 +00:00
}
package_gimp-plugin-gmic() {
pkgdesc="Gimp plugin for the G'MIC image processing framework"
2018-06-21 19:11:30 +00:00
depends=(gimp gmic qt5-base)
2013-09-13 14:40:59 +00:00
2020-05-15 14:08:32 +00:00
cd build-gimp
make DESTDIR="$pkgdir" install
install -Dm644 ../gmic-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
2013-09-13 14:40:59 +00:00
}
2017-10-11 14:34:51 +00:00
package_krita-plugin-gmic() {
pkgdesc="Krita plugin for the G'MIC image processing framework"
2018-06-21 19:11:30 +00:00
depends=(krita gmic)
2017-10-11 14:34:51 +00:00
2020-05-15 14:08:32 +00:00
cd build-krita
make DESTDIR="$pkgdir" install
install -Dm644 ../gmic-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
2017-10-11 14:34:51 +00:00
}