archrelease: copy trunk to extra-x86_64
[arch-packages.git] / amdvlk / repos / extra-x86_64 / PKGBUILD
blob4d580a3840438ad67d8e3750e2d47c8cb6f9ade5
1 # Maintainer: Laurent Carlier <lordheavym@gmail.com>
2 # Contributor: lod <aur@cyber-anlage.de>
4 pkgname=amdvlk
5 pkgver=2023.Q2.1
6 pkgrel=1
7 pkgdesc="AMD's standalone Vulkan driver"
8 arch=(x86_64)
9 url="https://github.com/GPUOpen-Drivers"
10 license=('MIT')
11 provides=('vulkan-driver')
12 makedepends=('perl-xml-xpath' 'python' 'wayland' 'libxrandr' 'xorg-server-devel' 'directx-shader-compiler' 'glslang'
13              'cmake' 'ninja' 'git')
14 options=('!lto')
15 source=("https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-${pkgver}.tar.gz")
16 sha256sums=('14ebcd71f8f2be44244abd2fe7ae9446b522105b88583b13ed763a41efb6cb14')
17             
18 prepare() {
19   local nrepos path name revision
20   
21   nrepos=$(xpath -q -e //project AMDVLK-v-${pkgver}/default.xml | wc -l)
22   
23   while (($nrepos>0))
24   do
25     path=$(xpath -q -e //project[$nrepos]/@path AMDVLK-v-${pkgver}/default.xml | sed 's/ path="drivers\/\(.*\)"/\1/g')
26     name=$(xpath -q -e //project[$nrepos]/@name AMDVLK-v-${pkgver}/default.xml | sed 's/ name="\(.*\)"/\1/g')
27     revision=$(xpath -q -e //project[$nrepos]/@revision AMDVLK-v-${pkgver}/default.xml | sed 's/ revision="\(.*\)"/\1/g')
28     git clone --recurse-submodules https://github.com/GPUOpen-Drivers/$name $path
29       pushd $path
30         git checkout $revision
31         git submodule update
32       popd
33     (( nrepos-- ))
34   done
37 build() {
38   cd ${srcdir}/xgl
39   cmake -H. -Bbuilds/Release64 \
40     -DCMAKE_BUILD_TYPE=Release \
41     -DBUILD_WAYLAND_SUPPORT=On \
42     -G Ninja
43     
44   ninja -C builds/Release64
47 package() {
48   install -m755 -d "${pkgdir}"/usr/lib
49   install -m755 -d "${pkgdir}"/usr/share/vulkan/icd.d
50   install -m755 -d "${pkgdir}"/usr/share/vulkan/implicit_layer.d
51   install -m755 -d "${pkgdir}"/usr/share/licenses/${pkgname}
53   install xgl/builds/Release64/icd/amdvlk64.so "${pkgdir}"/usr/lib/
54   install xgl/builds/Release64/icd/amd_icd64.json "${pkgdir}"/usr/share/vulkan/icd.d/
55   install xgl/builds/Release64/icd/amd_icd64.json "${pkgdir}"/usr/share/vulkan/implicit_layer.d/
56   install AMDVLK-v-${pkgver}/LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/
57   
58   sed -i "s#/lib64#/lib#g" "${pkgdir}"/usr/share/vulkan/icd.d/amd_icd64.json
59   sed -i "s#/lib64#/lib#g" "${pkgdir}"/usr/share/vulkan/implicit_layer.d/amd_icd64.json