void-packages/srcpkgs/amdvlk/template
2020-10-04 13:57:50 +02:00

89 lines
3.6 KiB
Bash

# Template file for 'amdvlk'
pkgname=amdvlk
version=2020.Q3.6
revision=1
_llpc_commit=6ff17fa6136e4bba8b6ae496e90e40c6e7750820
_xgl_commit=07bb2eb097cd90983902118388cabd49f3530e8b
_pal_commit=6fa4f8ac88b95688241d266ff9d8f02da6ec3c22
_llvm_project_commit=1a8b53e02a92dbc7d40087c483d03c45c6c63f2e
_spvgen_commit=fb798cb760a436e9496dbaab8827e4d183b74744
_MetroHash_commit=3c566dd9cda44ca7fd97659e0b53ac953f9037d2
_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 <me@johnnynator.dev>"
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="e318b94f6d0951855c23d0b1dd14f8984ae09e722ed654f2a1cf456d1dd3f8d5
19843d5cf2dcadbe61c4276dba08b58ef7ccea5455faab7109d3ee37ad452fbe
ab94dc387f86eb8f4a9dd3498b145bfd4ccf1dbc994fe8b96f83c4542bca4a5e
e16d8c15e158d6b435c617c72bd3f31b6c980dc1b0d1821792b9b65a8e308fa4
30ed1b4d168f83bc7d24ee5e27726f4358293ab39705aa93aafc3c548abc38a4
371b137edf4d5ec4f4483ec10ac1419fffa73b6abb1931dd637a59c1b6247e65
cc8ff538fede25fe023984b3fde27f09b000bdc49793534794cd1d2bf881750a
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
}