void-packages/srcpkgs/shaderc/template

41 lines
1.3 KiB
Bash

# Template file for 'shaderc'
pkgname=shaderc
version=2024.3
revision=1
build_style=cmake
configure_args="-DSHADERC_SKIP_TESTS=ON"
hostmakedepends="python3"
makedepends="SPIRV-Tools-devel glslang-devel SPIRV-Headers"
short_desc="Collection of tools, libraries and tests for shader compilation"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="https://github.com/google/shaderc"
distfiles="https://github.com/google/shaderc/archive/v${version}.tar.gz"
checksum=d5c68b5de5d4c7859d9699054493e0a42a2a5eb21b425d63f7b7dd543db0d708
CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/include/glslang"
LDFLAGS="-Wl,--no-undefined"
pre_configure() {
# Unbundle glslang, SPIRV-Headers, SPIRV-Tools
# also remove examples
sed -i -e '/add_subdirectory(third_party)/d' \
-e '/add_subdirectory(examples)/d' CMakeLists.txt
# Disable git versioning
sed -i -e '/build-version/d' glslc/CMakeLists.txt
# Create our own build-version.inc since we disabled git versioning
# need to keep this in sync with glslang and SPIRV-Tools versions
# this is displayed with 'glslc --version'
spirv="$($XBPS_QUERY_XCMD -p pkgver SPIRV-Tools)"
spirv=${spirv%_*}
glslang=$($XBPS_QUERY_XCMD -p pkgver glslang)
glslang=${glslang%_*}
cat <<- EOF > glslc/src/build-version.inc
"shaderc ${version}\n"
"${spirv}\n"
"${glslang}\n"
EOF
}