1 # Maintainer: Tobias Powalowski <tpowa@archlinux.org>
2 # Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>
5 pkgname=('xsane' 'xsane-gimp')
9 url="https://gitlab.com/sane-project/frontend/xsane"
11 makedepends=('gtk2' 'lcms2' 'sane' 'zlib' 'libjpeg' 'gimp')
12 source=(http://http.debian.net/debian/pool/main/x/$pkgname/${pkgname}_$pkgver.orig.tar.gz
13 xsane-0.995-xdg-open.patch
14 0165-xsane-0.999-lcms2.patch
15 0001-lcms2_configure.patch
16 xsane-preview-selection.patch)
17 sha512sums=('73ec961fce1a86b5d6f5bac0995d222785eb4b077dc8e72492b092d2bf4500455426e80e4d27233721cd38ec84f77fb9f92190a6afe45bdaf7ffd1ee50b431ed'
18 'ed1c1b0fab10b456f7dc6befd6f91eb8d3e1bae0f1be3abf71d334d4a2ae8f8335ba37fdd73f336f7c5f45916df917dc77fd792e6b849a87bde95babc698bf39'
19 '557913adab90b2ba051a2988bdbfc600ca6a33f099810f5f867c8d8b2c5a45b0468dd8a1a1593ff33d149b4a5917b24d716b54ae2605b3a2e19053e02e5b64c6'
20 'a8b5e0466c1306b8df68d814a3f02bc74e4d470aa42b9e0eebad41d2e274ff74328a837dd9a0b5ca59e4df63ecbb53b268f6d4948a690d9346c5399bb5b3d1e4'
21 '001b021ddf0f92e2bbab0211cfe92c54b785e94e7c92102caedd8d4ce34c833847157174a4d800d8859ba8d05300db74b8af352e5347d2883e17bca57454e96d')
24 cd "$srcdir/$pkgname-$pkgver"
25 # fix use "xdg-open" instead of "netscape" to launch help browser - taken from Fedora
26 patch -Np1 -i "${srcdir}/xsane-0.995-xdg-open.patch"
27 sed -i -e 's:png_ptr->jmpbuf:png_jmpbuf(png_ptr):' src/xsane-save.c
28 patch -Np1 -i "${srcdir}/0165-xsane-0.999-lcms2.patch"
29 patch -Np1 -i "${srcdir}/0001-lcms2_configure.patch"
30 patch -p1 -i ../xsane-preview-selection.patch # Fix selection preview
34 cd "$srcdir/$pkgbase-$pkgver"
36 ./configure --prefix=/usr \
37 --mandir=/usr/share/man \
40 mv src/xsane src/xsane-gimp
42 # build again with gimp enabled
44 ./configure --prefix=/usr --sbindir=/usr/bin --mandir=/usr/share/man --disable-gimp
49 pkgdesc="A GTK-based X11 frontend for SANE and plugin for Gimp."
50 install=$pkgname.install
51 depends=('gtk2' 'lcms2' 'sane' 'zlib' 'libjpeg')
52 optdepends=('xsane-gimp: for gimp plugin support')
53 cd "$srcdir/$pkgbase-$pkgver"
54 make DESTDIR="$pkgdir" install
57 package_xsane-gimp() {
58 pkgdesc="XSane Gimp plugin"
59 depends=('xsane' 'gimp')
60 cd "$srcdir/$pkgbase-$pkgver"
61 install -D -m755 src/xsane-gimp "${pkgdir}/usr/bin/xsane-gimp"
63 ## For making Gimp Plugin available
64 mkdir -p "$pkgdir/usr/lib/gimp/2.0/plug-ins"
65 ln -sf /usr/bin/xsane-gimp "$pkgdir"/usr/lib/gimp/2.0/plug-ins/xsane
66 #cd "$pkgdir/usr/lib/gimp/2.0/plug-ins/"
67 #/bin/ln -s ../../../../bin/xsane-gimp xsane
69 # http://cvs.fedoraproject.org/viewvc/rpms/xsane/devel/xsane.spec?revision=1.80&view=markup
70 # when makepkg will allow splitted pkg install file support we might change add a xsane-gimp.install file with the commands that are used by fedora,
71 # gentoo has something similar
73 #107 if [ -x "%{_sbindir}/gimp-plugin-mgr" ]; then
74 #108 %{_sbindir}/gimp-plugin-mgr --install xsane
78 #112 if [ $1 = 0 ]; then
79 #113 if [ -x "%{_sbindir}/gimp-plugin-mgr" ]; then
80 #114 %{_sbindir}/gimp-plugin-mgr --uninstall xsane