summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 28636fbc4c4c0e028654de8bc8eede0b5dc9fe67 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Maintainer: Christoph Haag <christoph.haag@collabora.com>

pkgname=("openxr-loader-git" "openxr-headers-git" "openxr-layers-git" "openxr-utils-git" "openxr-git")
_dirname="openxr-loader"
pkgver=1.0.12.r22.g06b5b7f
pkgrel=1
arch=('i686' 'x86_64')
url='https://github.com/KhronosGroup/OpenXR-SDK-Source'
depends=()
makedepends=('cmake' 'git' 'vulkan-headers' 'libx11' 'libxxf86vm' 'libxrandr' 'python' 'vulkan-icd-loader')
license=('apache')
source=("$_dirname::git+https://github.com/KhronosGroup/OpenXR-SDK-Source.git#branch=master")
md5sums=('SKIP')

#options=('debug' '!strip')

prepare() {
  cd "$_dirname"
}

pkgver() {
  cd "$_dirname"
  #printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  git describe --long --tags | sed 's/^release-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  mkdir -p "$_dirname"-build
  cd "$_dirname"-build
  cmake \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTS=ON \
    -DPRESENTATION_BACKEND=xlib \
    -DDYNAMIC_LOADER=ON \
    ../"$_dirname"
  make
}

package_openxr-loader-git() {
  provides=("openxr-loader")
  pkgdesc='OpenXR loader'
  depends=("jsoncpp" "libx11")

  cd "$_dirname"-build

  make DESTDIR="$pkgdir" install
  rm -rf "$pkgdir"/usr/include/
  rm -rf "$pkgdir"/usr/bin/
  rm -rf "$pkgdir"/usr/share/openxr
  rm -rf "$pkgdir"/usr/lib/*ApiLayer*
  rm -rf "$pkgdir"/usr/share/man/
}

package_openxr-headers-git() {
  provides=("openxr-headers")
  pkgdesc='OpenXR headers'

  cd "$_dirname"-build

  make DESTDIR="$pkgdir" install
  rm -rf "$pkgdir"/usr/lib/
  rm -rf "$pkgdir"/usr/share/
  rm -rf "$pkgdir"/usr/bin/
}

package_openxr-layers-git() {
  depends=("openxr-loader")
  provides=("openxr-layers")
  pkgdesc='OpenXR Layers, including XR_APILAYER_LUNARG_core_validation'

  cd "$_dirname"-build

  make DESTDIR="$pkgdir" install
  rm -rf "$pkgdir"/usr/include
  rm -rf "$pkgdir"/usr/share/doc
  rm -rf "$pkgdir"/usr/lib/pkgconfig
  rm -rf "$pkgdir"/usr/lib/cmake
  rm -rf "$pkgdir"/usr/bin/
  rm -rf "$pkgdir"/usr/lib/*loader*
}

package_openxr-utils-git() {
  depends=("openxr-loader" "libglvnd" "libxxf86vm" "vulkan-icd-loader" "libx11")
  provides=("openxr-utils")
  pkgdesc='OpenXR Utils: hello_xr, runtime_list'

  cd "$_dirname"-build

  make DESTDIR="$pkgdir" install
  rm -rf "$pkgdir"/usr/include
  rm -rf "$pkgdir"/usr/share/
  rm -rf "$pkgdir"/usr/lib/
}

package_openxr-git() {
  provides=("openxr")
  depends=("openxr-loader-git" "openxr-headers-git" "openxr-utils-git" "openxr-layers-git")
}