void-packages/srcpkgs/uwsgi/template

76 lines
1.9 KiB
Bash

# Template file for 'uwsgi'
pkgname=uwsgi
version=2.0.18
revision=2
hostmakedepends="python python3"
makedepends="python-devel python3-devel"
short_desc="Fast, self-healing application container server"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="http://projects.unbit.it/uwsgi"
distfiles="https://github.com/unbit/uwsgi/archive/${version}.tar.gz"
checksum=4972ac538800fb2d421027f49b4a1869b66048839507ccf0aa2fda792d99f583
_libdir=usr/lib/uwsgi
subpackages="uwsgi-python uwsgi-python3"
case "$XBPS_TARGET_MACHINE" in
armv[67]l-musl) subpackages="uwsgi-python" ;;
aarch64-musl) makedepends+=" gettext-devel" ;;
esac
pre_configure() {
sed -e "s|uc.get('plugin_dir')|'.'|" \
-i uwsgiconfig.py
sed -e "s|\(plugin_dir =\).*|\1 /$_libdir|" \
-i buildconf/base.ini
}
do_build() {
local _cflags="$CFLAGS"
local _ldflags="$LDFLAGS"
python2 uwsgiconfig.py --build core
if [ "$CROSS_BUILD" ]; then
_cflags="$CFLAGS -I${XBPS_CROSS_BASE}/${py2_inc}
-I${XBPS_CROSS_BASE}/usr/include"
_ldflags="$LDFLAGS -L${XBPS_CROSS_BASE}/${py2_lib}
-L${XBPS_CROSS_BASE}/usr/lib"
fi
CFLAGS="$_cflags" LDFLAGS="$_ldflags" python2 uwsgiconfig.py \
--plugin plugins/python core python
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
case "$subpackages" in
*uwsgi-python3*)
CFLAGS="$_cflags" LDFLAGS="$_ldflags" python3 uwsgiconfig.py \
--plugin plugins/python core python3
;;
esac
}
do_install() {
mkdir -p $PKGDESTDIR/usr/bin $PKGDESTDIR/$_libdir
cp uwsgi $PKGDESTDIR/usr/bin
cp *_plugin.so $PKGDESTDIR/$_libdir
}
uwsgi-python_package() {
short_desc="$short_desc (Python2 plugin)"
pkg_install() {
vmove $_libdir/python_plugin.so
}
}
uwsgi-python3_package() {
short_desc="$short_desc (Python3 plugin)"
pkg_install() {
vmove $_libdir/python3_plugin.so
}
}