void-packages/srcpkgs/protobuf-c/template
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```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

36 lines
1 KiB
Bash

# Template file for 'protobuf-c'
pkgname=protobuf-c
version=1.3.3
revision=7
build_style=gnu-configure
configure_args="$(vopt_enable protoc)"
hostmakedepends="pkg-config protobuf"
makedepends="protobuf-devel boost-devel $(vopt_if protoc libprotoc-devel)"
short_desc="C implementation of the Google Protocol Buffers"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="BSD-2-Clause"
homepage="https://github.com/protobuf-c/protobuf-c"
distfiles="${homepage}/releases/download/v${version}/protobuf-c-${version}.tar.gz"
checksum=22956606ef50c60de1fabc13a78fbc50830a0447d780467d3c519f84ad527e78
# buildprocess calls compiler while building, disable it on cross build
build_options="protoc"
desc_option_protoc="Build protoc-c compiler"
if [ -z "$CROSS_BUILD" ]; then
build_options_default="protoc"
fi
post_install() {
vlicense LICENSE
}
protobuf-c-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
}
}