-
Notifications
You must be signed in to change notification settings - Fork 2
/
PKGBUILD
130 lines (108 loc) · 4.82 KB
/
PKGBUILD
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Initially based on Archlinux amdvlk PKGBUILD - https://www.archlinux.org/packages/extra/x86_64/amdvlk/
### Maintainer: Laurent Carlier <[email protected]>
### Contributor: lod <[email protected]>
# Modified for multilib, opt path and a couple tweaks by: Tk-Glitch <ti3nou at gmail dot com>
plain ' .---.` `.---.'
plain ' `/syhhhyso- -osyhhhys/`'
plain ' .syNMdhNNhss/``.---.``/sshNNhdMNys.'
plain ' +sdMh.`+MNsssssssssssssssNM+`.hMds+'
plain ' :syNNdhNNhssssssssssssssshNNhdNNys:'
plain ' /ssyhhhysssssssssssssssssyhhhyss/'
plain ' .ossssssssssssssssssssssssssssso.'
plain ' :sssssssssssssssssssssssssssssssss:'
plain ' /sssssssssssssssssssssssssssssssssss/'
plain ' :sssssssssssssoosssssssoosssssssssssss:'
plain ' osssssssssssssoosssssssoossssssssssssso'
plain ' osssssssssssyyyyhhhhhhhyyyyssssssssssso'
plain ' /yyyyyyhhdmmmmNNNNNNNNNNNmmmmdhhyyyyyy/'
plain ' smmmNNNNNNNNNNNNNNNNNNNNNNNNNNNNNmmms'
plain ' /dNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNd/'
plain ' `:sdNNNNNNNNNNNNNNNNNNNNNNNNNds:`'
plain ' `-+shdNNNNNNNNNNNNNNNdhs+-`'
plain ' `.-:///////:-.`'
pkgname=amdvlk-tkg
pkgver=2024.Q4.2
pkgrel=1
pkgdesc="AMD's standalone Vulkan driver"
arch=(x86_64)
url="https://github.com/GPUOpen-Drivers"
license=('MIT')
provides=('vulkan-driver' 'lib32-vulkan-driver' 'amdvlk' 'lib32-amdvlk')
makedepends=('directx-shader-compiler' 'perl-xml-xpath' 'python' 'wayland' 'lib32-wayland' 'libxrandr' 'lib32-libxrandr' 'xorg-server-devel' 'cmake' 'ninja' 'git' 'glslang' 'ocaml-stdlib-shims' 'clang' 'lib32-clang' 'python-jinja' 'python-ruamel-yaml')
options=('!lto')
source=("https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-${pkgver}.tar.gz")
sha256sums=('c2658c73465de8fc7f44edcfbe51b2ca76c50f0306cf90916627031238f3d01d')
# Workaround for chroot
if [[ "$PATH" != *"/bin/vendor_perl"* ]];then
export PATH="$PATH:/usr/bin/vendor_perl"
fi
prepare() {
local nrepos path name revision
nrepos=$(xpath -q -e //project AMDVLK-v-${pkgver}/default.xml | wc -l)
while (($nrepos>0))
do
path=$(xpath -q -e //project[$nrepos]/@path AMDVLK-v-${pkgver}/default.xml | sed 's/ path="drivers\/\(.*\)"/\1/g')
name=$(xpath -q -e //project[$nrepos]/@name AMDVLK-v-${pkgver}/default.xml | sed 's/ name="\(.*\)"/\1/g')
revision=$(xpath -q -e //project[$nrepos]/@revision AMDVLK-v-${pkgver}/default.xml | sed 's/ revision="\(.*\)"/\1/g')
git clone --recurse-submodules https://github.com/GPUOpen-Drivers/$name $path || true
pushd $path
git pull https://github.com/GPUOpen-Drivers/$name
git submodule update
git checkout $revision
popd
(( nrepos-- ))
done
if [ -e ./ci ]; then
( cd ${srcdir}/llvm-project && rm -rf .git )
fi
}
build() {
cd ${srcdir}/xgl
cmake -H. -Bbuilds/Release64 \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_WAYLAND_SUPPORT=On \
-G Ninja
ninja -C builds/Release64
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
cd ${srcdir}/xgl
cmake -H. -Bbuilds/Release \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS=-m32 \
-DCMAKE_CXX_FLAGS=-m32 \
-DLLVM_TARGET_ARCH:STRING=i686 \
-DLLVM_DEFAULT_TARGET_TRIPLE="i686-pc-linux-gnu" \
-DBUILD_WAYLAND_SUPPORT=On \
-G Ninja
ninja -C builds/Release
}
package() {
install -m755 -d "${pkgdir}"/opt/amdvlk/lib/x86_64-linux-gnu
install -m755 -d "${pkgdir}"/opt/amdvlk/lib/i386-linux-gnu
install -m755 -d "${pkgdir}"/opt/amdvlk/etc/vulkan/icd.d
install -m755 -d "${pkgdir}"/usr/share/licenses/${pkgname}
install xgl/builds/Release64/icd/amdvlk64.so "${pkgdir}"/opt/amdvlk/lib/x86_64-linux-gnu/
install xgl/builds/Release/icd/amdvlk32.so "${pkgdir}"/opt/amdvlk/lib/i386-linux-gnu/
install xgl/builds/Release64/icd/amd_icd64.json "${pkgdir}"/opt/amdvlk/etc/vulkan/icd.d/
install xgl/builds/Release/icd/amd_icd32.json "${pkgdir}"/opt/amdvlk/etc/vulkan/icd.d/
install AMDVLK-v-${pkgver}/LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/
sed -i "s|/usr/lib/amdvlk64.so|/opt/amdvlk/lib/x86_64-linux-gnu/amdvlk64.so|g" "${pkgdir}"/opt/amdvlk/etc/vulkan/icd.d/amd_icd64.json
sed -i "s|/usr/lib/amdvlk32.so|/opt/amdvlk/lib/i386-linux-gnu/amdvlk32.so|g" "${pkgdir}"/opt/amdvlk/etc/vulkan/icd.d/amd_icd32.json
msg2 "#################################################################"
msg2 ""
msg2 "64-bit loader in /opt/amdvlk/etc/vulkan/icd.d/amd_icd64.json"
msg2 "32-bit loader in /opt/amdvlk/etc/vulkan/icd.d/amd_icd32.json"
msg2 ""
msg2 "64-bit lib in /opt/amdvlk/lib/x86_64-linux-gnu/amdvlk64.so"
msg2 "32-bit lib in /opt/amdvlk/lib/i386-linux-gnu/amdvlk32.so"
msg2 ""
msg2 "changelog and copyright in /usr/share/licenses/${pkgname}"
msg2 ""
msg2 "#################################################################"
}
function exit_cleanup {
# Sanitization
rm -rf "$srcdir"
msg2 'exit cleanup done'
remove_deps
}
trap exit_cleanup EXIT