void-packages/srcpkgs/bananapi-uboot/template
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: 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

48 lines
1.4 KiB
Bash

# Template file for 'bananapi-uboot'
pkgname=bananapi-uboot
version=15.04
revision=2
wrksrc="u-boot-bananapi-bananian-v${version}"
hostmakedepends="sunxi-tools uboot-mkimage"
short_desc="Banana Pi uboot module"
maintainer="necrophcodr <necrophcodr@necrophcodr.me>"
license="GPL-2.0-only"
homepage="https://github.com/hardkernel/u-boot"
distfiles="https://github.com/Bananian/u-boot-bananapi/archive/bananian-v${version}.tar.gz"
checksum=8be162b0b8e85d3fbc2e14af3b71c4a204f4a9c63f6f13275f86629624c1d6a6
conf_files="/boot/uEnv.txt"
archs="armv7l*"
do_configure() {
# Create a dummy header file for gcc10 since include/linux/compiler-gcc.h
# generates an include for it but there is no such file.
mkdir -p include/linux
touch include/linux/compiler-gcc10.h
# Also current gcc9 requires this. Need to find the reason and fix that.
touch include/linux/compiler-gcc9.h
make mrproper
make Bananapi_config
}
do_build() {
unset CFLAGS CXXFLAGS LDFLAGS
if [ "$CROSS_BUILD" ]; then
make CFLAGS="-fcommon" ARCH=arm CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
else
make CFLAGS="-fcommon" ARCH=arm
fi
}
do_install() {
# Certain files in 'files' directory *NEED* to be installed.
# uEnv.txt: The boot configuration file, in pure text for readability.
# script.fex: Pure text board configuration, compiled to script.bin.
vmkdir boot
cp ${FILESDIR}/uEnv.txt ${DESTDIR}/boot/
fexc ${FILESDIR}/script.fex ${DESTDIR}/boot/script.bin
vinstall u-boot-sunxi-with-spl.bin 644 boot
}