Github messages for voidlinux
 help / color / mirror / Atom feed
From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Pyqt5 modernize and update to 5.15.1
Date: Mon, 28 Sep 2020 01:21:40 +0200	[thread overview]
Message-ID: <20200927232140.A_E3KgROSRjX22eVbidH9Tw_xaVzUdlLexJkpiZx2Zg@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-25128@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages pyqt5-modernize-update-to-5.15.1
https://github.com/void-linux/void-packages/pull/25128

Pyqt5 modernize and update to 5.15.1
- modernized since it's required for calibre

A patch file from https://github.com/void-linux/void-packages/pull/25128.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pyqt5-modernize-update-to-5.15.1-25128.patch --]
[-- Type: text/x-diff, Size: 21509 bytes --]

From c3ba2289e5e567dab21c39915071208752e71a3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 27 Sep 2020 14:14:53 +0700
Subject: [PATCH 1/2] python3-PyQt5: modernize

---
 .../patches/pyproject-cross.patch             |  18 ++
 srcpkgs/python3-PyQt5/template                | 252 ++++++++++++------
 2 files changed, 182 insertions(+), 88 deletions(-)
 create mode 100644 srcpkgs/python3-PyQt5/patches/pyproject-cross.patch

diff --git a/srcpkgs/python3-PyQt5/patches/pyproject-cross.patch b/srcpkgs/python3-PyQt5/patches/pyproject-cross.patch
new file mode 100644
index 00000000000..6acb1bfd787
--- /dev/null
+++ b/srcpkgs/python3-PyQt5/patches/pyproject-cross.patch
@@ -0,0 +1,18 @@
+--- project.py.orig	2020-09-27 14:28:27.338774698 +0700
++++ project.py	2020-09-27 14:28:29.317795099 +0700
+@@ -51,6 +51,15 @@
+             _QOpenGLFunctions_2_1, _QOpenGLFunctions_4_1_Core,
+             _QOpenGLFunctions_ES2, pylupdate, pyrcc]
+ 
++    def run_command(self, args, *, fatal=True):
++        """ Run a command and display the output if requested. """
++        qemu_machine = os.environ.get("XBPS_TARGET_QEMU_MACHINE")
++        builddir = os.environ.get("XBPS_BUILDDIR")
++        if qemu_machine and args[0].startswith(os.path.join(builddir, "PyQt5")):
++            qemu = "qemu-{}-static".format(qemu_machine)
++            args.insert(0, qemu)
++        super().run_command(args, fatal=fatal)
++
+     def apply_user_defaults(self, tool):
+         """ Set default values where needed. """
+ 
diff --git a/srcpkgs/python3-PyQt5/template b/srcpkgs/python3-PyQt5/template
index 25809d48dab..326c16b9be3 100644
--- a/srcpkgs/python3-PyQt5/template
+++ b/srcpkgs/python3-PyQt5/template
@@ -1,11 +1,12 @@
 # Template file for 'python3-PyQt5'
 pkgname=python3-PyQt5
 version=5.15.0
-revision=1
-_sipver=4.19.23
+revision=2
+_sipver=12.8.0
 wrksrc="PyQt5-${version}"
-hostmakedepends="pkg-config
- python3-devel sip5 python-dbus-devel qt5 qt5-devel qt5-tools-devel
+build_helper=qemu
+hostmakedepends="pkg-config qscintilla-qt5-devel python3-sip-PyQt5
+ python3-devel python-dbus-devel qt5 qt5-devel qt5-tools-devel python3-PyQt-builder
  qt5-connectivity-devel qt5-declarative-devel qt5-location-devel
  qt5-multimedia-devel qt5-qmake qt5-sensors-devel qt5-serialport-devel
  qt5-svg-devel qt5-webchannel-devel qt5-webkit-devel qt5-websockets-devel
@@ -24,51 +25,151 @@ post_extract() {
 	rm -rf pyuic/uic/port_v2
 }
 
