void-packages/srcpkgs/python-dbus/template

92 lines
2.1 KiB
Bash

# Template file for 'python-dbus'
pkgname=python-dbus
version=1.2.18
revision=2
wrksrc="dbus-python-${version}"
build_style=gnu-configure
hostmakedepends="pkg-config python python3"
makedepends="libglib-devel python3-devel python-devel"
depends="python dbus"
short_desc="D-Bus Python2 bindings"
maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="https://www.freedesktop.org/wiki/Software/DBusBindings"
distfiles="https://dbus.freedesktop.org/releases/dbus-python/dbus-python-${version}.tar.gz"
checksum=92bdd1e68b45596c833307a5ff4b217ee6929a1502f5341bae28fd120acf7260
lib32disabled=yes
pre_configure() {
mkdir -p dbus-${py2_ver}
mv * dbus-${py2_ver} || true
cp -a dbus-${py2_ver} dbus-${py3_ver}
}
do_configure() {
local py_abiver py_inc pyver
for pyver in $py2_ver $py3_ver; do
case "${pyver}" in
"${py2_ver}")
py_inc="$py2_inc"
;;
*)
py_inc="$py3_inc"
py_abiver="$py3_abiver"
;;
esac
export PYTHON_CPPFLAGS="-I${XBPS_CROSS_BASE}/${py_inc}"
export PYTHON_EXTRA_LIBS="-L${XBPS_CROSS_BASE}/usr/lib -lpython${pyver}${py_abiver}"
export PYTHON_VERSION="${pyver}"
( cd dbus-${pyver} && ./configure ${configure_args} )
done
unset PYTHON_CPPFLAGS PYTHON_EXTRA_LIBS PYTHON_VERSION
}
do_build() {
local pyver
for pyver in $py2_ver $py3_ver; do
( cd dbus-${pyver} && make ${makejobs} )
done
}
do_install() {
local pyver pysite eggver
for pyver in $py2_ver $py3_ver; do
case "${pyver}" in
"${py2_ver}") pysite="${py2_sitelib}" ;;
*) pysite="${py3_sitelib}" ;;
esac
eggver="dbus_python-${version}-py${pyver}"
(
cd dbus-${pyver}
make DESTDIR=${DESTDIR} install
vcopy dbus_python.egg-info "${pysite}/${eggver}.egg-info"
)
done
vlicense dbus-${py2_ver}/COPYING
}
python3-dbus_package() {
lib32disabled=yes
depends="python3 dbus"
short_desc="${short_desc/Python2/Python3}"
pkg_install() {
vmove usr/lib/python3*
vlicense dbus-${py3_ver}/COPYING
}
}
python3-dbus-devel_package() {
depends="python3-devel python3-dbus>=${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
}
}