summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5f0c042acb4ef7ba673bbaf6fa73d2ee45928305 (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
72
73
74
75
76
77
78
79
80
# Maintainer:

_pkgname="epdfview"
pkgname="$_pkgname-git"
pkgver=0.2.0.r28.g6f907bd
pkgrel=1
pkgdesc='Lightweight PDF document viewer'
url='https://github.com/Flow-It/epdfview_old'
arch=('x86_64')
license=('GPL2')

depends=(
  'gtk3'
  'hicolor-icon-theme'
  'poppler-glib'
)
makedepends=(
  'doxygen'
  'git'
  'meson'
  'ninja'
)

options=('!emptydirs')

if [ x"$_pkgname" != x"$pkgname" ] ; then
  provides=("$_pkgname")
  conflicts=("$_pkgname")
fi

_pkgsrc="$_pkgname"
source=(
  "$_pkgname"::"git+$url"
)
sha256sums=(
  'SKIP'
)

pkgver() {
  cd "$srcdir/$_pkgsrc"

  _regex="^\s+version:\s+'([0-9]+\\.[0-9]+\\.[0-9]+)',\$"
  _file='meson.build'

  _line=$(
    grep -E "$_regex" "$_file" | head -1
  )
  _version=$(
    printf '%s' "$_line" | sed -E "s@$_regex@\1@"
  )
  _commit=$(
    git log -G "$_line" -1 --pretty=oneline --no-color | sed 's@\ .*$@@'
  )
  _revision=$(
    git rev-list --count $_commit..HEAD
  )
  _hash=$(
    git rev-parse --short HEAD
  )

  printf '%s.r%s.g%s' \
    "$_version" \
    "$_revision" \
    "$_hash"
}

build() {
  local _meson_options=(
    --prefix=/usr
    --buildtype=plain
  )

  arch-meson "$_pkgsrc" build "${_meson_options[@]}"

  meson compile -C build
}

package() {
  meson install -C build --destdir "$pkgdir"
}