summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8d454217a2b63edc5676204c5fd6b402d692a90b (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
102
103
104
#Maintainer: archdevlab <https://github.com/archdevlab>
#Credits: Laurent Carlier <lordheavym@gmail.com>

pkgbase=vulkan-lunarg-tools-git
pkgname=(vulkan-extra-tools-git vulkan-extra-layers-git)
pkgver=1.3.292.r12147.ga12be9485
_major=1.3
pkgrel=1
arch=(x86_64)
url='https://github.com/LunarG/VulkanTools.git'
license=(custom)
depends=()
makedepends=(cmake git ninja make python libx11 libxrandr wayland qt5-svg qt5-webengine)
source=(git+https://github.com/LunarG/VulkanTools.git)

_install(){
  local src f dir
  for src; do
    f="${src#fakeinstall/}"
    dir="${pkgdir}/${f%/*}"
    install -m755 -d "${dir}"
    mv -v "${src}" "${dir}/"
  done
}

pkgver(){
  cd "${srcdir}"/VulkanTools
  #git describe --long --tags --abbrev=7 --match='v*' | sed 's/^vulkan-sdk-//;s/\([^-]*-g\)/r\1/;s/-/./g'
  #git describe --long --tags --abbrev=7 | sed -r 's,^[^0-9]+,,;s,([0-9]*-g),r\1,;s,[-_],.,g'
  #git describe --long --tags --abbrev=7 | sed -r 's,^[^0-9]+,,;s,([0-9]*-g),r\1,;s,[-_],.,g' | sed 's/.0//g'
  echo "${_major}".$(sed -n 9p scripts/known_good.json | sed 's/[^0-9]*//g' | cut -c 3-).r$(git rev-list --count HEAD).g$(git rev-parse --short --abbrev=7 HEAD)
}

build(){
  rm -rf "${srcdir}"/{build,fakeinstall}

  "${srcdir}"/VulkanTools/scripts/update_deps.py --config release --generator Ninja

  cmake -C helper.cmake -B "${srcdir}"/build -S "${srcdir}"/VulkanTools \
  -G Ninja \
  -D CMAKE_BUILD_TYPE=Release \
  -D CMAKE_INSTALL_PREFIX=/usr \
  -D CMAKE_INSTALL_BINDIR=bin \
  -D CMAKE_INSTALL_LIBDIR=lib \
  -D CMAKE_INSTALL_INCLUDEDIR=include \
  -D CMAKE_INSTALL_SYSCONFDIR=/etc \
  -D CMAKE_INSTALL_DATADIR=share \
  -D CMAKE_SKIP_RPATH=True \
  -D BUILD_WSI_XCB_SUPPORT=ON \
  -D BUILD_WSI_XLIB_SUPPORT=ON \
  -D BUILD_WSI_WAYLAND_SUPPORT=ON \
  -D BUILD_TESTS=OFF \
  -D BUILD_VIA=OFF \
  -Wno-dev

  ninja -j$(nproc) -C "${srcdir}"/build

  DESTDIR="${srcdir}"/fakeinstall ninja -j$(nproc) -C "${srcdir}"/build install
}

package_vulkan-extra-tools-git(){
  pkgdesc='Vulkan lunarg tools (git version)'
  depends=(vulkan-validation-layers qt5-svg qt5-webengine)
  conflicts=('vulkan-trace<1.2.148.1')
  conflicts+=(vulkan-extra-tools)
  provides=(vulkan-extra-tools)

  _install fakeinstall/usr/bin/*

  # install doc
  install -dm755 "${pkgdir}"/usr/share/doc/"${pkgname}"/
  install -m644 "${srcdir}"/VulkanTools/vkconfig/*.md "${pkgdir}"/usr/share/doc/"${pkgname}"/

  # install license
  install -dm755 "${pkgdir}"/usr/share/licenses/"${pkgname}"
  install -m644 "${srcdir}"/VulkanTools/LICENSE.txt "${pkgdir}"/usr/share/licenses/"${pkgname}"/
}

package_vulkan-extra-layers-git(){
  pkgdesc='Extra layers for Vulkan development (git version)'
  depends=(vulkan-validation-layers)
  conflicts=(vulkan-extra-layers)
  provides=(vulkan-extra-layers)

  _install fakeinstall/usr/lib/libVkLayer_api_dump.so
  _install fakeinstall/usr/lib/libVkLayer_monitor.so
  _install fakeinstall/usr/lib/libVkLayer_screenshot.so

  _install fakeinstall/usr/share/vulkan/explicit_layer.d/VkLayer_api_dump.json
  _install fakeinstall/usr/share/vulkan/explicit_layer.d/VkLayer_monitor.json
  _install fakeinstall/usr/share/vulkan/explicit_layer.d/VkLayer_screenshot.json

  # install doc
  install -dm755 "${pkgdir}"/usr/share/doc/"${pkgname}"/
  install -m644 "${srcdir}"/VulkanTools/layersvt/README.md "${pkgdir}"/usr/share/doc/"${pkgname}"/

  # install license
  install -dm755 "${pkgdir}"/usr/share/licenses/"${pkgname}"
  install -m644 "${srcdir}"/VulkanTools/LICENSE.txt "${pkgdir}"/usr/share/licenses/"${pkgname}"/
}

sha256sums=(SKIP)

# vim:set ts=8 sts=2 sw=2 et: