summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 77477efe7384c83620544e65769ee7e7f6b21b5c (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=liblouis-git
pkgver=3.25.0.r18.g577648e5
pkgrel=1
pkgdesc="An open-source braille translator, back-translator and formatter"
arch=('i686' 'x86_64')
url="https://liblouis.io/"
license=('LGPL')
depends=('glibc')
makedepends=('git' 'help2man' 'perl' 'python-build' 'python-installer' 'python-wheel')
provides=("liblouis=$pkgver")
conflicts=('liblouis')
options=('staticlibs')
source=("git+https://github.com/liblouis/liblouis.git")
sha256sums=('SKIP')


pkgver() {
  cd "liblouis"

  _tag=$(git tag -l --sort -v:refname | sed '/rc[0-9]*/d' | head -n1)
  _rev=$(git rev-list --count $_tag..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//'
}

build() {
  cd "liblouis"

  ./autogen.sh
  ./configure \
    --prefix="/usr" \
    --enable-ucs4
  make

  cd "python"
  python \
    -m build \
    --wheel \
    --no-isolation
}

check() {
  cd "liblouis"

  make check
}

package() {
  cd "liblouis"

  make DESTDIR="$pkgdir" install

  cd "python"
  python \
    -m installer \
    --destdir="$pkgdir" \
    dist/*.whl
}