void-packages/srcpkgs/otfcc/template
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: 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

41 lines
1.1 KiB
Bash

# Template file for 'otfcc'
pkgname=otfcc
version=0.10.4
revision=1
build_style=gnu-makefile
make_build_args="-C build/gmake"
hostmakedepends="premake5"
short_desc="Utility used for parsing and writing OpenType font files"
maintainer="Renato Aguiar <renato@renatoaguiar.net>"
license="Apache-2.0"
homepage="https://github.com/caryll/otfcc"
distfiles="https://github.com/caryll/otfcc/archive/v${version}.tar.gz"
checksum=d9c74825ddac700eb429de31de7cb0a249636f47c6a4cc64eaa102a40966cf00
# Yes, there are architectures besides x86 and x64 :-P
case "$XBPS_TARGET_MACHINE" in
aarch64*|x86_64*|ppc64*) _platform="x64" ;;
arm*|i686*|mips*|ppc*) _platform="x86";;
esac
pre_build() {
premake5 gmake
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*)
# Use the generated *.make files
;;
*) # Remove useless flags hindering cross builds
sed -i build/gmake/*.make \
-e "s;-L/usr/lib32 ;;g" \
-e "s;-L/usr/lib64 ;;g" \
-e "s;-m32 ;;g" \
-e "s;-m64 ;;g"
;;
esac
make_build_args+=" config=release_${_platform}"
}
do_install() {
vbin bin/release-${_platform}/otfccbuild
vbin bin/release-${_platform}/otfccdump
}