void-packages/srcpkgs/python-pyside/template

145 lines
4.4 KiB
Bash

# Template file for 'python-pyside'
pkgname=python-pyside
version=1.2.2
revision=5
wrksrc="pyside-qt4.8+${version}"
hostmakedepends="cmake"
makedepends="python-devel python3-devel libshiboken-python-devel
libshiboken-python3-devel qt-devel qt-webkit-devel MesaLib-devel phonon-devel"
depends="python-shiboken"
pycompile_module="PySide"
short_desc="LGPL-licensed Python2 bindings for the Qt4 toolkit"
maintainer="Enno Boland <gottox@voidlinux.eu>"
homepage="http://www.pyside.org/"
license="LGPL-2.1"
distfiles="https://download.qt.io/official_releases/pyside/pyside-qt4.8+${version}.tar.bz2"
checksum=a1a9df746378efe52211f1a229f77571d1306fb72830bbf73f0d512ed9856ae1
pre_build() {
# Fix generated pkgconfig file to require the shiboken
# library suffixed with the correct python version.
sed -i '/^Requires:/s/shiboken$/&@SHIBOKEN_PYTHON_SUFFIX@/' libpyside/pyside.pc.in
}
do_build() {
local args= configure_args="
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF"
for pyver in $py2_ver $py3_ver; do
unset args
if [ "$pyver" = "$py2_ver" ]; then
args="-DPYTHON_SUFFIX=-python$py2_ver"
fi
[ ! -d build-${pyver} ] && mkdir build-${pyver}
pushd build-${pyver}
cmake .. ${configure_args} ${args}
make ${makejobs}
popd
done
}
do_install() {
for pyver in $py2_ver $py3_ver; do
make -C build-${pyver} DESTDIR=${DESTDIR} install
done
}
post_install() {
# Fix conflict between .pc files
rm -f ${DESTDIR}/usr/lib/pkgconfig/*
for pyver in $py2_ver $py3_ver; do
vinstall build-${pyver}/libpyside/pyside.pc 644 \
usr/lib/pkgconfig pyside-python${pyver}.pc
done
}
libpyside-common-devel_package() {
short_desc+=" - common development files"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake/PySide-${version}/PySideConfig.cmake
vmove usr/lib/cmake/PySide-${version}/PySideConfigVersion.cmake
vmove usr/share
}
}
libpyside-python-devel_package() {
depends="libpyside-common-devel-${version}_${revision}
libpyside-python-${version}_${revision}"
short_desc+=" - shared library (development files)"
pkg_install() {
vmove usr/lib/cmake/PySide-${version}/PySideConfig-python${py2_ver}.cmake
vmove usr/lib/pkgconfig/pyside-python${py2_ver}.pc
vmove usr/lib/libpyside-python${py2_ver}.so
}
}
libpyside-python_package() {
short_desc+=" - shared library"
pkg_install() {
vmove usr/lib/libpyside-python${py2_ver}.so.${version%.*}
vmove usr/lib/libpyside-python${py2_ver}.so.${version}
}
}
python-pyside-phonon_package() {
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - phonon bindings"
pkg_install() {
vmove ${py2_sitelib}/PySide/phonon.so
}
}
libpyside-python3-devel_package() {
replaces="libpyside-python3.4-devel>=0"
depends="libpyside-common-devel-${version}_${revision}
libpyside-python3-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - shared library (development files)"
pkg_install() {
vmove usr/lib/cmake/PySide-${version}/PySideConfig-python${py3_ver}.cmake
vmove usr/lib/pkgconfig/pyside-python${py3_ver}.pc
vmove usr/lib/libpyside-python${py3_ver}.so
}
}
libpyside-python3_package() {
replaces="libpyside-python3.4>=0"
short_desc="${short_desc/Python2/Python3} - shared library"
pkg_install() {
vmove usr/lib/libpyside-python${py3_ver}.so.${version%.*}
vmove usr/lib/libpyside-python${py3_ver}.so.${version}
}
}
python3-pyside-phonon_package() {
replaces="python3.4pyside-phonon>=0"
depends="python3-pyside-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - phonon bindings"
pkg_install() {
vmove ${py3_sitelib}/PySide/phonon.so
}
}
python3-pyside_package() {
replaces="python3.4pyside>=0"
depends="python3-shiboken"
pycompile_module="PySide"
short_desc="${short_desc/Python2/Python3}"
pkg_install() {
vmove ${py3_sitelib}
}
}
libpyside-python3.4-devel_package() {
build_style=meta
short_desc="${short_desc/Python2/Python3.4} (transitional dummy package)"
depends="libpyside-python3-devel>=${version}_${revision}"
}
libpyside-python3.4_package() {
build_style=meta
short_desc="${short_desc/Python2/Python3.4} (transitional dummy package)"
depends="libpyside-python3>=${version}_${revision}"
}
python3.4-pyside-phonon_package() {
build_style=meta
short_desc="${short_desc/Python2/Python3.4} (transitional dummy package)"
depends="python3-pyside-phonon>=${version}_${revision}"
}
python3.4-pyside_package() {
build_style=meta
short_desc="${short_desc/Python2/Python3.4} (transitional dummy package)"
depends="python3-pyside>=${version}_${revision}"
}