2019-04-20 11:48:32 +10:00
|
|
|
# Description: Collection of tools, libraries and tests for shader compilation.
|
|
|
|
# URL: https://github.com/google/shaderc
|
|
|
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
2019-10-12 13:24:55 +11:00
|
|
|
# Depends on: glslang
|
|
|
|
# Optional: asciidoctor
|
2019-04-20 11:48:32 +10:00
|
|
|
|
|
|
|
name=shaderc
|
2020-06-07 17:49:26 +10:00
|
|
|
version=2019.1
|
|
|
|
commit=f76bb2f09f858c3014b329961d836964e515095d
|
|
|
|
release=1
|
2019-12-01 11:47:45 +11:00
|
|
|
source=(
|
2019-12-02 12:46:38 +11:00
|
|
|
https://github.com/google/shaderc/archive/$commit.tar.gz#/$name-$commit.tar.gz
|
2019-12-01 11:47:45 +11:00
|
|
|
#https://github.com/google/$name/archive/v$version/$name-v$version.tar.gz
|
2019-10-12 13:24:55 +11:00
|
|
|
glslc.1 spvc.1 glslc-asciidoc.patch spvc-asciidoc.patch
|
2020-06-07 17:49:26 +10:00
|
|
|
0001-Fix-the-link-order-of-libglslang-and-libHLSL.patch
|
2019-12-01 11:47:45 +11:00
|
|
|
0001-Drop-third-party-code-in-CMakeLists.txt.patch
|
2020-06-07 17:49:26 +10:00
|
|
|
0001-Fix-SPIRV-includes-location.patch
|
|
|
|
0001-Handle-new-Glslang-profile-enum-in-switch.patch)
|
2019-04-20 11:48:32 +10:00
|
|
|
|
|
|
|
build() {
|
2019-12-01 11:47:45 +11:00
|
|
|
cd $name-$commit
|
|
|
|
#cd $name-$version
|
2019-04-20 11:48:32 +10:00
|
|
|
|
2019-10-12 13:24:55 +11:00
|
|
|
patch -d glslc -p0 -i $SRC/glslc-asciidoc.patch
|
|
|
|
patch -d spvc -p0 -i $SRC/spvc-asciidoc.patch
|
|
|
|
|
2020-06-07 17:49:26 +10:00
|
|
|
patch -p1 -i $SRC/0001-Fix-the-link-order-of-libglslang-and-libHLSL.patch
|
2019-12-01 11:47:45 +11:00
|
|
|
patch -p1 -i $SRC/0001-Drop-third-party-code-in-CMakeLists.txt.patch
|
2020-06-07 17:49:26 +10:00
|
|
|
patch -p1 -i $SRC/0001-Fix-SPIRV-includes-location.patch
|
|
|
|
patch -p1 -i $SRC/0001-Handle-new-Glslang-profile-enum-in-switch.patch
|
2019-04-20 11:48:32 +10:00
|
|
|
|
|
|
|
# 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
|
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
|
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
|
|
|
-DSHADERC_SKIP_TESTS=ON \
|
|
|
|
-GNinja \
|
|
|
|
-DSHADERC_ENABLE_NV_EXTENSIONS=OFF # Currently requires glslang-git
|
|
|
|
|
|
|
|
ninja -j ${JOBS:-1}
|
|
|
|
|
|
|
|
DESTDIR=$PKG ninja install
|
|
|
|
|
2019-10-12 13:24:55 +11:00
|
|
|
if [ -e '/usr/bin/asciidoctor' ]; then
|
|
|
|
cd ../glslc
|
|
|
|
asciidoctor -b manpage README.asciidoc -o glslc.1
|
|
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 glslc.1
|
|
|
|
|
|
|
|
cd ../spvc
|
|
|
|
asciidoctor -b manpage README.asciidoc -o spvc.1
|
|
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 spvc.1
|
|
|
|
else
|
|
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 $SRC/glslc.1
|
|
|
|
install -D -m 0644 -t $PKG/usr/share/man/man1 $SRC/spvc.1
|
|
|
|
fi
|
2019-04-20 11:48:32 +10:00
|
|
|
}
|