-do_configure() {
-	local _sysroot= _configuration= qt_version
-	if [ "$CROSS_BUILD" ]; then
-		qt_version=$(qmake -query QT_VERSION)
-		_sysroot="--sysroot $XBPS_CROSS_BASE"
-		_configuration="--configuration $wrksrc/pyqt5_${XBPS_CROSS_TRIPLET}.cfg"
-		cat >pyqt5_${XBPS_CROSS_TRIPLET}.cfg <<EOF
-py_platform = linux
-py_inc_dir = %(sysroot)/usr/include/python%(py_major).%(py_minor)${py3_abiver}
-py_pyshlib = python%(py_major).%(py_minor)${py3_abiver}.so
-pyqt_disabled_features = PyQt_Desktop_OpenGL
+_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
+	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}
+	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}
+	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
+	QMAKE_INCREMENTAL_STYLE = sublib
 
-qt_shared = True
+	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)
 
-[Qt ${qt_version}]
-# _QOpenGLFunctions_ES2 doesn't work
-pyqt_modules = QtCore QtGui QtHelp QtMultimedia
- QtMultimediaWidgets QtNetwork QtOpenGL QtPrintSupport QtQml QtQuick
- QtSql QtSvg QtTest QtWebKit QtWebKitWidgets QtWidgets QtXml
- QtXmlPatterns QtDesigner QtDBus QtSensors QtSerialPort
- QtX11Extras QtBluetooth QtPositioning QtQuickWidgets QtWebSockets
- QtWebChannel QtLocation QtNfc QtNetworkAuth
-EOF
+	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=/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 >$XBPS_WRAPPERDIR/qmake <<_EOF
+#!/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
+	chmod +x $XBPS_WRAPPERDIR/qmake
+}
+
+do_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		_cross_configure
 	fi
 
-	python3 configure.py --confirm-license --assume-shared \
-		$_sysroot $_configuration \
-		QMAKE_CC="${CC}" QMAKE_CFLAGS="${CFLAGS}" \
-		QMAKE_CXX="${CXX}" QMAKE_CXXFLAGS="${CXXFLAGS}" \
-		QMAKE_LINK="${CXX}" QMAKE_LINK_SHLIB="${CXX}" \
-		QMAKE_LFLAGS="${LDFLAGS}" QMAKE_STRIP=""
+	mkdir -p build
+	sip-build --confirm-license --no-make \
+		--api-dir /usr/share/qt5/qsci/api/python \
+		--build-dir build
 
 	if [ "$CROSS_BUILD" ]; then
 		# Fix location of libraries
