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

pkgbase=vulkan-extensionlayer-git
pkgname=({,lib32-}vulkan-extensionlayer-git)
pkgver=r31.8a457f8552
pkgrel=1
pkgdesc="Layer providing Vulkan features when native support is unavailable"
arch=(x86_64)
url="https://github.com/KhronosGroup/Vulkan-ExtensionLayer"
license=(Apache)
source=("git+$url")
sha256sums=('SKIP')
depends=(vulkan-icd-loader)
makedepends=(cmake ninja vulkan-headers)
checkdepends=()

pkgver() {
  cd Vulkan-ExtensionLayer
  printf 'r%d.%s' \
    $(git rev-list --count HEAD) \
    $(git rev-parse HEAD | head -c10)
}

build_vulkan-extensionlayer-git() {
  cmake \
    -S Vulkan-ExtensionLayer -B build64 \
    -G Ninja \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D BUILD_LAYERS=ON

  ninja -C build64
}

build_lib32-vulkan-extensionlayer-git() {
  CC='gcc -m32' \
  CXX='g++ -m32' \
  PKG_CONFIG_PATH='/usr/lib32/pkgconfig' \
  cmake \
    -S Vulkan-ExtensionLayer -B build32 \
    -G Ninja \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_INSTALL_LIBDIR=lib32 \
    -D BUILD_LAYERS=ON

  ninja -C build32
}

package_vulkan-extensionlayer-git() {
  provides=(vulkan-extensionlayer)
  conflicts=(vulkan-extensionlayer)

  DESTDIR="$pkgdir" ninja -C build64 install
}

package_lib32-vulkan-extensionlayer-git() {
  pkgdesc+=" (library for 32-bit applications)"
  provides=(lib32-vulkan-extensionlayer)
  conflicts=(lib32-vulkan-extensionlayer)
  depends+=(vulkan-extensionlayer)

  DESTDIR="$pkgdir" ninja -C build32 install

  # Delete conflicting file provided by vulkan-extensionlayer
  rm "$pkgdir"/usr/share/vulkan/explicit_layer.d/VkLayer_khronos_timeline_semaphore.json
  rmdir "$pkgdir"/usr/share/vulkan/explicit_layer.d/
  rmdir "$pkgdir"/usr/share/vulkan/
  rmdir "$pkgdir"/usr/share/
}