1
0
forked from mirrors/0ad

Package spirv-reflect for building shaders

Usually not available in Linux Distributions as it isn't customary to
package the SDK but only the bits needed as separate packages.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2024-09-16 20:07:58 +02:00
parent cf909a81db
commit 39f3fa7d5b
3 changed files with 41 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
PV=1.3.290.0
LIB_VERSION=${PV}
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "spirv-reflect is already up to date."
exit
fi
# fetch
if [ ! -e "vulkan-sdk-${PV}.tar.gz" ]; then
curl -fLo "vulkan-sdk-${PV}.tar.gz" \
"https://github.com/KhronosGroup/SPIRV-Reflect/archive/refs/tags/vulkan-sdk-${PV}.tar.gz"
fi
# unpack
rm -Rf "SPIRV-Reflect-vulkan-sdk-${PV}"
tar xf "vulkan-sdk-${PV}.tar.gz"
# configure
cmake -B build -S "SPIRV-Reflect-vulkan-sdk-${PV}" \
-DCMAKE_INSTALL_PREFIX="$(realpath . || true)"
# build
cmake --build build
# install
rm -Rf bin
cmake --install build
echo "${LIB_VERSION}" >.already-built