void-packages/srcpkgs/python-PyQt4/template
2014-12-27 19:55:34 +01:00

129 lines
3.5 KiB
Text

# Template file for 'python-PyQt4'
pkgname=python-PyQt4
version=4.11.3
revision=2
wrksrc="PyQt-x11-gpl-${version}"
hostmakedepends="pkg-config"
makedepends="python-devel python3.4-devel python-sip-devel python3.4-sip-devel
qt-devel dbus-devel python-dbus-devel MesaLib-devel phonon-devel"
depends="python-sip"
replaces="python-PyQt4<4.11.1_2"
short_desc="Python2 bindings for the Qt4 toolkit"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://www.riverbankcomputing.co.uk/software/pyqt/intro"
update_pkgname="PyQt-x11-gpl"
license="GPL-2, GPL-3"
distfiles="${SOURCEFORGE_SITE}/pyqt/PyQt-x11-gpl-${version}.tar.gz"
checksum=853780dcdbe2e6ba785d703d059b096e1fc49369d3e8d41a060be874b8745686
_do_pyqt4_build() {
local pyver=${1:-2.7} tools=
if [ "$pyver" != "2.7" ]; then
tools="--no-tools"
fi
python${pyver} configure-ng.py --confirm-license --assume-shared $tools \
CC="${CC}" CFLAGS="${CFLAGS}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
LINK="${CXX}" LINK_SHLIB="${CXX}" LFLAGS="${LDFLAGS}" STRIP=""
make ${makejobs}
}
pre_build() {
mkdir -p pyqt4
mv * pyqt4 || true
cp -a pyqt4 pyqt4-3.4
rm -rf ${wrksrc}/pyqt4/pyuic/uic/port_v3
rm -rf ${wrksrc}/pyqt4-3.4/pyuic/uic/port_v2
}
do_build() {
# build python-pyqt4
cd ${wrksrc}/pyqt4
_do_pyqt4_build
# build python3.4-pyqt4
cd ${wrksrc}/pyqt4-3.4
_do_pyqt4_build 3.4
}
do_install() {
# install python-pyqt4
make -C pyqt4 DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
# install python3.4-pyqt4
make -C pyqt4-3.4 DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
# install doc
cd ${wrksrc}/pyqt4
vmkdir usr/share/doc/${pkgname}
vcopy "doc/html examples" usr/share/doc/${pkgname}
}
post_install() {
# install python3-pyuic4 wrapper
cd ${wrksrc}/pyqt4
sed -i 's,python2.7,python3.4,g' pyuic4
vbin pyuic4 python3-pyuic4
}
python-PyQt4-devel-tools_package() {
replaces="python-PyQt4<4.11.1_2"
short_desc+=" - development tools"
pkg_install() {
vmove usr/bin/pylupdate4
vmove usr/bin/pyrcc4
}
}
python-PyQt4-devel_package() {
replaces="python-PyQt4<4.11.1_2"
depends="python-sip-devel python3.4-sip-devel
python-PyQt4>=${version}_${revision} python3.4-PyQt4>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/share/sip
}
}
python-PyQt4-dbus_package() {
replaces="python-PyQt4<4.11.3_1"
depends="${sourcepkg}>=${version}_${revision} python-dbus"
short_desc+=" - D-Bus support for PyQt4"
pkg_install() {
vmove usr/lib/python2.7/site-packages/dbus/mainloop/qt.so
}
}
python-PyQt4-phonon_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - Python2 bindings for Phonon"
pkg_install() {
vmove usr/lib/python2.7/site-packages/PyQt4/phonon.so
}
}
python-PyQt4-doc_package() {
noarch=yes
replaces="python-PyQt4<4.11.1_2"
short_desc+=" - documentation files"
pkg_install() {
vmove usr/share/doc
}
}
python3.4-PyQt4_package() {
replaces="python3.4-PyQt4<4.11.1_2"
depends="python3.4-sip"
short_desc="${short_desc/Python2/Python3.4}"
pkg_install() {
vmove usr/bin/python3-pyuic4
vmove usr/lib/python3.4
}
}
python3.4-PyQt4-dbus_package() {
replaces="python3.4-PyQt4<4.11.3_1"
depends="python3.4-PyQt4>=${version}_${revision} python3.4-dbus"
short_desc+=" - D-Bus support for PyQt4 with Python3.4"
pkg_install() {
vmove usr/lib/python3.4/site-packages/dbus/mainloop/qt.so
}
}
python3.4-PyQt4-phonon_package() {
depends="python3.4-PyQt4>=${version}_${revision}"
short_desc+=" - Python3.4 bindings for Phonon"
pkg_install() {
vmove usr/lib/python3.4/site-packages/PyQt4/phonon.so
}
}