void-packages/srcpkgs/uwsgi/template
Đoàn Trần Công Danh 5769f150de srcpkgs/u*: 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

56 lines
1.4 KiB
Bash

# Template file for 'uwsgi'
pkgname=uwsgi
version=2.0.19.1
revision=1
hostmakedepends="python3"
makedepends="python3-devel"
short_desc="Fast, self-healing application container server"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-linking-exception"
homepage="http://projects.unbit.it/uwsgi"
distfiles="https://github.com/unbit/uwsgi/archive/${version}.tar.gz"
checksum=bf17cdbb9bd8bcb7c1633e34d9d7308cb4cc19eb0ff2d61057f840c1ba1fc41b
_libdir=usr/lib/uwsgi
pre_configure() {
vsed -i uwsgiconfig.py -e "s|uc.get('plugin_dir')|'.'|"
vsed -i buildconf/base.ini -e "s|\(plugin_dir =\).*|\1 /$_libdir|"
}
do_build() {
local _cflags="$CFLAGS"
local _ldflags="$LDFLAGS"
python3 uwsgiconfig.py --build core
if [ "$CROSS_BUILD" ]; then
_cflags="$CFLAGS -I${XBPS_CROSS_BASE}/${py3_inc}
-I${XBPS_CROSS_BASE}/usr/include"
_ldflags="$LDFLAGS -L${XBPS_CROSS_BASE}/${py3_lib}
-L${XBPS_CROSS_BASE}/usr/lib"
fi
CFLAGS="$_cflags" LDFLAGS="$_ldflags" python3 uwsgiconfig.py \
--plugin plugins/python core python3
CFLAGS="$_cflags" LDFLAGS="$_ldflags" python3 uwsgiconfig.py \
--plugin plugins/cgi core cgi
}
do_install() {
vbin uwsgi
}
uwsgi-python3_package() {
short_desc="$short_desc (Python3 plugin)"
pkg_install() {
vcopy python3_plugin.so $_libdir
}
}
uwsgi-cgi_package() {
short_desc="$short_desc (CGI plugin)"
pkg_install() {
vcopy cgi_plugin.so $_libdir
}
}