void-packages/srcpkgs/tesseract/template
Đoàn Trần Công Danh 4f75cf25fd srcpkgs/t*: 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

45 lines
1.6 KiB
Bash

# Template file for 'tesseract'
pkgname=tesseract
version=1
revision=4
wrksrc="$pkgname"
hostmakedepends="pkg-config ImageMagick"
makedepends="SDL2_image-devel SDL2_mixer-devel MesaLib-devel libpng-devel zlib-devel"
depends="desktop-file-utils hicolor-icon-theme"
short_desc="FPS game focused on instagib deathmatch and capture-the-flag gameplay"
maintainer="Orphaned <orphan@voidlinux.org>"
license="zlib"
homepage="http://tesseract.gg/"
distfiles="http://download.tuxfamily.org/tesseract/tesseract_2014_05_12_first_edition_linux.tar.xz"
checksum=8d6e07dd154a40a3f593e52289335c036f06cf90a0ebc400c4650adb3395a0f4
pre_build() {
for dim in 16 32 48 64 128 256 512; do
convert -resize "${dim}x${dim}" media/interface/cube.png "${pkgname}${dim}.png"
done
sed -i src/Makefile \
-e"s;-o tess_client;${LDFLAGS} &;" \
-e"s;-o tess_server;${LDFLAGS} &;"
sed -i src/enet/Makefile \
-e"s;^\(CFLAGS=\).*;\1${CFLAGS};"
}
do_build() {
make ${makejobs} -C src CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer -ffast-math"
}
do_install() {
make STRIP= -C src install
vmkdir usr/share/${pkgname}
vcopy media usr/share/${pkgname}
vcopy config usr/share/${pkgname}
vbin bin_unix/native_client ${pkgname}-client
vbin bin_unix/native_server ${pkgname}-server
vlicense src/readme_${pkgname}.txt LICENSE
vbin ${FILESDIR}/${pkgname}.sh ${pkgname}
vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
for dim in 16 32 48 64 128 256 512; do
vinstall ${pkgname}${dim}.png 644 usr/share/icons/hicolor/${dim}x${dim}/apps ${pkgname}.png
done
vinstall ${pkgname}48.png 644 usr/share/pixmaps ${pkgname}.png
}