summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6403c73f9caa261f0a8b8debc2160504dbb0ccbe (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
71
# Maintainer: JonnyRobbie

pkgbase=xsane-git
pkgname=('xsane-git' 'xsane-gimp-git')
_gitname=xsane
pkgver=0.999.r324.g88b80bb
pkgrel=1
arch=(x86_64)
url="https://gitlab.com/sane-project/frontend/xsane"
license=('GPLv2')
makedepends=('autoconf' 'automake' 'gtk3' 'lcms2' 'sane' 'zlib' 'libjpeg-turbo' 'gimp')
source=(git+https://gitlab.com/sane-project/frontend/$_gitname.git)
sha512sums=('SKIP')

pkgver() {
  cd "$srcdir/$_gitname"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$srcdir/$_gitname"
  autoreconf -fiv
}

build() {
  cd "$srcdir/$_gitname"

  # make with gimp support
  ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --enable-gimp
  make
  mv src/xsane src/xsane-gimp

  # make without gimp support
  make clean
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --mandir=/usr/share/man \
    --disable-gimp
  make
}

package_xsane-git() {
  pkgdesc="A GTK-based X11 frontend for SANE and plugin for Gimp. Git version."
  depends=('gtk3' 'lcms2' 'sane' 'zlib' 'libjpeg')
  optdepends=('xsane-gimp: for gimp plugin support')
  conflicts=('xsane')
  provides=('xsane')

  cd "$srcdir/$_gitname"
  make DESTDIR=$pkgdir install
}

package_xsane-gimp-git() {
  pkgdesc="XSane Gimp plugin. Git version."
  depends=('xsane' 'gimp')
  conflicts=('xsane-gimp')
  provides=('xsane-gimp')

  cd "$srcdir/$_gitname"
  install -D -m755 src/xsane-gimp "$pkgdir/usr/bin/xsane-gimp"

  ## Link the plugin binary to gimp plug-in directories
  mkdir -p "$pkgdir/usr/lib/gimp/2.0/plug-ins/xsane"
  ln -sf /usr/bin/xsane-gimp "$pkgdir"/usr/lib/gimp/2.0/plug-ins/xsane/xsane
  mkdir -p "$pkgdir/usr/lib/gimp/3.0/plug-ins/xsane"
  ln -sf /usr/bin/xsane-gimp "$pkgdir"/usr/lib/gimp/3.0/plug-ins/xsane/xsane
}