void-packages/srcpkgs/mod_wsgi/template
Đoàn Trần Công Danh dcb2cfb4af mod_wsgi: cross compile
2020-05-22 13:23:09 +07:00

40 lines
1.5 KiB
Bash

# Template file for 'mod_wsgi'
pkgname=mod_wsgi
version=4.6.5
revision=2
build_style=gnu-configure
hostmakedepends="python perl automake libtool"
makedepends="apache-devel python-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=5cbe05f8b9b21a9e40d5d7226f4976643b1ee5e23a2d114bceae34d9948be5e0
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/python"
configure_args+=" PYTHON_VERSION=2.7 PYTHON_LDVERSION=2.7"
# 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"
fi
autoreconf -fi
}