-		find . -name Makefile |
-		xargs sed -i -E "s|(/usr/lib/libQt5[^ ]+so)|${XBPS_CROSS_BASE}\1|g"
+		find build -name Makefile |
+		xargs sed -i "
+			s, \\(/usr/lib/libQt\\), $XBPS_CROSS_BASE\\1,g
+			s,-L\\(/usr/lib\\),-L$XBPS_CROSS_BASE\\1,g
+			/INSTALL_ROOT/s,$XBPS_CROSS_BASE,,g
+			s,-I\\(/usr/include\\),-I$XBPS_CROSS_BASE\\1,g
+			s,-I\\(/usr/lib\\),-I$XBPS_CROSS_BASE\\1,g
+			"
 	fi
 }
 
 do_build() {
+	cd build
 	make ${makejobs}
 }
 
 do_install() {
+	cd build
 	make DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
 	for f in pylupdate5 pyrcc5 pyuic5; do
 		sed -i '1s,python3[.0-9]*,python3,' ${DESTDIR}/usr/bin/${f}
@@ -85,11 +186,9 @@ python3-PyQt5-devel-tools_package() {
 	 pyqt5:pyrcc5:/usr/bin/python3-pyrcc5
 	 pyqt5:pyuic5:/usr/bin/python3-pyuic5"
 	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
+		vmove usr/bin
+		vmove "${py3_sitelib}/PyQt5/pylupdate*"
+		vmove "${py3_sitelib}/PyQt5/pyrcc*"
 	}
 }
 python3-PyQt5-devel_package() {
@@ -97,7 +196,7 @@ python3-PyQt5-devel_package() {
 	short_desc+=" - development files"
 	conflicts="python-PyQt5-devel>=0"
 	pkg_install() {
-		vmove usr/share/sip
+		vmove ${py3_sitelib}/PyQt5/bindings
 	}
 }
 python3-PyQt5-dbus_package() {
@@ -105,7 +204,7 @@ python3-PyQt5-dbus_package() {
 	depends="python3-PyQt5-${version}_${revision} python3-dbus"
 	short_desc="${short_desc} - dbus support"
 	pkg_install() {
-		vmove ${py3_sitelib}/dbus/mainloop/pyqt5.so
+		vmove ${py3_sitelib}/dbus
 	}
 }
 python3-PyQt5-connectivity_package() {
@@ -113,10 +212,8 @@ python3-PyQt5-connectivity_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - connectivity module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtBluetooth.pyi
-		vmove ${py3_sitelib}/PyQt5/QtBluetooth.so
-		vmove ${py3_sitelib}/PyQt5/QtNfc.pyi
-		vmove ${py3_sitelib}/PyQt5/QtNfc.so
+		vmove "${py3_sitelib}/PyQt5/QtBluetooth.*"
+		vmove "${py3_sitelib}/PyQt5/QtNfc.*"
 	}
 }
 python3-PyQt5-multimedia_package() {
@@ -124,10 +221,8 @@ python3-PyQt5-multimedia_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - multimedia module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtMultimedia.pyi
-		vmove ${py3_sitelib}/PyQt5/QtMultimedia.so
-		vmove ${py3_sitelib}/PyQt5/QtMultimediaWidgets.pyi
-		vmove ${py3_sitelib}/PyQt5/QtMultimediaWidgets.so
+		vmove "${py3_sitelib}/PyQt5/QtMultimedia.*"
+		vmove "${py3_sitelib}/PyQt5/QtMultimediaWidgets.*"
 	}
 }
 python3-PyQt5-networkauth_package() {
@@ -135,8 +230,7 @@ python3-PyQt5-networkauth_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - networkauth module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtNetworkAuth.pyi
-		vmove ${py3_sitelib}/PyQt5/QtNetworkAuth.so
+		vmove "${py3_sitelib}/PyQt5/QtNetworkAuth.*"
 	}
 }
 python3-PyQt5-opengl_package() {
@@ -144,10 +238,9 @@ python3-PyQt5-opengl_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - opengl module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtOpenGL.pyi
-		vmove ${py3_sitelib}/PyQt5/QtOpenGL.so
+		vmove "${py3_sitelib}/PyQt5/QtOpenGL.*"
 		if [ -z "$CROSS_BUILD" ]; then
-			vmove ${py3_sitelib}/PyQt5/_QOpenGLFunctions_*.so
+			vmove "${py3_sitelib}/PyQt5/_QOpenGLFunctions_*"
 		fi
 	}
 }
@@ -156,10 +249,8 @@ python3-PyQt5-location_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - location module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtLocation.pyi
-		vmove ${py3_sitelib}/PyQt5/QtLocation.so
-		vmove ${py3_sitelib}/PyQt5/QtPositioning.pyi
-		vmove ${py3_sitelib}/PyQt5/QtPositioning.so
+		vmove "${py3_sitelib}/PyQt5/QtLocation.*"
+		vmove "${py3_sitelib}/PyQt5/QtPositioning.*"
 	}
 }
 python3-PyQt5-quick_package() {
@@ -167,12 +258,9 @@ python3-PyQt5-quick_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - quick module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtQml.pyi
-		vmove ${py3_sitelib}/PyQt5/QtQml.so
-		vmove ${py3_sitelib}/PyQt5/QtQuick.pyi
-		vmove ${py3_sitelib}/PyQt5/QtQuick.so
-		vmove ${py3_sitelib}/PyQt5/QtQuickWidgets.pyi
-		vmove ${py3_sitelib}/PyQt5/QtQuickWidgets.so
+		vmove "${py3_sitelib}/PyQt5/QtQml.*"
+		vmove "${py3_sitelib}/PyQt5/QtQuick.*"
+		vmove "${py3_sitelib}/PyQt5/QtQuickWidgets.*"
 		vmove usr/lib/qt5/plugins/PyQt5/libpyqt5qmlplugin.so
 	}
 }
