void-packages/srcpkgs/python-PyQt5/template

477 lines
14 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Template file for 'python-PyQt5'
pkgname=python-PyQt5
version=5.8.2
revision=3
lib32disabled=yes
wrksrc="PyQt5_gpl-${version}"
replaces="python-PyQt5-enginio<5.7_1"
hostmakedepends="pkg-config"
makedepends="
python-devel python3-devel python-sip-devel python3-sip-devel python-dbus-devel
qt5-tools-devel qt5-connectivity-devel qt5-declarative-devel qt5-location-devel
qt5-multimedia-devel qt5-sensors-devel qt5-serialport-devel qt5-svg-devel
qt5-webchannel-devel qt5-webengine-devel qt5-webkit-devel qt5-websockets-devel
qt5-x11extras-devel qt5-xmlpatterns-devel pulseaudio-devel"
depends="python-sip"
pycompile_module="PyQt5"
short_desc="Python2 bindings for the Qt5 toolkit"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://www.riverbankcomputing.co.uk/software/pyqt/intro"
license="GPL-3"
distfiles="${SOURCEFORGE_SITE}/pyqt/PyQt5_gpl-${version}.tar.gz"
checksum=ebd70515b30bbd6098fee29e6271a6696b1183c5530ee30e6ba9aaab195536e8
if [ -n "$CROSS_BUILD" ]; then
hostmakedepends+=" python python3 sip python-dbus-devel
qt5-tools-devel qt5-connectivity-devel qt5-declarative-devel qt5-location-devel
qt5-multimedia-devel qt5-sensors-devel qt5-serialport-devel qt5-svg-devel
qt5-webchannel-devel qt5-webengine-devel qt5-webkit-devel qt5-websockets-devel
qt5-x11extras-devel qt5-xmlpatterns-devel"
fi
pre_build() {
mkdir -p pyqt5-${py2_ver}
mv * pyqt5-${py2_ver} || true
cp -a pyqt5-${py2_ver} pyqt5-${py3_ver}
rm -rf pyqt5-${py2_ver}/pyuic/uic/port_v3
rm -rf pyqt5-${py3_ver}/pyuic/uic/port_v2
}
do_build() {
local tools=
for pyver in $py2_ver $py3_ver; do
cd $wrksrc/pyqt5-$pyver
if [ -n "$CROSS_BUILD" ]; then
cat > qtdetail.inc << END
QMAKE_CC="$CC_host"
QMAKE_CFLAGS="$CFLAGS_host"
QMAKE_CXX="$CXX_host"
QMAKE_CXXFLAGS="$CXXFLAGS_host"
QMAKE_LINK="$CXX_host"
QMAKE_LINK_SHLIB=
QMAKE_LFLAGS=
END
# target opengl features arent detected when cross compiling
case "$XBPS_TARGET_MACHINE" in
arm*|aarch64*) sed -i -e "/self.pyqt_disabled_features = lines\[1:-1\]/a \
\ self.pyqt_disabled_features.append('PyQt_Desktop_OpenGL')" configure.py ;;
esac
# configure.py stops when $XBPS_CROSS_BASE is empty in a
# native build; so only set sysroot when cross compiling
_sysroot="--sysroot=$XBPS_CROSS_BASE"
else
unset _sysroot
fi
python${pyver} configure.py --confirm-license --assume-shared $_sysroot \
QMAKE_CC="${CC}" QMAKE_CFLAGS="${CFLAGS}" QMAKE_CXX="${CXX}" QMAKE_CXXFLAGS="${CXXFLAGS}" \
QMAKE_LINK="${CXX}" QMAKE_LINK_SHLIB="${CXX}" QMAKE_LFLAGS="${LDFLAGS}" QMAKE_STRIP=""
find -name Makefile -exec sed -i "{}" \
-e "s;\(\$(INSTALL_ROOT)/usr/\)${XBPS_CROSS_TRIPLET}/;\1;g" \;
make ${makejobs}
done
}
do_install() {
# install python-pyqt5
make -C pyqt5-${py2_ver} DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
for f in pylupdate5 pyrcc5 pyuic5; do
sed -i -e 's,/usr/bin/python2.7,/usr/bin/python2,' \
-e "s,${XBPS_CROSS_TRIPLET}/,," ${DESTDIR}/usr/bin/${f}
mv ${DESTDIR}/usr/bin/{,python2-}${f}
done
# install python3-pyqt5
make -C pyqt5-${py3_ver} DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
for f in pylupdate5 pyrcc5 pyuic5; do
sed -i -e 's,/usr/bin/python3[.0-9]*,/usr/bin/python3,' \
-e "s,${XBPS_CROSS_TRIPLET}/,," ${DESTDIR}/usr/bin/${f}
mv ${DESTDIR}/usr/bin/{,python3-}${f}
done
cd pyqt5-${py2_ver}
# install doc
vmkdir usr/share/doc/${pkgname}
vcopy doc/html usr/share/doc/${pkgname}
}
python-PyQt5-devel-tools_package() {
lib32disabled=yes
short_desc+=" - development tools"
alternatives="
pyqt5:pylupdate5:/usr/bin/python2-pylupdate5
pyqt5:pyrcc5:/usr/bin/python2-pyrcc5
pyqt5:pyuic5:/usr/bin/python2-pyuic5"
pycompile_module="PyQt5"
pkg_install() {
vmove usr/bin/python2-*
vmove ${py2_sitelib}/PyQt5/pylupdate.so
vmove ${py2_sitelib}/PyQt5/pylupdate_main.py
vmove ${py2_sitelib}/PyQt5/pyrcc.so
vmove ${py2_sitelib}/PyQt5/pyrcc_main.py
}
}
python3-PyQt5-devel-tools_package() {
lib32disabled=yes
short_desc="${short_desc/Python2/Python3} - development tools"
alternatives="
pyqt5:pylupdate5:/usr/bin/python3-pylupdate5
pyqt5:pyrcc5:/usr/bin/python3-pyrcc5
pyqt5:pyuic5:/usr/bin/python3-pyuic5"
pycompile_module="PyQt5"
pkg_install() {
vmove usr/bin/python3-*
vmove ${py3_sitelib}/PyQt5/pylupdate.so
vmove ${py3_sitelib}/PyQt5/pylupdate_main.py
vmove ${py3_sitelib}/PyQt5/pyrcc.so
vmove ${py3_sitelib}/PyQt5/pyrcc_main.py
}
}
python-PyQt5-devel_package() {
depends="python-sip-devel python3-sip-devel
python-PyQt5-${version}_${revision} python3-PyQt5-${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/share/sip
}
}
python-PyQt5-doc_package() {
noarch=yes
short_desc+=" - documentation files"
pkg_install() {
vmove usr/share/doc
}
}
python-PyQt5-dbus_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision} python-dbus"
short_desc+=" - dbus support"
pkg_install() {
vmove ${py2_sitelib}/dbus/mainloop/pyqt5.so
}
}
python-PyQt5-connectivity_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - connectivity module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtBluetooth.so
vmove ${py2_sitelib}/PyQt5/QtNfc.so
}
}
python-PyQt5-multimedia_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - multimedia module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtMultimedia.so
vmove ${py2_sitelib}/PyQt5/QtMultimediaWidgets.so
}
}
python-PyQt5-opengl_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - opengl module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtOpenGL.so
# QOpenGLFunctions is missing for arm*/aarch64* (mips* probably, too)
# cfgtest__QOpenGLFunctions_2_0.cpp:(.text.startup+0x10): undefined reference to 'QOpenGLFunctions_2_0::QOpenGLFunctions_2_0()'
if [ -e "$DESTDIR/${py2_sitelib}/PyQt5/_QOpenGLFunctions_2_0.so" ]; then
vmove ${py2_sitelib}/PyQt5/_QOpenGLFunctions_2_0.so
fi
}
}
python-PyQt5-location_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - location module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtLocation.so
vmove ${py2_sitelib}/PyQt5/QtPositioning.so
}
}
python-PyQt5-quick_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - quick module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtQml.so
vmove ${py2_sitelib}/PyQt5/QtQuick.so
vmove ${py2_sitelib}/PyQt5/QtQuickWidgets.so
}
}
python-PyQt5-sensors_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - sensors module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtSensors.so
}
}
python-PyQt5-serialport_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - serialport module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtSerialPort.so
}
}
python-PyQt5-sql_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - sql module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtSql.so
}
}
python-PyQt5-svg_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - svg module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtSvg.so
}
}
python-PyQt5-tools_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - designer, help modules"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtHelp.so
# /usr/lib/gcc/armv7l-linux-musleabihf/7.2.0/../../../../armv7l-linux-musleabihf/bin/ld: cannot find -lQt5Designer
# there is no libQt5Designer.so.* in qt5-tools for arm*/aarch64* (mips* probably, too)
if [ -e "$DESTDIR/${py2_sitelib}/PyQt5/QtDesigner.so" ]; then
vmove ${py2_sitelib}/PyQt5/QtDesigner.so
fi
}
}
python-PyQt5-webchannel_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - webchannel module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtWebChannel.so
}
}
python-PyQt5-webengine_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}
python-PyQt5-webchannel-${version}_${revision}"
short_desc+=" - webengine module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtWebEngine.so
vmove ${py2_sitelib}/PyQt5/QtWebEngineCore.so
vmove ${py2_sitelib}/PyQt5/QtWebEngineWidgets.so
}
}
python-PyQt5-webkit_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - webkit module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtWebKit.so
vmove ${py2_sitelib}/PyQt5/QtWebKitWidgets.so
}
}
python-PyQt5-websockets_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - websockets module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtWebSockets.so
}
}
python-PyQt5-x11extras_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - x11extras module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtX11Extras.so
}
}
python-PyQt5-xmlpatterns_package() {
lib32disabled=yes
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - xmlpatterns module"
pkg_install() {
vmove ${py2_sitelib}/PyQt5/QtXmlPatterns.so
}
}
python3-PyQt5_package() {
lib32disabled=yes
depends="python3-sip"
pycompile_module="PyQt5"
replaces="python3-PyQt5-enginio<5.7_1"
short_desc="${short_desc/Python2/Python3}"
pkg_install() {
vmove ${py3_sitelib}
}
}
python3-PyQt5-dbus_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision} python3-dbus"
short_desc="${short_desc/Python2/Python3} - dbus support"
pkg_install() {
vmove ${py3_sitelib}/dbus/mainloop/pyqt5.so
}
}
python3-PyQt5-connectivity_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - connectivity module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtBluetooth.so
vmove ${py3_sitelib}/PyQt5/QtNfc.so
}
}
python3-PyQt5-multimedia_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - multimedia module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtMultimedia.so
vmove ${py3_sitelib}/PyQt5/QtMultimediaWidgets.so
}
}
python3-PyQt5-opengl_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - opengl module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtOpenGL.so
# QOpenGLFunctions is missing for arm*/aarch64* (mips* probably, too)
# cfgtest__QOpenGLFunctions_2_0.cpp:(.text.startup+0x10): undefined reference to 'QOpenGLFunctions_2_0::QOpenGLFunctions_2_0()'
if [ -e "$DESTDIR/${py3_sitelib}/PyQt5/_QOpenGLFunctions_2_0.so" ]; then
vmove ${py3_sitelib}/PyQt5/_QOpenGLFunctions_2_0.so
fi
}
}
python3-PyQt5-location_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - location module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtLocation.so
vmove ${py3_sitelib}/PyQt5/QtPositioning.so
}
}
python3-PyQt5-quick_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - quick module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtQml.so
vmove ${py3_sitelib}/PyQt5/QtQuick.so
vmove ${py3_sitelib}/PyQt5/QtQuickWidgets.so
vmove usr/lib/qt5/plugins/PyQt5/libpyqt5qmlplugin.so
}
}
python3-PyQt5-sensors_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - sensors module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtSensors.so
}
}
python3-PyQt5-serialport_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - serialport module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtSerialPort.so
}
}
python3-PyQt5-sql_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - sql module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtSql.so
}
}
python3-PyQt5-svg_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - svg module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtSvg.so
}
}
python3-PyQt5-tools_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - designer, help modules"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtHelp.so
# /usr/lib/gcc/armv7l-linux-musleabihf/7.2.0/../../../../armv7l-linux-musleabihf/bin/ld: cannot find -lQt5Designer
# there is no libQt5Designer.so.* in qt5-tools for arm*/aarch64* (mips* probably, too)
if [ -e "$DESTDIR/${py3_sitelib}/PyQt5/QtDesigner.so" ]; then
vmove ${py3_sitelib}/PyQt5/QtDesigner.so
vmove usr/lib/qt5/plugins/designer/libpyqt5.so
fi
}
}
python3-PyQt5-webchannel_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - webchannel module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtWebChannel.so
}
}
python3-PyQt5-webengine_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}
python3-PyQt5-webchannel-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - webengine module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtWebEngine.so
vmove ${py3_sitelib}/PyQt5/QtWebEngineCore.so
vmove ${py3_sitelib}/PyQt5/QtWebEngineWidgets.so
}
}
python3-PyQt5-webkit_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - webkit module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtWebKit.so
vmove ${py3_sitelib}/PyQt5/QtWebKitWidgets.so
}
}
python3-PyQt5-websockets_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - websockets module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtWebSockets.so
}
}
python3-PyQt5-x11extras_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - x11extras module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtX11Extras.so
}
}
python3-PyQt5-xmlpatterns_package() {
lib32disabled=yes
depends="python3-PyQt5-${version}_${revision}"
short_desc="${short_desc/Python2/Python3} - xmlpatterns module"
pkg_install() {
vmove ${py3_sitelib}/PyQt5/QtXmlPatterns.so
}
}