qtwebkit: Fix build with ruby 3.2+

Ruby 3.2 removes Object#=~ completely

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Khem Raj
2023-01-05 19:36:06 -08:00
committed by Martin Jansa
parent b119822b56
commit 88c8564eb5
4 changed files with 50 additions and 69 deletions

View File

@@ -1,67 +0,0 @@
SUMMARY = "Python Qt5 Bindings"
AUTHOR = "Phil Thomson @ riverbank.co.uk"
HOMEPAGE = "https://www.riverbankcomputing.com/software/pyqt"
SECTION = "devel/python"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "\
file://LICENSE;md5=d32239bcb673463ab874e80d47fae504 \
"
inherit pypi
PYPI_PACKAGE = "PyQt5"
SRC_URI[md5sum] = "b60f895e70d31d774e6cd374efd17c65"
SRC_URI[sha256sum] = "d9a76b850246d08da9863189ecb98f6c2aa9b4d97a3e85e29330a264aed0f9a1"
S = "${WORKDIR}/PyQt5-${PV}"
inherit qmake5
inherit python3native python3-dir
DEPENDS = "qtbase qtdeclarative qtquickcontrols2"
DEPENDS += "sip3 sip3-native python3"
export BUILD_SYS
export HOST_SYS
export STAGING_INCDIR
export STAGING_LIBDIR
PARALLEL_MAKEINST = ""
DISABLED_FEATURES = "PyQt_Desktop_OpenGL PyQt_Accessibility PyQt_SessionManager ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '', 'PyQt_OpenGL', d)}"
PYQT_MODULES = "QtCore QtGui QtNetwork QtXml QtNetwork QtQml ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'QtQuick QtWidgets QtQuickWidgets', '', d)}"
do_configure:prepend() {
cd ${S}
echo "py_platform = linux" > pyqt.cfg
echo "py_inc_dir = %(sysroot)/$includedir/python%(py_major).%(py_minor)${PYTHON_ABI}" >> pyqt.cfg
echo "py_pylib_dir = %(sysroot)/${libdir}/python%(py_major).%(py_minor)" >> pyqt.cfg
echo "py_pylib_lib = python$%(py_major).%(py_minor)" >> pyqt.cfg
echo "pyqt_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> pyqt.cfg
echo "pyqt_bin_dir = ${D}/${bindir}" >> pyqt.cfg
echo "pyqt_sip_dir = ${D}/${datadir}/sip/PyQt5" >> pyqt.cfg
echo "pyuic_interpreter = ${D}/${bindir}/python%(py_major).%(py_minor)" >> pyqt.cfg
echo "pyqt_disabled_features = ${DISABLED_FEATURES}" >> pyqt.cfg
echo "qt_shared = True" >> pyqt.cfg
QT_VERSION=`${OE_QMAKE_QMAKE} -query QT_VERSION`
echo "[Qt $QT_VERSION]" >> pyqt.cfg
echo "pyqt_modules = ${PYQT_MODULES}" >> pyqt.cfg
echo yes | ${PYTHON} configure.py --verbose --qmake ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake --configuration pyqt.cfg --sysroot ${STAGING_DIR_HOST}
}
do_compile() {
cd ${S}
oe_runmake
}
do_install() {
cd ${S}
oe_runmake MAKEFLAGS='-j 1' install
}
FILES:${PN} += "${libdir}/${PYTHON_DIR}/site-packages ${datadir}/sip/PyQt5/"
RDEPENDS:${PN} = "qtbase qtdeclarative qtquickcontrols2 qtquickcontrols2-mkspecs"
RDEPENDS:${PN} += "python3-core python3-sip3"

View File

@@ -20,7 +20,7 @@ inherit qmake5
inherit python3native python3-dir
DEPENDS = "qtcharts"
DEPENDS += "sip3 sip3-native python3 python3-pyqt5"
DEPENDS += "sip sip-native python3 python3-pyqt5"
export BUILD_SYS
export HOST_SYS
@@ -66,4 +66,4 @@ do_install() {
FILES:${PN} += "${libdir}/${PYTHON_DIR}/site-packages ${datadir}/"
RDEPENDS:${PN} = "qtbase qtdeclarative qtquickcontrols2 qtquickcontrols2-mkspecs qtcharts"
RDEPENDS:${PN} += "python3-core python3-sip3 python3-pyqt5"
RDEPENDS:${PN} += "python3-core sip python3-pyqt5"

View File

@@ -0,0 +1,47 @@
From 330bdeeaa4389225c27d27188499543ddd184f69 Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Wed, 15 Jan 2020 22:15:38 +0000
Subject: [PATCH] Offlineasm warnings with newer Ruby versions
https://bugs.webkit.org/show_bug.cgi?id=206233
Reviewed by Yusuke Suzuki.
Avoid a warning about using Object#=~ on Annotation instances, which
has been deprecated in Ruby 2.7.
* offlineasm/parser.rb: Swap checks to prevent applying the =~ operator
to Annotation instances, which do not define it.
Canonical link: https://commits.webkit.org/219400@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
---
Source/JavaScriptCore/offlineasm/parser.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Source/JavaScriptCore/offlineasm/parser.rb b/Source/JavaScriptCore/offlineasm/parser.rb
index b44511245..cd1cffaec 100644
--- a/Source/JavaScriptCore/offlineasm/parser.rb
+++ b/Source/JavaScriptCore/offlineasm/parser.rb
@@ -584,9 +584,7 @@ class Parser
firstCodeOrigin = @tokens[@idx].codeOrigin
list = []
loop {
- if (@idx == @tokens.length and not final) or (final and @tokens[@idx] =~ final)
- break
- elsif @tokens[@idx].is_a? Annotation
+ if @tokens[@idx].is_a? Annotation
# This is the only place where we can encounter a global
# annotation, and hence need to be able to distinguish between
# them.
@@ -600,6 +598,8 @@ class Parser
list << Instruction.new(codeOrigin, annotationOpcode, [], @tokens[@idx].string)
@annotation = nil
@idx += 2 # Consume the newline as well.
+ elsif (@idx == @tokens.length and not final) or (final and @tokens[@idx] =~ final)
+ break
elsif @tokens[@idx] == "\n"
# ignore
@idx += 1
--
2.39.0

View File

@@ -24,6 +24,7 @@ SRC_URI += "\
file://0008-Fix-build-with-icu-68.patch \
file://0009-Riscv-Add-support-for-riscv.patch \
file://mips-atomic.patch \
file://0001-Offlineasm-warnings-with-newer-Ruby-versions-https-b.patch \
"
SRC_URI:append:riscv32 = " file://0010-webdriver-libatomic.patch "