void-packages/srcpkgs/SDL/template
Đoàn Trần Công Danh ec4c2d75fa srcpkgs/[A-Z]*: 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.6 KiB
Bash

# Template file for 'SDL'
pkgname=SDL
version=1.2.15
revision=12
build_style=gnu-configure
configure_args="--enable-alsa --enable-sndio --disable-esd --disable-rpath
--enable-clock_gettime --disable-nas --disable-arts --disable-x11-shared
--disable-alsa-shared --disable-pulseaudio-shared --disable-video-dga
--disable-osmesa-shared $(vopt_enable aalib video-aalib)
$(vopt_enable pulseaudio) $(vopt_enable opengl video-opengl)
$(vopt_if x11 '-enable-video-x11-xrandr --enable-video-x11-vm --enable-video-x11-xv')"
hostmakedepends="pkg-config nasm"
makedepends="alsa-lib-devel sndio-devel $(vopt_if x11 libXrandr-devel)
$(vopt_if aalib aalib-devel) $(vopt_if opengl glu-devel)
$(vopt_if pulseaudio pulseaudio-devel)"
short_desc="Simple Directmedia Layer"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-only"
homepage="http://www.libsdl.org/"
distfiles="http://www.libsdl.org/release/SDL-${version}.tar.gz"
checksum=d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00
# Package build options
build_options="x11 opengl aalib pulseaudio"
build_options_default="x11"
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*|ppc*)
# Enable OpenGL and pulseaudio on x86 and ppc.
build_options_default+=" opengl pulseaudio"
;;
esac
if [ "$build_option_opengl" ]; then
# libGL.so.1 is dynamically loaded with dlopen.
shlib_requires="libGL.so.1"
depends="virtual?libGL"
fi
SDL-devel_package() {
short_desc+=" - development files"
depends="${makedepends} SDL>=${version}_${revision}"
pkg_install() {
vmove usr/bin
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/share
}
}