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

41 lines
1 KiB
Bash

# Template file for 'calc'
pkgname=calc
version=2.12.7.1
revision=1
build_style=gnu-makefile
make_install_args="T=$""{DESTDIR}"
short_desc="C-style arbitrary precision calculator"
maintainer="Piotr Wójcik <chocimier@tlen.pl>"
license="LGPL-2.1-only"
homepage="http://www.isthe.com/chongo/tech/comp/calc/index.html"
distfiles="http://www.isthe.com/chongo/src/calc/calc-${version}.tar.bz2"
checksum=eb1dc5dd680019e30264109167e20539fe9ac869049d8b1639781a51d1dea84c
disable_parallel_build=yes
post_extract() {
case $XBPS_TARGET_MACHINE in
*-musl) patch -Np0 < ${FILESDIR}/musl.patch ;;
esac
}
do_build() {
make ${makejobs} ${make_build_args} ${make_build_target} \
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
CPP="$CPP" AS="$AS" OBJDUMP="$OBJDUMP" LDFLAGS="$LDFLAGS"
}
libcalc_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove usr/lib/*.so.*
}
}
libcalc-devel_package() {
depends="lib${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/*.so
}
}