python3-PyQt5-webengine: update to 5.15.3.

This commit is contained in:
Đoàn Trần Công Danh 2021-02-25 21:33:32 +07:00
parent e7014f682e
commit 85c5078c6d

View file

@ -1,177 +1,53 @@
# Template file for 'python3-PyQt5-webengine'
pkgname=python3-PyQt5-webengine
version=5.15.2
revision=2
version=5.15.3
revision=1
wrksrc="PyQtWebEngine-${version}"
build_helper="qmake"
hostmakedepends="pkg-config qt5-qmake python3-PyQt5-devel
sip python3-PyQt-builder"
makedepends="qt5-declarative-devel qt5-webchannel-devel qt5-location-devel
qt5-webengine-devel python3-devel python3-PyQt5-devel"
depends="python3-PyQt5>=${version}_1 python3-PyQt5-webchannel>=${version}_1"
depends="python3-PyQt5>=${version} python3-PyQt5-webchannel>=${version}"
short_desc="Python 3 bindings for the Qt5 toolkit - webengine module"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="GPL-3.0-only"
homepage="https://www.riverbankcomputing.com/software/pyqtwebengine/intro"
distfiles="${PYPI_SITE}/P/PyQtWebEngine/PyQtWebEngine-${version}.tar.gz"
checksum=4d72fea774071ce6f76e341a3d2c5d595886c9906a9b9493239c841cce54a634
checksum=0badc56e6c9ee2b7b4baa87511737d2a7f1de5a45f52b1da8f4965fc17dcf0b6
lib32disabled=yes
CXXFLAGS="-I$XBPS_CROSS_BASE/usr/include/python$py3_ver"
CXXFLAGS+=" -I$XBPS_CROSS_BASE/usr/include/qt5/QtWebChannel"
case "$XBPS_TARGET_MACHINE" in
ppc64le*) ;;
ppc*) broken="no webengine for big endian ppc";;
arm*) broken="depends on qt5-webengine";;
esac
if [ "$XBPS_TARGET_ENDIAN" != le ]; then
broken="no webengine for big endian"
fi
if [ "$XBPS_WORDSIZE" != "$XBPS_TARGET_WORDSIZE" ]; then
broken="webengine can be built only if word size matches"
fi
post_extract() {
rm -rf pyuic/uic/port_v2
}
_cross_configure() {
local qplatformdefs="/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"
mkdir -p "${wrksrc}/.target-spec/linux-g++"
cat >"${wrksrc}/.target-spec/linux-g++/qmake.conf" <<-_EOF
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental no_qt_rpath
QMAKE_INCREMENTAL_STYLE = sublib
include(/usr/lib/qt5/mkspecs/common/linux.conf)
include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
QMAKEMODULES = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/modules
QMAKE_CC = ${CC}
QMAKE_CXX = ${CXX}
QMAKE_LINK = ${CXX}
QMAKE_LINK_C = ${CC}
QMAKE_LINK_SHLIB = ${CXX}
QMAKE_AR = ${XBPS_CROSS_TRIPLET}-gcc-ar cqs
QMAKE_OBJCOPY = ${OBJCOPY}
QMAKE_NM = ${NM} -P
QMAKE_STRIP = ${STRIP}
QMAKE_CFLAGS = ${CFLAGS}
QMAKE_CXXFLAGS = ${CXXFLAGS}
QMAKE_LFLAGS = ${LDFLAGS}
INCPATH = $XBPS_CROSS_BASE/usr/include/python$py3_ver
INCPATH += $XBPS_CROSS_BASE/usr/include/qt5/QtWebChannel
load(qt_config)
_EOF
ln -sf ${XBPS_CROSS_BASE}$qplatformdefs ${wrksrc}/.target-spec/linux-g++/
mkdir -p "${wrksrc}/.host-spec/linux-g++"
cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<-_EOF
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental no_qt_rpath
QMAKE_INCREMENTAL_STYLE = sublib
include(/usr/lib/qt5/mkspecs/common/linux.conf)
include(/usr/lib/qt5/mkspecs/common/gcc-base-unix.conf)
include(/usr/lib/qt5/mkspecs/common/g++-unix.conf)
QMAKE_TARGET_CONFIG = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qconfig.pri
QMAKE_TARGET_MODULE = ${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/qmodule.pri
QMAKE_CC = ${CC_FOR_BUILD}
QMAKE_CXX = ${CXX_FOR_BUILD}
QMAKE_LINK = ${CXX_FOR_BUILD}
QMAKE_LINK_C = ${CC_FOR_BUILD}
QMAKE_LINK_SHLIB = ${CXX_FOR_BUILD}
QMAKE_AR = gcc-ar cqs
QMAKE_OBJCOPY = ${OBJCOPY_FOR_BUILD}
QMAKE_NM = ${NM_FOR_BUILD} -P
QMAKE_STRIP = ${STRIP_FOR_BUILD}
QMAKE_CFLAGS = ${CFLAGS_FOR_BUILD}
QMAKE_CXXFLAGS = ${CXXFLAGS_FOR_BUILD}
QMAKE_LFLAGS = ${LDFLAGS_FOR_BUILD}
load(qt_config)
_EOF
ln -sf $qplatformdefs ${wrksrc}/.host-spec/linux-g++/
cat > "$wrksrc/qt.conf" <<-_EOF
[Paths]
Sysroot=${XBPS_CROSS_BASE}
Prefix=/usr
ArchData=/usr/lib/qt5
Data=/usr/share/qt5
Documentation=/usr/share/doc/qt5
Headers=${XBPS_CROSS_BASE}/usr/include/qt5
Libraries=${XBPS_CROSS_BASE}/usr/lib
LibraryExecutables=/usr/lib/qt5/libexec
Binaries=/usr/lib/qt5/bin
Tests=${XBPS_CROSS_BASE}/usr/tests
Plugins=/usr/lib/qt5/plugins
Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/imports
Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/qml
Translations=${XBPS_CROSS_BASE}/usr/share/qt5/translations
Settings=${XBPS_CROSS_BASE}/etc/xdg
Examples=${XBPS_CROSS_BASE}/usr/share/qt5/examples
HostPrefix=/usr
HostData=/usr/lib/qt5
HostBinaries=/usr/lib/qt5/bin
HostLibraries=/usr/lib
Spec=$wrksrc/.host-spec/linux-g++
TargetSpec=$wrksrc/.target-spec/linux-g++
_EOF
case $XBPS_TARGET_MACHINE in
i686*) _qt_arch=i386;;
x86_64*) _qt_arch=x86_64;;
aarch64*) _qt_arch=arm64;;
arm*) _qt_arch=arm;;
mips*) _qt_arch=mips;;
esac
cat <<EOF >$XBPS_WRAPPERDIR/qmake
#!/bin/sh
export PREFIX=/usr
export QT_INSTALL_PREFIX=/usr
export LIB=/usr/lib
export QT_TARGET_ARCH=$_qt_arch
export PKG_CONFIG_EXECUTABLE=$XBPS_WRAPPERDIR/$PKG_CONFIG
case " \$* " in
" -query ")
/usr/lib/qt5/bin/qmake "\$@" -qtconf $wrksrc/qt.conf |
sed '/^QT_INSTALL_/s,$XBPS_CROSS_BASE,,'
;;
*)
exec /usr/lib/qt5/bin/qmake -qtconf $wrksrc/qt.conf "\$@" ;;
esac
EOF
}
do_configure() {
if [ "$CROSS_BUILD" ]; then
_cross_configure
else
cat >$XBPS_WRAPPERDIR/qmake <<-'_EOF'
#!/bin/sh
exec /usr/lib/qt5/bin/qmake "$@" CONFIG+=no_qt_rpath
_EOF
fi
chmod +x $XBPS_WRAPPERDIR/qmake
mkdir -p build
sip-build --no-make \
--api-dir /usr/share/qt5/qsci/api/python \
--build-dir build
if [ "$CROSS_BUILD" ]; then
# Fix location of python include
# -I/usr/include/python$py3_ver is set by sip-build :(
find build -name Makefile |
xargs sed -i "s,-I\\(/usr/include\\),-I$XBPS_CROSS_BASE\\1,g"
fi
}
do_build() {
cd build
make ${makejobs}
make -C build ${makejobs}
}
do_install() {
cd build
make DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
rm -rf ${DESTDIR}/usr/share
make -C build DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
}