summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 52f232fbab7b9b9d541424e0f49cb2990cc4c532 (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
# Maintainer: Eric Engestrom <aur [at] engestrom [dot] ch>

pkgname=egl-man-pages
pkgver=20220920.r252
pkgrel=1
pkgdesc="EGL Man Pages"
arch=('any')
url="http://www.opengl.org/wiki/Getting_started/XML_Toolchain_and_Man_Pages"
license=('custom')
makedepends=('libxslt' 'docbook-xsl' 'git')
source=('git+https://github.com/KhronosGroup/EGL-Registry')
md5sums=('SKIP')

pkgver() {
  cd "$srcdir"/EGL-Registry/sdk/docs/man

  printf '%s.r%d' \
    $(date -d"$(git log -1 --format=%aD .)" +%Y%m%d) \
    $(git rev-list --count $(git log -1 --format=%h .))
}

build() {
  for file in "$srcdir"/EGL-Registry/sdk/docs/man/egl*.xml; do
    xsltproc --noout --nonet --xinclude \
      --stringparam funcsynopsis.style ansi \
      --stringparam man.authors.section.enabled 0 \
      --stringparam man.output.quietly 1 \
      /usr/share/xml/docbook/xsl-stylesheets-*/manpages/docbook.xsl \
      "$file"
  done

  # Output is corrupted because the xml indentation is kept
  for file in *.3G; do
    sed 's/^ \+//' -i "$file"
  done
}

package() {
  install -d "$pkgdir"/usr/share/man/man3
  install -m644 "$srcdir"/*.3G "$pkgdir"/usr/share/man/man3/

  install -D -m644 "$srcdir"/EGL-Registry/sdk/docs/man/copyright.xml \
    "$pkgdir/usr/share/licenses/$pkgname/copyright.xml"
}