void-packages/srcpkgs/libnfc/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

32 lines
1,014 B
Bash

# Template file for 'libnfc'
pkgname=libnfc
version=1.8.0
revision=1
wrksrc="${pkgname}-${pkgname}-${version}"
build_style=cmake
short_desc="Low level NFC SDK and Programmers API"
hostmakedepends="pkg-config"
makedepends="libusb-devel libusb-compat-devel"
maintainer="Andrea Brancaleoni <abc@pompel.me>"
license="GPL-3"
homepage="http://nfc-tools.org/"
distfiles="https://github.com/nfc-tools/libnfc/archive/libnfc-${version}.tar.gz"
checksum=0ab7d9b41442e7edc2af7c54630396edc73ce51128aa28a5c6e4135dc5595495
CFLAGS="-D_GNU_SOURCE"
pre_configure() {
sed -i "s|MODE=\"0664\", GROUP=\"plugdev\"|TAG+=\"uaccess\"|g" contrib/udev/93-pn53x.rules
}
post_install() {
vinstall contrib/udev/93-pn53x.rules 644 usr/lib/udev/rules.d/
vinstall contrib/linux/blacklist-libnfc.conf 644 usr/lib/modprobe.d/
}
libnfc-devel_package() {
depends="${makedepends} libnfc>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
}
}