void-packages/srcpkgs/nsjail/template
Đoàn Trần Công Danh 65749575ab srcpkgs/n*: 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

36 lines
1 KiB
Bash

# Template file for 'nsjail'
pkgname=nsjail
version=3.0
revision=5
build_style=gnu-makefile
hostmakedepends="bison flex pkg-config protobuf which"
makedepends="libnl3-devel protobuf-devel"
short_desc="Light-weight process isolation tool"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="http://nsjail.com"
distfiles="https://github.com/google/nsjail/archive/${version}.tar.gz
https://github.com/google/kafel/archive/8e69b8efae415cde3debffbb1e379d9e7a16835a.tar.gz"
checksum="cfa66d3ed136b2e221752287b95e544915e8a6760aa866f023b604d14a374919
4a6c9a1a70ed99bbed767adc106081b017a3090307ea88cc7e329b82daa1373b"
archs="aarch64* armv5tel* armv6l* armv7l* x86_64*"
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
makedepends+=" musl-legacy-compat"
fi
post_extract() {
rmdir kafel
mv ../kafel-* kafel
}
post_patch() {
sed -i -e 's/-Werror\b//g' -e 's/\b\(\(C\(XX\)\?\|LD\)FLAGS\s*+=\)/override \1/g' Makefile kafel/build/Makefile.mk kafel/src/Makefile
}
do_install() {
vbin ${pkgname}
vman nsjail.1
}