summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8a07c89c7c3f8699b2ebd57337edd1db5a1651d6 (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
# Maintainer: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
 
_realname='gulkan'
pkgname="$_realname-git"
pkgver=0.13.99.140.9684b5e
pkgrel=1
pkgdesc='A GLib library for Vulkan abstraction.'
arch=('i686' 'x86_64')
url='https://gitlab.freedesktop.org/xrdesktop/gulkan'
depends=('gdk-pixbuf2' 'vulkan-icd-loader' 'graphene' 'cairo')
provides=("$_realname="$pkgver)
conflicts=("$_realname")
makedepends=('meson' 'git' 'glslang' 'vulkan-headers' 'gtk-doc')
license=('MIT')

source=('git+https://gitlab.freedesktop.org/xrdesktop/gulkan.git')
md5sums=('SKIP')

ver() {
  PREFIX="project('gulkan', 'c', version: '"
  echo $(grep "$PREFIX" meson.build | sed -e "s/${PREFIX}//" | sed "s/',//")
}

pkgver() {
  cd $_realname
  hash=$(git log --pretty=format:'%h' -n 1)
  revision=$(git rev-list --count HEAD)
  echo $(ver).$revision.$hash
}

build() {
  cd $_realname
  rm -rf build
  meson build --prefix=/usr/ --libdir=lib
  ninja -C build
}

#check() {
#  cd $_realname
#  ninja -C build test
#}

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

  install -Dm644 "${srcdir}"/gulkan/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}