blob: d67903b6f1310ab0f99686c4a5885413c13cd9d5 (
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
105
106
|
# Maintainer: Christoph Haag <haagch@studi.informatik.uni-stuttgart.de>
# Maintainer: Laurent Carlier <lordheavym@gmail.com>
# Maintainer: AdriĆ Cereto i MassaguĆ© <ssorgatem at gmail.com>
pkgname=amdvlk-git
pkgver=v.v.2019.Q3.5.r1.a14d42d
pkgrel=1
pkgdesc="AMD's standalone Vulkan driver"
arch=(x86_64)
url="https://github.com/GPUOpen-Drivers"
license=('MIT')
depends=('vulkan-icd-loader')
provides=('vulkan-amdvlk' 'vulkan-driver')
conflicts=('vulkan-amdvlk')
makedepends=('dri2proto' 'xorg-server-devel' 'libxrandr' 'cmake' 'python' 'libxml2' 'wayland' 'libdrm' 'git' 'ninja' 'repo')
source=('git+https://github.com/GPUOpen-Drivers/wsa.git#branch=master')
sha512sums=('SKIP')
pkgver() {
pushd drivers/AMDVLK > /dev/null
AMDVLK_VER=$(printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')")
popd > /dev/null
if [ -z "$AMDVLK_VER" ]; then
pushd drivers/xgl > /dev/null
XGL_VER=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")
popd > /dev/null
else
XGL_VER=$AMDVLK_VER
fi
#PAL_VER=$(cd pal; printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")
echo "$XGL_VER"
}
prepare() {
cd "$srcdir"
repo init -u 'https://github.com/GPUOpen-Drivers/AMDVLK.git' -b master
repo sync
# fix building with commit f609020
# sed -i "s/<drm/<libdrm/g" pal/src/core/os/lnx/display/displayWindowSystem.h
# pushd "$srcdir/pal"
# patch -p1 < ../0001-pal-clang.patch
# popd
# pushd "$srcdir/xgl"
# patch -p1 < ../0002-xgl-clang.patch
# popd
# Don't turn Werror on for people will build with more recent compilers than you have. Just don't.
for i in drivers/pal/shared/gpuopen/cmake/AMD.cmake
do
sed -i "s/-Werror//g" "$srcdir"/$i
done
msg 'No patches to apply...'
}
build() {
# /usr/lib/amdvlk64.so: undefined symbol: _ZN3Pal5Linux19DisplayWindowSystem30DeterminePresentationSupportedEPNS0_6DeviceEPvl
# msg "Changing flags..."
# msg2 "before: CFLAGS=$CFLAGS"
export CFLAGS=${CFLAGS/-fno-plt}
# msg2 "after: CFLAGS=$CFLAGS"
# msg2 "before: CXXFLAGS=$CXXFLAGS"
export CXXFLAGS="${CXXFLAGS/-fno-plt}"
# msg2 "after: CXXFLAGS=${CXXFLAGS}"
# msg2 "before: LDFLAGS=$LDFLAGS"
export LDFLAGS=${LDFLAGS/,-z,now}
# msg2 "after: LDFLAGS=${LDFLAGS}"
# export CPPFLAGS="$CXXFLAGS"
msg "building xgl..."
pushd drivers/xgl > /dev/null
cmake \
-G Ninja \
-H. \
-B builds/Release64 \
-DBUILD_WAYLAND_SUPPORT=On \
-DCMAKE_BUILD_TYPE=Release
cd builds/Release64
ninja
msg "building xgl finished!"
popd > /dev/null
#msg "building spvgen"
#pushd drivers/spvgen > /dev/null
#cmake \
# -G Ninja \
# -B builds/Release64 \
# -DCMAKE_BUILD_TYPE=Release \
# .
#cd builds/Release64
#ninja
#msg "building spvgen finished!"
}
package() {
install -m755 -d "${pkgdir}"/usr/lib
install -m755 -d "${pkgdir}"/usr/share/licenses/amdvlk-git
install -m755 -d "${pkgdir}"/etc/amd
install -D -t "$pkgdir/usr/lib" drivers/xgl/builds/Release64/icd/amdvlk64.so
install -D -m644 -t "${pkgdir}/usr/share/vulkan/icd.d" drivers/AMDVLK/json/Redhat/amd_icd64.json
install -D -m644 -t "${pkgdir}/usr/share/licenses/amdvlk-git" drivers/AMDVLK/LICENSE.txt
sed -i "s/\/lib64/\/lib/g" "${pkgdir}"/usr/share/vulkan/icd.d/amd_icd64.json
}
|