summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1c2d249f3f3c7624b9e91b7e2c62c975a50fc9fc (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: twa022 <twa022 at gmail dot com>

_pkgname=gimp
pkgname=${_pkgname}-devel
pkgver=2.9.8
pkgrel=1
pkgdesc="GNU Image Manipulation Program (Development version)"
arch=('i686' 'x86_64')
url="http://www.gimp.org/"
license=('GPL' 'LGPL')
depends=('pygtk' 'lcms' 'libxpm' 'libwmf' 'libxmu' 'librsvg' 'libmng' 'dbus-glib'
         'libexif' 'gegl>=0.3.24' 'jasper' 'desktop-file-utils' 'hicolor-icon-theme' 'babl>=0.1.38'
         'openexr' 'libgudev' 'libgexiv2' 'libmypaint>=1.3.0' 'libwebp' 'aalib')
makedepends=('intltool' 'poppler-glib' 'alsa-lib' 'iso-codes' 'curl' 'ghostscript' 'gtk-doc')
optdepends=('gutenprint: for sophisticated printing only as gimp has built-in cups print support'
            'poppler-glib: for pdf support'
            'alsa-lib: for MIDI event controller module'
            'curl: for URI support'
            'ghostscript: for postscript support')
options=('!makeflags')
conflicts=("${_pkgname}")
provides=("${_pkgname}=$pkgver")
source=(https://download.gimp.org/pub/gimp/v${pkgver%.*}/${_pkgname}-${pkgver}.tar.bz2 linux.gpl)
sha256sums=('a94983ea4ab230629ae2515506917a49d1df62816d8fac0cf60ef548ea3d9162'
            '1003bbf5fc292d0d63be44562f46506f7b2ca5729770da9d38d3bb2e8a2f36b3')

prepare() {
  export PYTHON=/usr/bin/python2
  cd "${srcdir}/${_pkgname}-${pkgver}"
  _mypaintver=$( ls /usr/lib/libmypaint-*.so | grep -o -E '\-[0-9]+(\.[0-9]+)*' | head -1 )
  sed -i "s:\(libmypaint\)\( >= libmypaint_required_version\):\1${_mypaintver}\2:g" configure.ac
  
  autoreconf -vi
  # python2 fixes
  sed -i 's:PYTHON=python$:&2:' plug-ins/pygimp/py-compile
  find ./plug-ins -type f -name *py -exec \
    sed -i 's|#!.*python$|#!/usr/bin/python2|' '{}' \;
}
  
build() {
  export PYTHON=/usr/bin/python2
  cd "${srcdir}/${_pkgname}-${pkgver}"
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-mp \
    --enable-gimp-console \
    --enable-gimp-remote \
    --enable-python \
    --enable-gtk-doc \
    --without-webkit
  make
}

package() {
  export PYTHON=/usr/bin/python2
  cd "${srcdir}/${_pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -D -m644 "${srcdir}/linux.gpl" "${pkgdir}/usr/share/gimp/2.0/palettes/Linux.gpl"

  #rm "${pkgdir}/usr/share/man/man1/gimp-console-${pkgver%.*}.1"
  ln -s gimp-console-${pkgver%.*}.1.gz "${pkgdir}/usr/share/man/man1/gimp-console.1.gz"
  ln -sf gimptool-2.0.1.gz "${pkgdir}/usr/share/man/man1/gimptool.1.gz"
  ln -s gimp-${pkgver%.*}.1.gz "${pkgdir}/usr/share/man/man1/gimp.1.gz"

  ln -s gimptool-2.0 "${pkgdir}/usr/bin/gimptool"
  ln -s gimp-${pkgver%.*} ${pkgdir}/usr/bin/gimp
  ln -s gimp-console-${pkgver%.*} ${pkgdir}/usr/bin/gimp-console
}