void-packages/srcpkgs/shaderc/template
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

35 lines
1.2 KiB
Bash

# Template file for 'shaderc'
pkgname=shaderc
version=2020.0
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=e02e2a9d4c3960bc629ca8cdcf83d295bec9c80ed08a8c5062e4e294022605ec
CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/include/glslang"
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'
cat <<- EOF > glslc/src/build-version.inc
"shaderc 2020.0\n"
"SPIRV-Tools-2020.3\n"
"glslang-8.13.3743\n"
EOF
}