summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 68be23d3657f2e7d985f3c9c1ccb2ba67c431c42 (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
# Maintainer: Benjamin Chr├ętien <chretien+aur [at] lirmm [dot] fr>

pkgname=libdecodeqr-git
_gitname=libdecodeqr
pkgver=0.9.4.rbbba977
pkgrel=2
pkgdesc="A C/C++ library for decoding QR code 2D barcodes"
arch=('i686' 'x86_64')
url="https://github.com/josephholsten/libdecodeqr"
license=('LGPL2')
depends=('opencv')
optdepends=()
makedepends=('git')
provides=('libdecodeqr')
conflicts=('libdecodeqr')
source=("git+https://github.com/josephholsten/libdecodeqr.git"
        "automake.patch")
sha256sums=('SKIP'
            'a087f21fe3cf7bccf9773afc54537a27b0cb94eda3fb81836b368bfb81120019')
install="${_gitname}.install"

pkgver() {
  cd "$srcdir/$_gitname"
  _revision=$(git rev-parse --short HEAD)
  _major_version=$(sed -ne "s/^#define LIBDECODEQR_VERSION_MAJOR \([0-9]\+\)/\1/p" libdecodeqr/version.h)
  _minor_version=$(sed -ne "s/^#define LIBDECODEQR_VERSION_MINOR \([0-9]\+\)/\1/p" libdecodeqr/version.h)
  _patch_version=$(sed -ne "s/^#define LIBDECODEQR_VERSION_TEENY \([0-9]\+\)/\1/p" libdecodeqr/version.h)
  echo ${_major_version}.${_minor_version}.${_patch_version}.r${_revision}
}

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

  msg "Patching automake bug..."
  git apply "$srcdir/automake.patch"

  autoreconf -i
  ./configure --prefix=/usr
}

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

  make
}

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

  make install DESTDIR="$pkgdir"
}