void-packages/srcpkgs/tup/template
Đoàn Trần Công Danh 4f75cf25fd srcpkgs/t*: 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

38 lines
1.1 KiB
Bash

# Template file for 'tup'
pkgname=tup
version=0.7.9
revision=1
hostmakedepends="fuse-devel pkg-config"
makedepends="fuse-devel pcre-devel sqlite-devel"
short_desc="File-based build system"
maintainer="Julien Dehos <dehos@lisic.univ-littoral.fr>"
license="GPL-2.0-only"
homepage="http://gittup.org/tup/index.html"
distfiles="https://github.com/gittup/${pkgname}/archive/v${version}.tar.gz"
checksum=9b0951afaa749186eb55d88860405b2f6b3d88632d1b5df1ec4a0bf973d8d326
do_configure() {
sed -i "s/git describe/echo ${version}/" src/tup/link.sh
sed -i "s/CC = gcc/CC = ${CC}/" Tuprules.tup
sed -i "1iCFLAGS=${CFLAGS}" Tuprules.tup
sed -i "1iLDFLAGS=${LDFLAGS}" Tuprules.tup
echo "CONFIG_TUP_USE_SYSTEM_SQLITE=y" > tup.config
echo "CONFIG_TUP_USE_SYSTEM_PCRE=y" >> tup.config
}
do_build() {
# build tup for host arch using a script
CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
./build.sh
./build/tup init
# build tup for target arch using the previous build (boostrapping)
./build/tup generate script.sh
sed -i 's#../lua/lua #../../build/lua #' script.sh
./script.sh
}
do_install() {
vbin tup
vman tup.1
}