From 2f7f587547de78523d88081d50d96912ee947304 Mon Sep 17 00:00:00 2001 From: yopito Date: Sat, 23 Jan 2021 19:58:31 +0100 Subject: [PATCH] python3-pyside2: update to 5.15.2, testing support, remove dummy packages --- common/shlibs | 2 - srcpkgs/libpyside-python3 | 1 - srcpkgs/python3-pyenet | 1 - srcpkgs/python3-pyside | 1 - srcpkgs/python3-pyside-phonon | 1 - .../patches/crossbuild-for-shiboken2.patch | 18 +-- .../patches/tests-correct-build_dir.patch | 14 +++ .../patches/tests-disable-invalid-ones.patch | 74 ++++++++++++ ...tests-find-python-modules-from-build.patch | 21 ++++ .../patches/tests-python-syntax.patch | 106 ++++++++++++++++++ srcpkgs/python3-pyside2/template | 71 ++++++------ 11 files changed, 263 insertions(+), 47 deletions(-) delete mode 120000 srcpkgs/libpyside-python3 delete mode 120000 srcpkgs/python3-pyenet delete mode 120000 srcpkgs/python3-pyside delete mode 120000 srcpkgs/python3-pyside-phonon create mode 100644 srcpkgs/python3-pyside2/patches/tests-correct-build_dir.patch create mode 100644 srcpkgs/python3-pyside2/patches/tests-disable-invalid-ones.patch create mode 100644 srcpkgs/python3-pyside2/patches/tests-find-python-modules-from-build.patch create mode 100644 srcpkgs/python3-pyside2/patches/tests-python-syntax.patch diff --git a/common/shlibs b/common/shlibs index c6f930b953a..48d6076467a 100644 --- a/common/shlibs +++ b/common/shlibs @@ -1678,8 +1678,6 @@ libgtkglext-x11-1.0.so.0 gtkglext-1.2.0_4 libgdkglext-x11-1.0.so.0 gtkglext-1.2.0_4 libXaw3d.so.8 libXaw3d-1.6.2_1 libshiboken2.so.5.15 libshiboken2-5.15.0_1 -libpyside-python2.7.so.1.2 libpyside-python-1.2.2_2 -libpyside-python3.6.so.1.2 libpyside-python3-1.2.2_6 libpyside2.so.5.15 libpyside2-python3-5.15.0_1 libupsclient.so.4 libnetwork-ups-tools-2.7.2_1 libnutclient.so.0 libnetwork-ups-tools-2.7.2_1 diff --git a/srcpkgs/libpyside-python3 b/srcpkgs/libpyside-python3 deleted file mode 120000 index bb1745350a8..00000000000 --- a/srcpkgs/libpyside-python3 +++ /dev/null @@ -1 +0,0 @@ -python3-pyside2 \ No newline at end of file diff --git a/srcpkgs/python3-pyenet b/srcpkgs/python3-pyenet deleted file mode 120000 index bb1745350a8..00000000000 --- a/srcpkgs/python3-pyenet +++ /dev/null @@ -1 +0,0 @@ -python3-pyside2 \ No newline at end of file diff --git a/srcpkgs/python3-pyside b/srcpkgs/python3-pyside deleted file mode 120000 index bb1745350a8..00000000000 --- a/srcpkgs/python3-pyside +++ /dev/null @@ -1 +0,0 @@ -python3-pyside2 \ No newline at end of file diff --git a/srcpkgs/python3-pyside-phonon b/srcpkgs/python3-pyside-phonon deleted file mode 120000 index bb1745350a8..00000000000 --- a/srcpkgs/python3-pyside-phonon +++ /dev/null @@ -1 +0,0 @@ -python3-pyside2 \ No newline at end of file diff --git a/srcpkgs/python3-pyside2/patches/crossbuild-for-shiboken2.patch b/srcpkgs/python3-pyside2/patches/crossbuild-for-shiboken2.patch index 5a071a33d20..daad1fea702 100644 --- a/srcpkgs/python3-pyside2/patches/crossbuild-for-shiboken2.patch +++ b/srcpkgs/python3-pyside2/patches/crossbuild-for-shiboken2.patch @@ -1,11 +1,11 @@ --- sources/pyside2/cmake/Macros/PySideModules.cmake.ORIG +++ sources/pyside2/cmake/Macros/PySideModules.cmake -@@ -123,7 +123,7 @@ - BYPRODUCTS ${${module_SOURCES}} - COMMAND Shiboken2::shiboken2 ${GENERATOR_EXTRA_FLAGS} - "${pyside2_BINARY_DIR}/${module_NAME}_global.h" -- --include-paths=${shiboken_include_dirs} -+ --include-paths=${shiboken_include_dirs}${PATH_SEP}${CMAKE_FIND_ROOT_PATH}/usr/include - ${shiboken_framework_include_dirs_option} - --typesystem-paths=${pyside_binary_dir}${PATH_SEP}${pyside2_SOURCE_DIR}${PATH_SEP}${${module_TYPESYSTEM_PATH}} - --output-directory=${CMAKE_CURRENT_BINARY_DIR} +@@ -94,7 +94,7 @@ + # Workaround: Added ${QT_INCLUDE_DIR}/QtCore until + # qtdeclarative/8d560d1bf0a747bf62f73fad6b6774095442d9d2 has reached qt5.git + string(REPLACE ";" ${PATH_SEP} core_includes "${Qt5Core_INCLUDE_DIRS}") +- set(shiboken_include_dirs ${pyside2_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${core_includes}) ++ set(shiboken_include_dirs ${pyside2_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}${PATH_SEP}${core_includes}${PATH_SEP}${CMAKE_FIND_ROOT_PATH}/usr/include) + set(shiboken_framework_include_dirs_option "") + if(CMAKE_HOST_APPLE) + set(shiboken_framework_include_dirs "${QT_FRAMEWORK_INCLUDE_DIR}") diff --git a/srcpkgs/python3-pyside2/patches/tests-correct-build_dir.patch b/srcpkgs/python3-pyside2/patches/tests-correct-build_dir.patch new file mode 100644 index 00000000000..540e4304958 --- /dev/null +++ b/srcpkgs/python3-pyside2/patches/tests-correct-build_dir.patch @@ -0,0 +1,14 @@ +Reported upstream: https://bugreports.qt.io/browse/PYSIDE-1430 + +--- sources/pyside2/tests/CMakeLists.txt.ORIG 2020-11-11 13:51:30.000000000 +0100 ++++ sources/pyside2/tests/CMakeLists.txt 2020-11-24 11:42:34.629110123 +0100 +@@ -7,8 +7,7 @@ + + # BUILD_DIR and QT_DIR are used by init_paths.py for setting + # the path to the testbinding module +- get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY) +- get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY) ++ set(BUILD_DIR "${CMAKE_BINARY_DIR}") + set(QT_DIR "${_qt5Core_install_prefix}") + + macro(TEST_QT_MODULE var name) diff --git a/srcpkgs/python3-pyside2/patches/tests-disable-invalid-ones.patch b/srcpkgs/python3-pyside2/patches/tests-disable-invalid-ones.patch new file mode 100644 index 00000000000..ca4894b6fa9 --- /dev/null +++ b/srcpkgs/python3-pyside2/patches/tests-disable-invalid-ones.patch @@ -0,0 +1,74 @@ +Disable failing tests. Almost of these are related to OpenGL that is +unsupported by vnc virtual backend. + +Raw testing Status: 98% tests passed, 9 tests failed out of 471 + +--- sources/pyside2/tests/QtDataVisualization/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/QtDataVisualization/CMakeLists.txt +@@ -1 +0,0 @@ +-PYSIDE_TEST(datavisualization_test.py) +--- sources/pyside2/tests/QtGui/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/QtGui/CMakeLists.txt +@@ -20,14 +20,12 @@ + PYSIDE_TEST(qcolor_test.py) + PYSIDE_TEST(qcolor_reduce_test.py) + PYSIDE_TEST(qcursor_test.py) +-PYSIDE_TEST(qdatastream_gui_operators_test.py) + PYSIDE_TEST(qdesktopservices_test.py) + PYSIDE_TEST(qfontmetrics_test.py) + PYSIDE_TEST(qguiapplication_test.py) + PYSIDE_TEST(qicon_test.py) + PYSIDE_TEST(qitemselection_test.py) + PYSIDE_TEST(qmatrix_test.py) +-PYSIDE_TEST(qopenglbuffer_test.py) + PYSIDE_TEST(qpainter_test.py) + PYSIDE_TEST(qpdfwriter_test.py) + PYSIDE_TEST(qpixelformat_test.py) +--- sources/pyside2/tests/QtOpenGL/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/QtOpenGL/CMakeLists.txt +@@ -1,2 +1 @@ +-PYSIDE_TEST(qglbuffer_test.py) + PYSIDE_TEST(qglwidget_test.py) +--- sources/pyside2/tests/QtScriptTools/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/QtScriptTools/CMakeLists.txt +@@ -1 +0,0 @@ +-PYSIDE_TEST(debugger_test.py) +--- sources/pyside2/tests/QtWebEngineCore/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/QtWebEngineCore/CMakeLists.txt +@@ -26,4 +26,3 @@ + ## + ############################################################################# + +-PYSIDE_TEST(web_engine_custom_scheme.py) +--- sources/pyside2/tests/QtWebEngineWidgets/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/QtWebEngineWidgets/CMakeLists.txt +@@ -26,4 +26,3 @@ + ## + ############################################################################# + +-PYSIDE_TEST(pyside-474-qtwebengineview.py) +--- sources/pyside2/tests/QtWidgets/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/QtWidgets/CMakeLists.txt +@@ -6,7 +6,6 @@ + PYSIDE_TEST(application_test.py) + PYSIDE_TEST(bug_172.py) + PYSIDE_TEST(bug_243.py) +-PYSIDE_TEST(bug_307.py) + PYSIDE_TEST(bug_324.py) + PYSIDE_TEST(bug_338.py) + PYSIDE_TEST(bug_363.py) +@@ -131,7 +131,6 @@ + PYSIDE_TEST(qtoolbox_test.py) + PYSIDE_TEST(qvariant_test.py) + PYSIDE_TEST(qwidget_setlayout_test.py) +-PYSIDE_TEST(qwidget_test.py) + PYSIDE_TEST(qcolormap_test.py) + PYSIDE_TEST(reference_count_test.py) + PYSIDE_TEST(signature_test.py) +--- sources/pyside2/tests/registry/CMakeLists.txt.ORIG ++++ sources/pyside2/tests/registry/CMakeLists.txt +@@ -37,4 +37,3 @@ + ## + ############################################################################# + +-PYSIDE_TEST(existence_test.py) diff --git a/srcpkgs/python3-pyside2/patches/tests-find-python-modules-from-build.patch b/srcpkgs/python3-pyside2/patches/tests-find-python-modules-from-build.patch new file mode 100644 index 00000000000..673998bc049 --- /dev/null +++ b/srcpkgs/python3-pyside2/patches/tests-find-python-modules-from-build.patch @@ -0,0 +1,21 @@ +tests need python modules that are not installed yet: point the built ones. +Reported upstream: https://bugreports.qt.io/browse/PYSIDE-1430 + +--- sources/pyside2/tests/init_paths.py.ORIG 2020-11-11 13:51:30.000000000 +0100 ++++ sources/pyside2/tests/init_paths.py 2020-11-21 23:36:33.131282473 +0100 +@@ -75,12 +75,12 @@ + + python_dirs = [os.path.join(src_dir, 'util')] # Helper module + +- pyside_build_dir = os.path.join(get_build_dir(), 'pyside2') +- python_dirs.append(pyside_build_dir) # for PySide2 ++ pyside_build_dir = os.path.join(get_build_dir(), 'PySide2') ++ python_dirs.append(get_build_dir()) # for PySide2 + lib_dirs = [os.path.join(pyside_build_dir, 'libpyside')] + + if testbindings_module: +- python_dirs.append(os.path.join(pyside_build_dir, ++ python_dirs.append(os.path.join(get_build_dir(), + 'tests', 'pysidetest')) + lib_dirs.append(_get_qt_lib_dir()) + diff --git a/srcpkgs/python3-pyside2/patches/tests-python-syntax.patch b/srcpkgs/python3-pyside2/patches/tests-python-syntax.patch new file mode 100644 index 00000000000..2c2e1367907 --- /dev/null +++ b/srcpkgs/python3-pyside2/patches/tests-python-syntax.patch @@ -0,0 +1,106 @@ +This changeset is about both shiboken2 and python3-pyside2 +(that are separated packages) +upstream: yes + +From c6184e01e993dcca9798f306fb8e9cb322fdd0dc Mon Sep 17 00:00:00 2001 +From: Christian Tismer +Date: Thu, 3 Dec 2020 13:38:58 +0100 +Subject: [PATCH] fix both qflags_test and the qflags cppgenerator code + +There was a years-old qflags test failing on Python 3. +It was blacklisted with the comment + + "# Nested exception in Python 3" + +This was nonsense: The test was wrong also for Python 2. +It just happened to work, because Python 2 had some weird +errors leaking. The real bug was in missing error handling +in cppgenerator.cpp . + +See the main description in the issue. + +Change-Id: Ia0f9466640e0eb33f1b8b26178d33f2be0bcb32f +Task-number: PYSIDE-1442 +Reviewed-by: Friedemann Kleint +(cherry picked from commit 288fadb796ec4e11e99e3752d531ada7edf15d75) +--- + build_history/blacklist.txt | 3 --- + sources/pyside2/tests/QtCore/qflags_test.py | 12 +++++++----- + .../shiboken2/generator/shiboken2/cppgenerator.cpp | 2 ++ + 3 files changed, 9 insertions(+), 8 deletions(-) + +diff --git build_history/blacklist.txt build_history/blacklist.txt +index 9b63f9784..2a2a5d4c4 100644 +--- build_history/blacklist.txt ++++ build_history/blacklist.txt +@@ -18,9 +18,6 @@ + darwin py3 + [QtCore::qfileread_test] + darwin +-# Nested exception in Python 3 +-[QtCore::qflags_test] +- py3 + [QtCore::qobject_connect_notify_test] + linux + darwin +diff --git sources/pyside2/tests/QtCore/qflags_test.py sources/pyside2/tests/QtCore/qflags_test.py +index 08a7c55b1..e1e989c1e 100644 +--- sources/pyside2/tests/QtCore/qflags_test.py ++++ sources/pyside2/tests/QtCore/qflags_test.py +@@ -30,6 +30,7 @@ + + '''Test cases for QFlags''' + ++import operator + import os + import sys + import unittest +@@ -117,12 +118,13 @@ class QFlagsOnQVariant(unittest.TestCase): + class QFlagsWrongType(unittest.TestCase): + def testWrongType(self): + '''Wrong type passed to QFlags binary operators''' ++ for op in operator.or_, operator.and_, operator.xor: ++ for x in '43', 'jabba', QObject, object: ++ self.assertRaises(TypeError, op, Qt.NoItemFlags, x) ++ self.assertRaises(TypeError, op, x, Qt.NoItemFlags) ++ # making sure this actually does not fail all the time ++ self.assertEqual(operator.or_(Qt.NoItemFlags, 43), 43) + +- self.assertRaises(TypeError, Qt.NoItemFlags | '43') +- self.assertRaises(TypeError, Qt.NoItemFlags & '43') +- self.assertRaises(TypeError, 'jabba' & Qt.NoItemFlags) +- self.assertRaises(TypeError, 'hut' & Qt.NoItemFlags) +- self.assertRaises(TypeError, Qt.NoItemFlags & QObject()) + + if __name__ == '__main__': + unittest.main() +diff --git sources/shiboken2/generator/shiboken2/cppgenerator.cpp sources/shiboken2/generator/shiboken2/cppgenerator.cpp +index ff44db955..87ddd73a5 100644 +--- sources/shiboken2/generator/shiboken2/cppgenerator.cpp ++++ sources/shiboken2/generator/shiboken2/cppgenerator.cpp +@@ -5230,6 +5230,8 @@ void CppGenerator::writeFlagsBinaryOperator(QTextStream &s, const AbstractMetaEn + s << INDENT << "cppArg = static_cast<" << flagsEntry->originalName() + << ">(int(PyInt_AsLong(" << PYTHON_ARG << ")));\n"; + s << "#endif\n\n"; ++ s << INDENT << "if (PyErr_Occurred())\n" << indent(INDENT) ++ << INDENT << "return nullptr;\n" << outdent(INDENT); + s << INDENT << "cppResult = " << CPP_SELF_VAR << " " << cppOpName << " cppArg;\n"; + s << INDENT << "return "; + writeToPythonConversion(s, flagsType, nullptr, QLatin1String("cppResult")); +-- +2.29.2 + +Fix python warning about 'is not' usage. +This diff is DISTINCT from the previous patch + +--- sources/pyside2/tests/QtWidgets/qwidget_test.py 2020-11-11 13:51:30.000000000 +0100 ++++ sources/pyside2/tests/QtWidgets/qwidget_test.py 2020-11-24 14:28:06.103093649 +0100 +@@ -73,7 +73,7 @@ + self.assertTrue(not widget.isVisible()) + widget.setVisible(True) + self.assertTrue(widget.isVisible()) +- self.assertTrue(widget.winId() is not 0) ++ self.assertTrue(widget.winId() != 0) + # skip this test on macOS since no native events are received + if sys.platform == 'darwin': + return diff --git a/srcpkgs/python3-pyside2/template b/srcpkgs/python3-pyside2/template index fe69087e4d0..6040ef39243 100644 --- a/srcpkgs/python3-pyside2/template +++ b/srcpkgs/python3-pyside2/template @@ -1,12 +1,12 @@ # Template file for 'python3-pyside2' pkgname=python3-pyside2 -version=5.15.0 -revision=2 +version=5.15.2 +revision=1 _pkgname="pyside-setup-opensource-src-${version}" wrksrc="${_pkgname/%5.14.2.1/5.14.2}" build_wrksrc="sources/pyside2" build_style=cmake -configure_args="-DBUILD_TESTS=OFF -DPYTHON_EXECUTABLE=/usr/bin/python" +configure_args="-DPYTHON_EXECUTABLE=/usr/bin/python" hostmakedepends="cmake python3 shiboken2" makedepends="python3-devel libshiboken2-devel qt5-devel qt5-multimedia-devel qt5-tools-devel qt5-plugin-mysql qt5-plugin-odbc @@ -18,34 +18,61 @@ makedepends="python3-devel libshiboken2-devel qt5-devel qt5-serialport-devel $(vopt_if webengine 'qt5-webengine-devel')" depends="python3-shiboken2" +checkdepends="python3-distro tzdata pulseaudio qt5-quickcontrols" short_desc="Python3 bindings for the Qt5 toolkit" maintainer="yopito " license="LGPL-3.0-or-later" homepage="https://wiki.qt.io/Qt_for_Python" distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz" -checksum=f1cdee53de3b76e22c1117a014a91ed95ac16e4760776f4f12dc38cd5a7b6b68 +checksum=b306504b0b8037079a8eab772ee774b9e877a2d84bab2dbefbe4fa6f83941418 + +build_options="webengine" +desc_option_webengine="Build Qt5 WebEngine bindings" + +subpackages="libpyside2-python3-devel libpyside2-python3" # needed by shiboken2 runtime -export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr +export CLANG_INSTALL_DIR=/usr if [ ${CROSS_BUILD} ]; then hostmakedepends+=" qt5-qmake qt5-host-tools qt5-tools qt5-remoteobjects qt5-scxml" fi -build_options="webengine" -desc_option_webengine="Build Qt5 WebEngine bindings" - if [ "$XBPS_TARGET_ENDIAN" = "le" ]; then - build_options_default="webengine" + if [ "$XBPS_TARGET_WORDSIZE" = "$XBPS_WORDSIZE" ]; then + build_options_default="webengine" + fi fi -subpackages="libpyside2-python3-devel libpyside2-python3 libpyside-python3 - python3-pyside python3-pyside-phonon python3-pyenet" - if [ "$build_option_webengine" ]; then subpackages+=" python3-pyside2-webengine" fi +pre_build() { + if [ ${CROSS_BUILD} ]; then + + # make clang of shiboken aware of crossbuild + SHIBOKEN_CLANG_OPTIONS="--target=${XBPS_CROSS_TRIPLET}" + SHIBOKEN_CLANG_OPTIONS+=" --sysroot=/usr/${XBPS_CROSS_TRIPLET}" + + # qt5 is built with gcc, so shiboken's clang needs gcc corresponding headers + local gcc_ver="$(${XBPS_CROSS_TRIPLET}-gcc -dumpversion)" + local inc_root="/usr/${XBPS_CROSS_TRIPLET}/usr/include/c++/${gcc_ver}" + + SHIBOKEN_CLANG_OPTIONS+=" -isystem ${inc_root}" + SHIBOKEN_CLANG_OPTIONS+=" -isystem ${inc_root}/${XBPS_CROSS_TRIPLET}" + # uneeded so far + SHIBOKEN_CLANG_OPTIONS+=" -isystem ${inc_root}/backward" + + export SHIBOKEN_CLANG_OPTIONS + fi +} + +pre_check() { + # no virtual backend is fine for OpenGL, vnc is fine for Qml tests + export QT_QPA_PLATFORM=vnc +} + python3-pyside2-webengine_package() { depends="python3-pyside2-${version}_${revision}" short_desc+=" - WebEngine component" @@ -73,23 +100,3 @@ libpyside2-python3_package() { vmove "usr/lib/*.so.*" } } - -libpyside-python3_package() { - short_desc+=" - transitional dummy package" - build_style=meta -} - -python3-pyside_package() { - short_desc+=" - transitional dummy package" - build_style=meta -} - -python3-pyside-phonon_package() { - short_desc+=" - transitional dummy package" - build_style=meta -} - -python3-pyenet_package() { - short_desc+=" - transitional dummy package" - build_style=meta -}