@@ -181,8 +269,7 @@ python3-PyQt5-sensors_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - sensors module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtSensors.pyi
-		vmove ${py3_sitelib}/PyQt5/QtSensors.so
+		vmove "${py3_sitelib}/PyQt5/QtSensors.*"
 	}
 }
 python3-PyQt5-serialport_package() {
@@ -190,8 +277,7 @@ python3-PyQt5-serialport_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - serialport module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtSerialPort.pyi
-		vmove ${py3_sitelib}/PyQt5/QtSerialPort.so
+		vmove "${py3_sitelib}/PyQt5/QtSerialPort.*"
 	}
 }
 python3-PyQt5-sql_package() {
@@ -199,8 +285,7 @@ python3-PyQt5-sql_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - sql module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtSql.pyi
-		vmove ${py3_sitelib}/PyQt5/QtSql.so
+		vmove "${py3_sitelib}/PyQt5/QtSql.*"
 	}
 }
 python3-PyQt5-svg_package() {
@@ -208,8 +293,7 @@ python3-PyQt5-svg_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - svg module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtSvg.pyi
-		vmove ${py3_sitelib}/PyQt5/QtSvg.so
+		vmove "${py3_sitelib}/PyQt5/QtSvg.*"
 	}
 }
 python3-PyQt5-tools_package() {
@@ -217,11 +301,9 @@ python3-PyQt5-tools_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - designer, help modules"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtHelp.pyi
-		vmove ${py3_sitelib}/PyQt5/QtHelp.so
-		vmove ${py3_sitelib}/PyQt5/QtDesigner.pyi
-		vmove ${py3_sitelib}/PyQt5/QtDesigner.so
-		vmove usr/lib/qt5/plugins/designer/libpyqt5.so
+		vmove "${py3_sitelib}/PyQt5/QtHelp.*"
+		vmove "${py3_sitelib}/PyQt5/QtDesigner.*"
+		vmove usr/lib/qt5/plugins/designer
 	}
 }
 python3-PyQt5-webchannel_package() {
@@ -229,8 +311,7 @@ python3-PyQt5-webchannel_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - webchannel module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtWebChannel.pyi
-		vmove ${py3_sitelib}/PyQt5/QtWebChannel.so
+		vmove "${py3_sitelib}/PyQt5/QtWebChannel.*"
 	}
 }
 python3-PyQt5-webkit_package() {
@@ -238,10 +319,8 @@ python3-PyQt5-webkit_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - webkit module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtWebKit.pyi
-		vmove ${py3_sitelib}/PyQt5/QtWebKit.so
-		vmove ${py3_sitelib}/PyQt5/QtWebKitWidgets.pyi
-		vmove ${py3_sitelib}/PyQt5/QtWebKitWidgets.so
+		vmove "${py3_sitelib}/PyQt5/QtWebKit.*"
+		vmove "${py3_sitelib}/PyQt5/QtWebKitWidgets.*"
 	}
 }
 python3-PyQt5-websockets_package() {
@@ -249,8 +328,7 @@ python3-PyQt5-websockets_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - websockets module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtWebSockets.pyi
-		vmove ${py3_sitelib}/PyQt5/QtWebSockets.so
+		vmove "${py3_sitelib}/PyQt5/QtWebSockets.*"
 	}
 }
 python3-PyQt5-x11extras_package() {
@@ -258,8 +336,7 @@ python3-PyQt5-x11extras_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - x11extras module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtX11Extras.pyi
-		vmove ${py3_sitelib}/PyQt5/QtX11Extras.so
+		vmove "${py3_sitelib}/PyQt5/QtX11Extras.*"
 	}
 }
 python3-PyQt5-xmlpatterns_package() {
@@ -267,7 +344,6 @@ python3-PyQt5-xmlpatterns_package() {
 	depends="python3-PyQt5-${version}_${revision}"
 	short_desc="${short_desc} - xmlpatterns module"
 	pkg_install() {
-		vmove ${py3_sitelib}/PyQt5/QtXmlPatterns.pyi
-		vmove ${py3_sitelib}/PyQt5/QtXmlPatterns.so
+		vmove "${py3_sitelib}/PyQt5/QtXmlPatterns.*"
 	}
 }

From f704a7fb42d31e47d11c71f66565cc76939d32d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 27 Sep 2020 14:13:48 +0700
Subject: [PATCH 2/2] python3-PyQt5-webengine: modernize

---
 srcpkgs/python3-PyQt5-webengine/template | 79 +++++++++++-------------
 1 file changed, 35 insertions(+), 44 deletions(-)

diff --git a/srcpkgs/python3-PyQt5-webengine/template b/srcpkgs/python3-PyQt5-webengine/template
index 0970f0dbaf9..a80107cb7ea 100644
--- a/srcpkgs/python3-PyQt5-webengine/template
+++ b/srcpkgs/python3-PyQt5-webengine/template
@@ -1,9 +1,10 @@
 # Template file for 'python3-PyQt5-webengine'
 pkgname=python3-PyQt5-webengine
 version=5.15.0
-revision=1
+revision=2
 wrksrc="PyQtWebEngine-${version}"
 hostmakedepends="pkg-config qt5-qmake python3-PyQt5 sip5 qt5-webengine-devel
+ python3-PyQt-builder python3-PyQt5-devel
  qt5-declarative-devel qt5-webchannel-devel qt5-location-devel"
 makedepends="qt5-declarative-devel qt5-webchannel-devel qt5-location-devel
  qt5-webengine-devel python3-devel python3-PyQt5-devel"
@@ -27,10 +28,10 @@ post_extract() {
 }
 
 _cross_configure() {
-	local qmakespec=$XBPS_STATEDIR/qmake-$XBPS_TARGET_MACHINE
-	mkdir -p $qmakespec/target/linux-g++
-	# This is copied from qmake build-style
-	cat > "$qmakespec/target/linux-g++/qmake.conf" <<-_EOF
+	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
 	QMAKE_INCREMENTAL_STYLE = sublib
@@ -57,14 +58,10 @@ _cross_configure() {
 	QMAKE_LFLAGS            = ${LDFLAGS}
 	load(qt_config)
 	_EOF
+	ln -sf ${XBPS_CROSS_BASE}$qplatformdefs ${wrksrc}/.target-spec/linux-g++/
 
-	cat <<-EOF > "$qmakespec/target/linux-g++/qplatformdefs.h"
-	#include "${XBPS_CROSS_BASE}/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"
-	EOF
-
-
-	mkdir -p $qmakespec/host/linux-g++
-	cat > "$qmakespec/host/linux-g++/qmake.conf" <<-_EOF
+	mkdir -p "${wrksrc}/.host-spec/linux-g++"
+	cat > "${wrksrc}/.host-spec/linux-g++/qmake.conf" <<-_EOF
 	MAKEFILE_GENERATOR      = UNIX
 	CONFIG                 += incremental
 	QMAKE_INCREMENTAL_STYLE = sublib
@@ -91,13 +88,9 @@ _cross_configure() {
 	QMAKE_LFLAGS            = ${LDFLAGS_FOR_BUILD}
 	load(qt_config)
 	_EOF
+	ln -sf $qplatformdefs ${wrksrc}/.host-spec/linux-g++/
 
-	cat <<-EOF > "$qmakespec/host/linux-g++/qplatformdefs.h"
-	#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"
-	EOF
-
-
-	cat > "$qmakespec/qt.conf" <<-_EOF
+	cat > "$wrksrc/qt.conf" <<-_EOF
 	[Paths]
 	Sysroot=${XBPS_CROSS_BASE}
 	Prefix=/usr
@@ -119,11 +112,10 @@ _cross_configure() {
 	HostData=/usr/lib/qt5
 	HostBinaries=/usr/lib/qt5/bin
 	HostLibraries=/usr/lib
-	Spec=$qmakespec/host/linux-g++
-	TargetSpec=$qmakespec/target/linux-g++
+	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;;
@@ -131,7 +123,7 @@ _cross_configure() {
 		arm*) _qt_arch=arm;;
 		mips*) _qt_arch=mips;;
 	esac
-	cat <<EOF >$XBPS_WRAPPERDIR/cross-qmake
+	cat <<EOF >$XBPS_WRAPPERDIR/qmake
 #!/bin/sh
 export PREFIX=/usr
 export QT_INSTALL_PREFIX=/usr
@@ -140,46 +132,45 @@ export QT_TARGET_ARCH=$_qt_arch
 export PKG_CONFIG_EXECUTABLE=$XBPS_WRAPPERDIR/$PKG_CONFIG
 case " \$* " in
 " -query ")
-	/usr/lib/qt5/bin/qmake "\$@" -qtconf $qmakespec/qt.conf |
+	/usr/lib/qt5/bin/qmake "\$@" -qtconf $wrksrc/qt.conf |
 	sed '/^QT_INSTALL_/s,$XBPS_CROSS_BASE,,'
 	;;
 *)
-	exec /usr/lib/qt5/bin/qmake -qtconf $qmakespec/qt.conf "\$@" ;;
+	exec /usr/lib/qt5/bin/qmake -qtconf $wrksrc/qt.conf "\$@" ;;
 esac
 EOF
-	chmod +x $XBPS_WRAPPERDIR/cross-qmake
-
-	python3 configure.py --qmake=$XBPS_WRAPPERDIR/cross-qmake \
-		--sysroot $XBPS_CROSS_BASE/usr
-	# Technically, the second sed expr isn't necessary
-	# since all of them are the same for both host and target.
-	# We need to fix INSTALL_ROOT anyway, let's fix it, too.
-	sed -i -e "/INSTALL_ROOT/s,$XBPS_CROSS_BASE,,g" \
-		-e "s,-I/usr/include,-I$XBPS_CROSS_BASE/usr/include,g" \
-		Makefile \
-		QtWebEngine/Makefile \
-		QtWebEngineCore/Makefile \
-		QtWebEngineWidgets/Makefile
-	sed -i -e "s,$XBPS_CROSS_BASE,,g" installed.txt
+	chmod +x $XBPS_WRAPPERDIR/qmake
 }
 
 do_configure() {
 	if [ "$CROSS_BUILD" ]; then
 		_cross_configure
-	else
-		python3 configure.py \
-			QMAKE_CC="${CC}" QMAKE_CFLAGS="${CFLAGS}" \
-			QMAKE_CXX="${CXX}" QMAKE_CXXFLAGS="${CXXFLAGS}" \
-			QMAKE_LINK="${CXX}" QMAKE_LINK_SHLIB="${CXX}"
-			QMAKE_LFLAGS="${LDFLAGS}" QMAKE_STRIP=""
+	fi
+	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 libraries
+		find build -name Makefile |
+		xargs sed -i "
+			s, \\(/usr/lib/libQt\\), $XBPS_CROSS_BASE\\1,g
+			s,-L\\(/usr/lib\\),-L$XBPS_CROSS_BASE\\1,g
+			/INSTALL_ROOT/s,$XBPS_CROSS_BASE,,g
+			s,-I\\(/usr/include\\),-I$XBPS_CROSS_BASE\\1,g
+			s,-I\\(/usr/lib\\),-I$XBPS_CROSS_BASE\\1,g
+			"
 	fi
 }
 
 do_build() {
+	cd build
 	make ${makejobs}
 }
 
 do_install() {
+	cd build
 	make DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
 	rm -rf ${DESTDIR}/usr/share
 }

  reply	other threads:[~2020-09-27 23:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-27  4:23 [PR PATCH] " sgn
2020-09-27 23:21 ` sgn [this message]
2020-09-28  0:44 ` [PR PATCH] [Updated] PyQt5 modernize and update to 5.15.1 (Prepare for Calibre 5.0.0) sgn
2020-09-28  0:45 ` sgn
2020-09-28  0:48 ` [PR PATCH] [Updated] Calibre 5.0.0, python3-PyQt5 build with sip-build sgn
2020-09-28  0:58 ` sgn
2020-09-28 12:52 ` sgn
2020-09-28 13:06 ` sgn
2020-09-28 14:31 ` sgn
2020-09-28 14:49 ` [PR PATCH] [Merged]: " sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200927232140.A_E3KgROSRjX22eVbidH9Tw_xaVzUdlLexJkpiZx2Zg@z \
    --to=sgn@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).