summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: de4aa5ae743a7d9cc58cf66de5e7dc41c5a7df8f (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
# Maintainer: Yurii Kolesnykov
# Based on [extra]'s xorgproto by AndyRTR <andyrtr@archlinux.org>

_pkgname=xorgproto
pkgname=$_pkgname-git
pkgver=2020.1.16.r2653.ge4d9ffd
pkgrel=1
pkgdesc="Combined X.Org X11 Protocol headers (git version)"
arch=('any')
url="https://xorg.freedesktop.org/"
license=('custom')
makedepends=('xorg-util-macros' 'meson' 'git')
provides=('xorgproto')
conflicts=(${provides[@]})
source=("$pkgname::git://anongit.freedesktop.org/xorg/proto/$_pkgname")
sha512sums=('SKIP')

pkgver() {
  cd "$pkgname"
  echo $(git describe --long | cut -d "-" -f2-3 | tr - .).r$(git rev-list HEAD --count).$(git describe --long | cut -d "-" -f4)
}

prepare() {
  rm -rf build
  mkdir build
}

build() {
  arch-meson "$pkgname" build
  ninja -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" ninja -C build install

  # missing docs
  install -m755 -d "${pkgdir}/usr/share/doc/${pkgname}"
  install -m644 "$pkgname"/*.txt "${pkgdir}/usr/share/doc/${pkgname}/"
  install -m644 "$pkgname"/PM_spec "${pkgdir}/usr/share/doc/${pkgname}/"
  rm "${pkgdir}"/usr/share/doc/${pkgname}/meson_options.txt

  # licenses
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 "${pkgname}"/COPYING* "${pkgdir}/usr/share/licenses/${pkgname}/"
  # remove licences of legacy stuff we don't ship anymore
  rm -f "${pkgdir}"/usr/share/licenses/${pkgname}/COPYING-{evieproto,fontcacheproto,lg3dproto,printproto,xcalibrateproto,xf86rushproto}

  # cleanup
  rm -f "${pkgdir}"/usr/include/X11/extensions/apple*
  rm -f "${pkgdir}"/usr/share/licenses/${pkgname}/COPYING-{apple,windows}wmproto
  rm -f "${pkgdir}"/usr/share/pkgconfig/applewmproto.pc
}