summaryrefslogtreecommitdiff
path: root/shaderc/Pkgfile
blob: e84f10e1eacb7cac0fcfa959bfa74059c2280381 (plain)
    1 # Description: A collection of tools, libraries and tests for shader compilation.
    2 # URL: https://github.com/google/shaderc
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Depends on: glslang spirv-tools
    5 # Optional: asciidoctor
    6 
    7 name=shaderc
    8 version=2022.4
    9 release=2
   10 source=(https://github.com/google/shaderc/archive/v$version/$name-v$version.tar.gz
   11 	glslc.1)
   12 
   13 build() {
   14 	# de-vendor libs and disable git versioning
   15 	sed '/examples/d;/third_party/d' -i $name-$version/CMakeLists.txt
   16 	sed '/build-version/d' -i $name-$version/glslc/CMakeLists.txt
   17 	cat <<- EOF > $name-$version/glslc/src/build-version.inc
   18 "${version}\\n"
   19 "$(prt-get info spirv-tools | awk '/^Version:/ {print $2}')\\n"
   20 "$(prt-get info glslang | awk '/^Version:/ {print $2}')\\n"
   21 EOF
   22 		sed -i -e "s|\$<TARGET_FILE:spirv-dis>|spirv-dis|" \
   23 			$name-$version/glslc/test/CMakeLists.txt
   24 
   25 	cmake -S $name-$version -B build -G Ninja $PKGMK_SHADERC \
   26 		-D CMAKE_INSTALL_PREFIX=/usr \
   27 		-D CMAKE_INSTALL_LIBDIR=lib \
   28 		-D CMAKE_BUILD_TYPE=Release \
   29 		-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS} -ffat-lto-objects" \
   30 		-D SHADERC_SKIP_TESTS=ON \
   31 		-D glslang_SOURCE_DIR:PATH='/usr/include/glslang'
   32 
   33 	cmake --build build -j ${JOBS:-1}
   34 	DESTDIR=$PKG cmake --install build
   35 
   36 	if [ -e '/usr/bin/asciidoctor' ]; then
   37 		cd $name-$version/glslc
   38 		asciidoctor -b manpage README.asciidoc -o glslc.1
   39 		install -D -m 0644 -t $PKG/usr/share/man/man1 glslc.1
   40 		cd -
   41 	else
   42 		install -D -m 0644 -t $PKG/usr/share/man/man1 $SRC/glslc.1
   43 	fi
   44 }

Generated by cgit