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

51 lines
1.7 KiB
Bash

# Template file for 'srb2'
pkgname=srb2
version=2.2.9
revision=1
create_wrksrc=true
build_wrksrc="SRB2-SRB2_release_${version}"
build_style=gnu-makefile
make_use_env=yes
make_build_args=" -C src ECHO=1 LINUX=1 USE_OPENMP=1 EXENAME=${pkgname}
DBGNAME=${pkgname}-debug NOOBJDUMP=1 NOUPX=1"
hostmakedepends="pkg-config gettext"
makedepends="SDL2-devel SDL2_mixer-devel libpng-devel libupnp-devel libcurl-devel libgme-devel libopenmpt-devel"
short_desc="3D Sonic fan game based off of Doom Legacy"
maintainer="oreo639 <oreo6391@gmail.com>"
license="GPL-2.0-or-later"
homepage="https://srb2.org/"
distfiles="https://github.com/STJr/SRB2/archive/SRB2_release_${version}.tar.gz
https://github.com/STJr/SRB2/releases/download/SRB2_release_${version}/SRB2-v${version//./}-Full.zip"
checksum="5f7eeb08e90323e28cdcb02ad25c904eef25ce75316720609b995a1e4ffd154a
48cf787a70f44b31fa7a56db4053a404a7103a494f1e09fd2bbfd563672a3534"
restricted=yes
case "$XBPS_TARGET_MACHINE" in
i686*) makedepends+=" nasm" ;;
x86_64*) make_build_args+=" X86_64=1 NONX86=1" ;;
*) make_build_args+=" NONX86=1" ;;
esac
if [ "$XBPS_TARGET_LIBC" = musl ]; then
makedepends+=" libexecinfo-devel"
export LIBS="-lexecinfo"
fi
if [ -n "$CROSS_BUILD" ]; then
make_build_args+=" OBJCOPY=${XBPS_CROSS_TRIPLET}-objcopy"
fi
do_install() {
vbin bin/Linux/Release/${pkgname}
PROGRAM_NAME="${pkgname}" PROGRAM_DESCRIPTION="${short_desc}" \
PACKAGE_INSTALL_PATH="/usr/bin" PROGRAM_FILENAME="${pkgname}" \
envsubst < debian-template/srb2.desktop > srb2.desktop
vinstall srb2.png 644 /usr/share/pixmaps/
vinstall srb2.desktop 644 /usr/share/applications/
vmkdir /usr/share/games/SRB2
for f in {music,player}.dta {srb2,zones,patch,patch_music}.pk3 models models.dat; do
vcopy ../${f} /usr/share/games/SRB2
done
}