python-PyQt4: use alternatives for pyuic4 wrapper

This commit is contained in:
Alessio Sergi 2016-04-30 16:07:21 +02:00
parent 07e35d65c2
commit 4d40972dc3

View file

@ -1,7 +1,7 @@
# Template file for 'python-PyQt4'
pkgname=python-PyQt4
version=4.11.4
revision=1
revision=2
wrksrc="PyQt-x11-gpl-${version}"
hostmakedepends="pkg-config"
makedepends="python-devel python3.4-devel python-sip-devel python3.4-sip-devel
@ -15,6 +15,7 @@ homepage="http://www.riverbankcomputing.co.uk/software/pyqt/intro"
license="GPL-2, GPL-3"
distfiles="${SOURCEFORGE_SITE}/pyqt/PyQt-x11-gpl-${version}.tar.gz"
checksum=fc1fe77495432ba3b0d74ff5cb164d375a97f5dddb728256330f615a7cdcf407
alternatives="pyqt4:pyuic4:/usr/bin/pyuic4-2.7"
_do_pyqt4_build() {
local pyver=${1:-2.7} tools=
@ -32,8 +33,8 @@ 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
rm -rf pyqt4/pyuic/uic/port_v3
rm -rf pyqt4-3.4/pyuic/uic/port_v2
}
do_build() {
# build python-pyqt4
@ -49,13 +50,14 @@ do_install() {
make -C pyqt4 DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
make -C pyqt4-3.4 DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
cd ${wrksrc}/pyqt4
# install python3-pyuic4 wrapper
cd pyqt4
# create versioned pyuic4 wrapper
mv ${DESTDIR}/usr/bin/pyuic4{,-2.7}
sed -i 's,python2.7,python3.4,g' pyuic4
vbin pyuic4 python3-pyuic4
vbin pyuic4 pyuic4-3.4
# install doc
vmkdir usr/share/doc/${pkgname}
vcopy "doc/html examples" usr/share/doc/${pkgname}
vcopy doc/html usr/share/doc/${pkgname}
}
python-PyQt4-devel-tools_package() {
@ -99,8 +101,9 @@ python3.4-PyQt4_package() {
pycompile_version="3.4"
pycompile_module="PyQt4"
short_desc="${_short_desc}"
alternatives="pyqt4:pyuic4:/usr/bin/pyuic4-3.4"
pkg_install() {
vmove usr/bin/python3-pyuic4
vmove usr/bin/pyuic4-3.4
vmove usr/lib/python3.4
}
}