void-packages/srcpkgs/amdvlk/template
2020-06-08 01:11:04 +02:00

89 lines
3.6 KiB
Bash

# Template file for 'amdvlk'
pkgname=amdvlk
version=2020.Q2.4
revision=1
_llpc_commit=9b4d0a4c3e146ea898d4bb3e86fb4170f75c3daa
_xgl_commit=116d28a446eba3a9f8e6f577bab34fc07e090993
_pal_commit=13b6271de2f72f62adf098e681c5000f47db2a6c
_llvm_project_commit=c57487b76215ee74b1038039f47b210a28cad65e
_spvgen_commit=2f679769a8491f423f5cf2f06adfa2870a82935d
_MetroHash_commit=712f76fee75d69b23a1ea8f6465752c3ccaaf9a2
_CWPack_commit=7387247eb9889ddcabbc1053b9c2052e253b088e
archs="i686* x86_64*"
create_wrksrc=yes
build_wrksrc="xgl"
build_style=cmake
configure_args="-DBUILD_WAYLAND_SUPPORT=ON
-DXGL_METROHASH_PATH=../../metrohash
-DXGL_CWPACK_PATH=../../cwpack"
hostmakedepends="pkg-config python3 perl"
makedepends="libxml2-devel xorg-server-devel libXrandr-devel libffi-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-project/archive/${_llvm_project_commit}.tar.gz
https://github.com/GPUOpen-Drivers/spvgen/archive/${_spvgen_commit}.tar.gz
https://github.com/GPUOpen-Drivers/MetroHash/archive/${_MetroHash_commit}.tar.gz
https://github.com/GPUOpen-Drivers/CWPack/archive/${_CWPack_commit}.tar.gz"
checksum="3ca0b3e10233a22bbb9d703d1bde7d24a9046790eb6828140311ae837cc01e1b
d54b0846b733e72c1b0491561469ef35d689b35436ac7a85f5c6452ae15c3a97
ab4b368b4dd8233aa32cf633785c9974a1074ea4db48aca2770ca71d72af9efb
f9fe1955545257153fd47b344e7c2d574a5574a7ef4a5232a60ff15f534bf8e1
5ca5a82e35fddc6c6e7e3f64cb347835322519024cbb93e76e1ec0a0bed0cd6d
268952f9d8032317ed293ed41f344ed5522921a9b3d1cf97b15a0e64b52c28b7
07c7389894a4acd9aff7ddb6d70fc3ea6a4cc10589b69ce92c737487cbe2d37d
186060fbcf87165224ba7df0e1858b66ebc42cf190c481aef1df8d89ebab7abd"
nocross=yes
lib32files="/usr/share/vulkan/icd.d/amd_icd32.json"
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-project-${_llvm_project_commit} ${wrksrc}/llvm-project
mv ${wrksrc}/spvgen-${_spvgen_commit} ${wrksrc}/spvgen
mv ${wrksrc}/MetroHash-${_MetroHash_commit} ${wrksrc}/metrohash
mv ${wrksrc}/CWPack-${_CWPack_commit} ${wrksrc}/cwpack
}
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}"
}
pre_build() {
# lower burden on build servers, llvm eats too much memory
if [ "$XBPS_MAKEJOBS" -gt 2 ]; then
echo $XBPS_MAKEJOBS
export makejobs="-j$(( $XBPS_MAKEJOBS / 2 ))"
echo $XBPS_MAKEJOBS
fi
}
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/
vsed -i ${DESTDIR}/usr/share/vulkan/icd.d/amd_icd32.json -e 's#/usr/lib/#/usr/lib32/#g'
;;
*)
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
vlicense ${wrksrc}/AMDVLK/LICENSE.txt
}