void-packages/srcpkgs/ltrace/template
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: 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

29 lines
919 B
Bash

# Template file for 'ltrace'
pkgname=ltrace
version=0.7.3.20160924
revision=2
_githash=82c66409c7a93ca6ad2e4563ef030dfb7e6df4d4
wrksrc="${pkgname}-${_githash}"
build_style=gnu-configure
hostmakedepends="automake libtool"
makedepends="elfutils-devel"
short_desc="Tracks runtime library calls in dynamically linked programs"
maintainer="Orphaned <orphan@voidlinux.org>"
homepage="http://ltrace.org"
license="GPL-2"
distfiles="https://github.com/dkogan/ltrace/archive/${_githash}.tar.gz"
checksum=4aecf69e4a33331aed1e50ce4907e73a98cbccc4835febc3473863474304d547
CFLAGS="-Wno-error -D_GNU_SOURCE"
pre_configure() {
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
sed -i '/HOST_OS/s/linux-uclibc/linux-musl/g' configure.ac
sed -i -e '/error.h/d' -e 's/error(1, errno/err(1/' \
read_config_file.c expr.c zero.c
sed -i '1i#include <sys/types.h>' proc.h
sed -i 's/#ifndef __mips__/#if 0/' proc.c
fi
autoreconf -fi
}