void-packages/srcpkgs/flex/template
Đoàn Trần Công Danh be5369a0cb srcpkgs/f*: convert patches to -Np1
* fpc is kept at -Np0

```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

33 lines
881 B
Bash

# Template file for 'flex'
pkgname=flex
version=2.6.4
revision=3
build_style=gnu-configure
configure_args="--disable-bootstrap --disable-shared"
hostmakedepends="bison"
makedepends="bison"
depends="bison libfl-devel-${version}_${revision} m4"
short_desc="Fast Lexical Analyzer"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="custom:flex"
homepage="https://github.com/westes/flex"
distfiles="https://github.com/westes/${pkgname}/releases/download/v${version}/${pkgname}-${version}.tar.gz"
checksum=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995
# Required to enable the definition of reallocarray() in stdlib.h
CFLAGS="-D_GNU_SOURCE"
post_install() {
ln -s flex ${DESTDIR}/usr/bin/lex
vlicense COPYING
}
libfl-devel_package() {
replaces="libfl>=0"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
}
}