void-packages/srcpkgs/mod_wsgi/template
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: 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

42 lines
1.6 KiB
Bash

# Template file for 'mod_wsgi'
pkgname=mod_wsgi
version=4.7.1
revision=1
build_style=gnu-configure
hostmakedepends="python3 perl automake libtool"
makedepends="apache-devel python3-devel apr-devel"
short_desc="Python WSGI adapter module for Apache"
maintainer="Orphaned <orphan@voidlinux.org>"
license="Apache-2.0"
homepage="https://modwsgi.readthedocs.io/en/develop/"
changelog="https://modwsgi.readthedocs.io/en/latest/release-notes/version-${version}.html"
distfiles="https://github.com/GrahamDumpleton/${pkgname}/archive/${version}.tar.gz"
checksum=2674e506719afe60fbc0547c832e8948d6caa2e054d40d336309993e6e867d35
lib32disabled=yes
pre_configure() {
if [ "$CROSS_BUILD" ]; then
cp -a ${XBPS_CROSS_BASE}/usr/bin/apxs ${wrksrc}
cp -a ${XBPS_CROSS_BASE}/usr/share/apache/webroot/build/config_vars.mk ${wrksrc}
# Use the modified apxs
configure_args+=" --with-apxs=${wrksrc}/apxs"
configure_args+=" --with-python=$XBPS_WRAPPERDIR/python3"
configure_args+=" PYTHON_VERSION=$py3_ver PYTHON_LDVERSION=$py3_ver"
# Use the ${wrksrc}/config_vars.mk
vsed -i apxs \
-e "/config_vars[.]mk/s;[$]installbuilddir;${wrksrc};g" \
-e "s;[$]installbuilddir/instdso[.]sh;$XBPS_CROSS_BASE/&;g" \
# Use apr-1-config and apu-1-config wrappers
vsed -i config_vars.mk \
-e "/^APR_CONFIG/ s;=.*;= ${XBPS_WRAPPERDIR}/apr-1-config;" \
-e "/^APU_CONFIG/ s;=.*;= ${XBPS_WRAPPERDIR}/apu-1-config;" \
-e "/^includedir/ s;=.*;= $XBPS_CROSS_BASE/usr/include/httpd;" \
-e "s;\([I ]\)/usr/include;\1$XBPS_CROSS_BASE/usr/include;g"
else
configure_args+=" --with-python=/usr/bin/python3"
fi
autoreconf -fi
}