summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1ce1ca7f8ba7c335368b8314a8304efa732da854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Maintainer:

_pkgname="gimp-plugin-gmic"
pkgname="$_pkgname-git"
pkgver=3.4.2.r14.g3b7a6fa
pkgrel=1
pkgdesc="Gimp plugin for the G'MIC image processing framework"
url="https://github.com/GreycLab/gmic-qt"
license=('CECILL-C')
arch=('x86_64')

depends=(
  'fftw'
  'gimp-git' # AUR
  'glib2'
  'gmic'
  'libx11'
  'qt6-base'
  'zlib'
)

makedepends=(
  'cmake'
  'git'
  'ninja'
  'qt6-tools'
)

_pkgsrc="greyclab.gmic-qt"
source=("$_pkgsrc"::"git+https://github.com/GreycLab/gmic-qt.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  # Allow build type None
  sed -E -e '/CMAKE_BUILD_TYPE/s&FATAL_ERROR&WARNING&' -i "$_pkgsrc/CMakeLists.txt"
}

build() {
  pushd "$_pkgsrc/translations"
  for i in *.ts; do
    /usr/lib/qt6/bin/lrelease -compress "$i"
  done
  cp *.qm filters/
  popd

  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX='/usr'
    -DBUILD_WITH_QT6=ON
    -DGMIC_QT_HOST=gimp3
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 "$_pkgsrc/COPYING" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}