void-packages/srcpkgs/sunxi-tools/template
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: 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

31 lines
863 B
Bash

# Template file for 'sunxi-tools'
pkgname=sunxi-tools
reverts=20150526_1
version=20150226
revision=3
_commit=b80e7ce7bd5c2015465c2fd0e5990d47c05c7f8e
wrksrc="$pkgname-$_commit"
hostmakedepends="pkg-config git"
makedepends="libusb-devel"
short_desc="Tools to help hacking Allwinner AXX (aka sunxi) based devices"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://github.com/linux-sunxi/sunxi-tools"
distfiles="$homepage/archive/$_commit.tar.gz"
checksum=93922d654df5153d468b0f7900f96fe858fe457894ff2dd0f5dfb5c94b65475b
CFLAGS="-std=c99 -I./include"
do_build() {
make CC=$CC CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
}
do_install() {
vinstall README 644 usr/share/doc/${pkgname}
for f in fexc bootinfo fel usb-boot fel-gpio pio nand-part; do
vbin ${f}
done
cd ${DESTDIR}/usr/bin
ln -s fexc fex2bin
ln -s fexc bin2fex
}