Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Pyqt5 modernize and update to 5.15.1
@ 2020-09-27  4:23 sgn
  2020-09-27 23:21 ` [PR PATCH] [Updated] " sgn
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: sgn @ 2020-09-27  4:23 UTC (permalink / raw)
  To: ml

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

There is a new 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: 19176 bytes --]

From b5cded8ab25cfd9847a403e3aa09f2dd00da5b92 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 10:10:02 +0700
Subject: [PATCH 1/2] python3-PyQt5: use modern sip-build

Calibre doesn't work with old layout.
---
 srcpkgs/python3-PyQt5/template | 242 +++++++++++++++++++++------------
 1 file changed, 156 insertions(+), 86 deletions(-)

diff --git a/srcpkgs/python3-PyQt5/template b/srcpkgs/python3-PyQt5/template
index 25809d48dabb..76b7ccd396ef 100644
--- a/srcpkgs/python3-PyQt5/template
+++ b/srcpkgs/python3-PyQt5/template
@@ -1,10 +1,10 @@
 # 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
+hostmakedepends="pkg-config qscintilla-qt5-devel python3-sip-PyQt5
  python3-devel sip5 python-dbus-devel qt5 qt5-devel qt5-tools-devel
  qt5-connectivity-devel qt5-declarative-devel qt5-location-devel
  qt5-multimedia-devel qt5-qmake qt5-sensors-devel qt5-serialport-devel
@@ -24,51 +24,146 @@ 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=$qmakespec/host/linux-g++
+	TargetSpec=$qmakespec/target/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 $qmakespec/qt.conf "\$@" ;;
+esac
+_EOF
+	chmod +x $XBPS_CROSS_BASE/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 \
+		--pep484-pyi
 
 	if [ "$CROSS_BUILD" ]; then
 		# Fix location of libraries
-		find . -name Makefile |
+		find build -name Makefile |
 		xargs sed -i -E "s|(/usr/lib/libQt5[^ ]+so)|${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 +180,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 +190,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 +198,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 +206,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 +215,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 +224,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 +232,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 +243,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 +252,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 +263,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 +271,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 +279,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 +287,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 +295,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 +305,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 +313,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 +322,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 +330,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 +338,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 9f60eacd06f31883cfcecf858bd32b62fed1d663 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 11:20:07 +0700
Subject: [PATCH 2/2] python3-PyQt5-webengine: build with sip-build

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

diff --git a/srcpkgs/python3-PyQt5-webengine/template b/srcpkgs/python3-PyQt5-webengine/template
index 0970f0dbaf99..8036782f3667 100644
--- a/srcpkgs/python3-PyQt5-webengine/template
+++ b/srcpkgs/python3-PyQt5-webengine/template
@@ -1,7 +1,7 @@
 # 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
  qt5-declarative-devel qt5-webchannel-devel qt5-location-devel"
@@ -27,10 +27,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 +57,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
@@ -95,9 +91,10 @@ _cross_configure() {
 	cat <<-EOF > "$qmakespec/host/linux-g++/qplatformdefs.h"
 	#include "/usr/lib/qt5/mkspecs/linux-g++/qplatformdefs.h"
 	EOF
+	ln -sf $qplatformdefs ${wrksrc}/.host-spec/linux-g++/
 
 
-	cat > "$qmakespec/qt.conf" <<-_EOF
+	cat > "$wrksrc/qt.conf" <<-_EOF
 	[Paths]
 	Sysroot=${XBPS_CROSS_BASE}
 	Prefix=/usr
@@ -123,7 +120,6 @@ _cross_configure() {
 	TargetSpec=$qmakespec/target/linux-g++
 	_EOF
 
-
 	case $XBPS_TARGET_MACHINE in
 		i686*) _qt_arch=i386;;
 		x86_64*) _qt_arch=x86_64;;
@@ -140,46 +136,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 "\$@" ;;
 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 \
+		--pep484-pyi
+
+	if [ "$CROSS_BUILD" ]; then
+		# Fix location of libraries
+		find build -name Makefile |
+		xargs sed -i -E "
+			s|(/usr/lib/libQt5[^ ]+so)|${XBPS_CROSS_BASE}\1|g
+			/INSTALL_ROOT/s,$XBPS_CROSS_BASE,,g
+			s,-I/usr/include,-I$XBPS_CROSS_BASE/usr/include,g
+			"
+		sed -i -e "s,$XBPS_CROSS_BASE,,g" installed.txt
 	fi
 }
 
 do_build() {
+	cd build
 	make ${makejobs}
 }
 
 do_install() {
+	cd build
 	make DESTDIR=${DESTDIR} INSTALL_ROOT=${DESTDIR} install
 	rm -rf ${DESTDIR}/usr/share
 }

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-09-28 14:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27  4:23 [PR PATCH] Pyqt5 modernize and update to 5.15.1 sgn
2020-09-27 23:21 ` [PR PATCH] [Updated] " sgn
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

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).