updated on Mon Jan 16 04:00:32 UTC 2012
[aur-mirror.git] / photivo-hg / PKGBUILD
blobd87d30b28b3c165c9f28de40d21cac1233f1f260
1 # Maintainer: Lukas Jirkovsky <l.jirkovsky AT gmail.com>
2 pkgname=photivo-hg
3 pkgver=667
4 pkgrel=1
5 pkgdesc="Free and open source photo processor"
6 arch=('i686' 'x86_64')
7 url="http://photivo.org/"
8 license=('GPL3')
9 depends=('exiv2' 'qt' 'lcms2' 'fftw' 'graphicsmagick-qd16' 'lensfun' 'liblqr' 'shared-mime-info')
10 optdepends=('gimp: Gimp plugins' 'python2: Gimp to Photivo plugin')
11 makedepends=('mercurial' 'gimp')
12 provides=('photivo')
13 conflicts=('photivo')
14 install=photivo.install
15 source=(gimp_image_add_layer_define.diff)
16 md5sums=('ad14c7e6c46d593b359cccd82a4c2327')
18 _hgroot="https://photivo.googlecode.com/hg/"
19 _hgrepo="photivo"
21 build() {
22   cd "$srcdir"
23   msg "Connecting to Mercurial server...."
25   if [ -d $_hgrepo ] ; then
26     cd $_hgrepo
27     hg pull -u || return 1
28     msg "The local files are updated."
29   else
30     hg clone $_hgroot $_hgrepo || return 1
31   fi
33   msg "Mercurial checkout done or server timeout"
34   msg "Starting make..."
36   if [ -e "$srcdir/$_hgrepo-build" ]; then
37     rm -rf "$srcdir/$_hgrepo-build"
38   fi
39   cp -a "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
40   cd "$srcdir/$_hgrepo-build"
42   # remove the need for ccache
43   find . -type f -name "*.pro" -exec sed -i 's|ccache||' '{}' ';'
44   # build fix
45   patch -Np1 < "$srcdir"/gimp_image_add_layer_define.diff || true
47   qmake PREFIX=/usr
48   make
50   # fix the "Gimp to Photivo" plugin
51   sed -i -e 's|\x0D$||' -e 's|#!.*|#!/usr/bin/python2|' "mm extern photivo.py"
54 package() {
55   cd "$srcdir/$_hgrepo-build"
57   make INSTALL_ROOT="$pkgdir" install
58   rm -rf "$pkgdir"/home
60   # GIMP integration
61   install -D -m755 ptGimp "$pkgdir/usr/lib/gimp/2.0/plug-ins/ptGimp"
62   install -D -m755 "mm extern photivo.py" "$pkgdir/usr/lib/gimp/2.0/plug-ins/mm-extern-photivo.py"