49 lines
1.5 KiB
Plaintext
49 lines
1.5 KiB
Plaintext
# Description: A collection of tools, libraries and tests for shader compilation
|
|
# URL: https://github.com/google/shaderc
|
|
# Maintainer: John McQuah, jmcquah at disroot dot org
|
|
# Depends on: glslang
|
|
# Optional: asciidoctor
|
|
|
|
name=shaderc
|
|
version=2023.8
|
|
release=1
|
|
source=(https://github.com/google/$name/archive/v$version/$name-v$version.tar.gz glslc.1)
|
|
|
|
build() {
|
|
cd $name-$version
|
|
|
|
# fix build with glslang 14
|
|
# patch -Np1 -i ../40bced4e1e205ecf44630d2dfa357655b6dabd04.patch
|
|
|
|
# de-vendor libs and disable git versioning
|
|
sed '/examples/d;/third_party/d' -i CMakeLists.txt
|
|
sed '/build-version/d' -i glslc/CMakeLists.txt
|
|
cat <<- EOF > glslc/src/build-version.inc
|
|
"${version}\\n"
|
|
"$(prt-get printf '%v\n' --filter=spirv-tools)"
|
|
"$(prt-get printf '%v\n' --filter=glslang)"
|
|
EOF
|
|
sed -e "s|\$<TARGET_FILE:spirv-dis>|spirv-dis|" \
|
|
-i glslc/test/CMakeLists.txt
|
|
|
|
cmake -S . -B build -G Ninja -Wno-dev \
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_INSTALL_LIBDIR=lib \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -ffat-lto-objects" \
|
|
-D SHADERC_SKIP_TESTS=ON \
|
|
-D SHADERC_SKIP_COPYRIGHT_CHECK=ON \
|
|
-D glslang_SOURCE_DIR:PATH='/usr/include/glslang'
|
|
|
|
cmake --build build -j ${JOBS:-1}
|
|
DESTDIR=$PKG cmake --install build
|
|
|
|
if prt-get isinst asciidoctor 2>/dev/null; then
|
|
sed 's/^`glslc`/glslc/' glslc/README.asciidoc \
|
|
| asciidoctor -q -b manpage -o glslc.1 -
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 glslc.1
|
|
else
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 $SRC/glslc.1
|
|
fi
|
|
}
|