void-packages/srcpkgs/amdvlk/template
2019-06-11 13:21:50 +02:00

76 lines
3 KiB
Bash

# Template file for 'amdvlk'
pkgname=amdvlk
version=2019.Q2.5
revision=1
_llpc_commit=ddb909580e9996356c3bbe23bc1b14c44987eb4c
_xgl_commit=96d84068b622b2c3ce8cf9aa8ff597260aa5ad3f
_pal_commit=135258ac31901e1293fea5e2f599659ee438ba1f
_llvm_commit=b9910c8bfcccc63c07c959963fa567120d11f024
_wsa_commit=f558403d3292039de4d17334e562bda58abfc72c
_spvgen_commit=64013f150c2d41965a3d36fa159b55fba52b727a
archs="i686* x86_64*"
create_wrksrc=yes
build_wrksrc="xgl"
build_style=cmake
configure_args="-DBUILD_WAYLAND_SUPPORT=ON -DBUILD_WSA=ON"
hostmakedepends="pkg-config python3 perl"
makedepends="libxml2-devel xorg-server-devel libXrandr-devel"
depends="vulkan-loader"
short_desc="AMD Open Source Driver For Vulkan"
maintainer="John <johnz@posteo.net>"
license="MIT"
homepage="https://github.com/GPUOpen-Drivers/AMDVLK"
distfiles="https://github.com/GPUOpen-Drivers/AMDVLK/archive/v-${version}.tar.gz
https://github.com/GPUOpen-Drivers/llpc/archive/${_llpc_commit}.tar.gz
https://github.com/GPUOpen-Drivers/xgl/archive/${_xgl_commit}.tar.gz
https://github.com/GPUOpen-Drivers/pal/archive/${_pal_commit}.tar.gz
https://github.com/GPUOpen-Drivers/llvm/archive/${_llvm_commit}.tar.gz
https://github.com/GPUOpen-Drivers/wsa/archive/${_wsa_commit}.tar.gz
https://github.com/GPUOpen-Drivers/spvgen/archive/${_spvgen_commit}.tar.gz"
checksum="4017d5ef9deacbbe0d1d952ce9f79242212f1ac94c39ed4daf267cb703618974
32e6f6e330a7ff82bd7840e43a81d7950878c9eae93f0e1e376c37c27426c244
49f6cfd63f89db1a2cbf1bb5be882919af45443e057efb1715785e0983b3cd32
dfebaf29c6dedb9c6fcbe4d02407a4267703aa7ae570d105ef146f2df455486f
8b0052682f0665e18ea3f4b7a9b533dce95949c366c0d82a9e388056706383ae
b23e9453fa7b14bb13157fb645936ec74b18b12cdef301758452a92b23f27705
01b156285b25c4f84fc098f334b3959d8fd1d7f77589618449288506eadb92d4"
nocross=yes
case $XBPS_TARGET_MACHINE in
*-musl) makedepends+=" rand48_r-devel"
esac
post_extract() {
mv ${wrksrc}/AMDVLK-v-${version} ${wrksrc}/AMDVLK
mv ${wrksrc}/xgl-${_xgl_commit} ${wrksrc}/xgl
mv ${wrksrc}/pal-${_pal_commit} ${wrksrc}/pal
mv ${wrksrc}/llpc-${_llpc_commit} ${wrksrc}/llpc
mv ${wrksrc}/llvm-${_llvm_commit} ${wrksrc}/llvm
mv ${wrksrc}/wsa-${_wsa_commit} ${wrksrc}/wsa
mv ${wrksrc}/spvgen-${_spvgen_commit} ${wrksrc}/spvgen
}
pre_configure() {
case "$XBPS_TARGET_MACHINE" in
i686*) _arch="X86";;
x86_64*) _arch="X86";;
esac
configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}"
}
do_install() {
case $XBPS_TARGET_MACHINE in
i686*|mips*|arm*|ppc|ppc-musl)
vinstall build/icd/amdvlk32.so 644 usr/lib/
vinstall ${wrksrc}/AMDVLK/json/Redhat/amd_icd32.json 644 usr/share/vulkan/icd.d/
;;
*)
vinstall build/icd/amdvlk64.so 644 usr/lib/
vinstall ${wrksrc}/AMDVLK/json/Redhat/amd_icd64.json 644 usr/share/vulkan/icd.d/
vsed -i ${DESTDIR}/usr/share/vulkan/icd.d/amd_icd64.json -e 's#/usr/lib64/#/usr/lib/#g'
;;
esac
vinstall build/wsa/wayland/libamdgpu_wsa_wayland.so 644 usr/lib/
vlicense ${wrksrc}/AMDVLK/LICENSE.txt
}