2023-06-04 00:21:09 +02:00
|
|
|
# Description: A collection of tools, libraries and tests for shader compilation
|
2019-04-20 11:48:32 +10:00
|
|
|
# URL: https://github.com/google/shaderc
|
|
|
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
2021-04-05 15:14:07 +10:00
|
|
|
# Depends on: glslang spirv-tools
|
2019-10-12 13:24:55 +11:00
|
|
|
# Optional: asciidoctor
|
2019-04-20 11:48:32 +10:00
|
|
|
|
|
|
|
name=shaderc
|
2023-06-04 00:21:09 +02:00
|
|
|
version=2023.4
|
2023-01-21 11:56:12 +00:00
|
|
|
release=1
|
2021-04-05 15:14:07 +10:00
|
|
|
source=(https://github.com/google/shaderc/archive/v$version/$name-v$version.tar.gz
|
|
|
|
glslc.1)
|
2019-04-20 11:48:32 +10:00
|
|
|
|
|
|
|
build() {
|
|
|
|
# de-vendor libs and disable git versioning
|
2020-11-07 16:59:13 +00:00
|
|
|
sed '/examples/d;/third_party/d' -i $name-$version/CMakeLists.txt
|
|
|
|
sed '/build-version/d' -i $name-$version/glslc/CMakeLists.txt
|
|
|
|
cat <<- EOF > $name-$version/glslc/src/build-version.inc
|
2019-10-12 13:24:55 +11:00
|
|
|
"${version}\\n"
|
2019-04-20 11:48:32 +10:00
|
|
|
"$(prt-get info spirv-tools | awk '/^Version:/ {print $2}')\\n"
|
|
|
|
"$(prt-get info glslang | awk '/^Version:/ {print $2}')\\n"
|
|
|
|
EOF
|
2023-06-04 00:21:09 +02:00
|
|
|
sed -i -e "s|\$<TARGET_FILE:spirv-dis>|spirv-dis|" \
|
|
|
|
$name-$version/glslc/test/CMakeLists.txt
|
2019-04-20 11:48:32 +10:00
|
|
|
|
2022-11-01 14:12:28 +00:00
|
|
|
cmake -S $name-$version -B build -G Ninja $PKGMK_SHADERC \
|
2020-11-08 12:43:52 +00:00
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-D CMAKE_INSTALL_LIBDIR=lib \
|
|
|
|
-D CMAKE_BUILD_TYPE=Release \
|
2022-05-22 21:06:42 +10:00
|
|
|
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -ffat-lto-objects" \
|
2020-11-08 12:43:52 +00:00
|
|
|
-D SHADERC_SKIP_TESTS=ON \
|
2022-05-22 21:06:42 +10:00
|
|
|
-D glslang_SOURCE_DIR:PATH='/usr/include/glslang'
|
2019-04-20 11:48:32 +10:00
|
|
|
|
2020-11-07 16:59:13 +00:00
|
|
|
cmake --build build -j ${JOBS:-1}
|
|
|
|
DESTDIR=$PKG cmake --install build
|
2019-04-20 11:48:32 +10:00
|
|
|
|
2019-10-12 13:24:55 +11:00
|
|
|
if [ -e '/usr/bin/asciidoctor' ]; then
|
2021-02-05 20:19:30 +11:00
|
|
|
cd $name-$version/glslc
|
2019-10-12 13:24:55 +11:00
|
|
|
asciidoctor -b manpage README.asciidoc -o glslc.1
|
|
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 glslc.1
|
2021-02-05 20:19:30 +11:00
|
|
|
cd -
|
2019-10-12 13:24:55 +11:00
|
|
|
else
|
|
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 $SRC/glslc.1
|
|
|
|
fi
|
2019-04-20 11:48:32 +10:00
|
|
|
}
|