void-packages/srcpkgs/python-PyQt4/template

147 lines
4.1 KiB
Bash

# Template file for 'python-PyQt4'
pkgname=python-PyQt4
version=4.12.1
revision=2
lib32disabled=yes
wrksrc="PyQt4_gpl_x11-${version}"
hostmakedepends="pkg-config python python3"
makedepends="python-devel python3-devel python-sip-devel python3-sip-devel
qt-webkit-devel dbus-devel python-dbus-devel MesaLib-devel phonon-devel"
depends="python-sip"
pycompile_module="PyQt4"
short_desc="Python2 bindings for the Qt4 toolkit"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://riverbankcomputing.com/software/pyqt/intro"
license="GPL-3"
distfiles="${SOURCEFORGE_SITE}/pyqt/PyQt4_gpl_x11-${version}.tar.gz"
checksum=45d724461ae58b019b9be95076ca07e212eb73084aec9125bb254825c3a05383
alternatives="pyqt4:pyuic4:/usr/bin/python2-pyuic4"
nocross="FIXME: Fails to detect the cross Qt4 version details"
if [ -n "$CROSS_BUILD" ]; then
hostmakedepends+=" qt-devel"
fi
pre_build() {
mkdir -p pyqt4-${py2_ver}
mv * pyqt4-${py2_ver} || true
cp -a pyqt4-${py2_ver} pyqt4-${py3_ver}
rm -rf pyqt4-${py2_ver}/pyuic/uic/port_v3
rm -rf pyqt4-${py3_ver}/pyuic/uic/port_v2
}
do_build() {
local tools=
for pyver in $py2_ver $py3_ver; do
cd $wrksrc/pyqt4-$pyver
python${pyver} configure-ng.py --confirm-license --assume-shared \
--qmake=/usr/lib/qt/bin/qmake --verbose \
CC="${CC}" CFLAGS="${CFLAGS}" CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
LINK="${CXX}" LINK_SHLIB="${CXX}" LFLAGS="${LDFLAGS}" STRIP=""
find -name Makefile -exec sed -i "{}" \
-e "s;^\(CXXFLAGS.*=.*\);& $CXXFLAGS;" \
-e "s;^\(LFLAGS.*=.*\);& $LDFLAGS;" \;
make ${makejobs}
done
}
do_install() {
# install python-pyqt4
make -C pyqt4-${py2_ver} DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
# create versioned pyuic4 wrapper
sed -i 's,/usr/bin/python2.7,/usr/bin/python2,' ${DESTDIR}/usr/bin/pyuic4
mv ${DESTDIR}/usr/bin/{,python2-}pyuic4
# install python3-pyqt4
make -C pyqt4-${py3_ver} DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
# create versioned pyuic4 wrapper
sed -i 's,/usr/bin/python3[.0-9]*,/usr/bin/python3,' ${DESTDIR}/usr/bin/pyuic4
mv ${DESTDIR}/usr/bin/{,python3-}pyuic4
cd pyqt4-${py2_ver}
# install doc
vmkdir usr/share/doc/${pkgname}
vcopy doc/html usr/share/doc/${pkgname}
}
python-PyQt4-devel-tools_package() {
short_desc+=" - development tools"
pkg_install() {
vmove usr/bin/pylupdate4
vmove usr/bin/pyrcc4
}
}
python-PyQt4-devel_package() {
depends="python-sip-devel python3-sip-devel
python-PyQt4-${version}_${revision} python3-PyQt4-${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/share/sip
}
}
python-PyQt4-dbus_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision} python-dbus"
short_desc+=" - dbus support"
pkg_install() {
vmove ${py2_sitelib}/dbus/mainloop/qt.so
}
}
python-PyQt4-phonon_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - phonon bindings"
pkg_install() {
vmove ${py2_sitelib}/PyQt4/phonon.so
}
}
python-PyQt4-webkit_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - webkit module"
pkg_install() {
vmove ${py2_sitelib}/PyQt4/QtWebKit.so
}
}
python-PyQt4-doc_package() {
noarch=yes
short_desc+=" - documentation files"
pkg_install() {
vmove usr/share/doc
}
}
python3-PyQt4_package() {
lib32disabled=yes
depends="python3-sip"
pycompile_module="PyQt4"
short_desc="${short_desc/Python2/Python3}"
alternatives="pyqt4:pyuic4:/usr/bin/python3-pyuic4"
pkg_install() {
vmove usr/bin/python3-pyuic4
vmove ${py3_sitelib}
}
}
python3-PyQt4-dbus_package() {
lib32disabled=yes
depends="python3-PyQt4-${version}_${revision} python3-dbus"
short_desc="${short_desc/Python2/Python3} - dbus support"
pkg_install() {
vmove ${py3_sitelib}/dbus/mainloop/qt.so
}
}
python3-PyQt4-phonon_package() {
lib32disabled=yes
depends="python3-PyQt4-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - phonon bindings"
pkg_install() {
vmove ${py3_sitelib}/PyQt4/phonon.so
}
}
python3-PyQt4-webkit_package() {
lib32disabled=yes
depends="python3-PyQt4-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - webkit module"
pkg_install() {
vmove ${py3_sitelib}/PyQt4/QtWebKit.so
}
}