From b32551982f5b7a527e461a89f4f3996b0ea49bb68e326e3fc206256060854516 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Sun, 19 Jun 2022 17:35:33 +0000 Subject: [PATCH] Accepting request 983591 from home:bnavigator:branches:KDE:Qt5 - Clean up some deprecated python-rpm-macro usage and declare BuildRequirement on it explicitly. - Provide python dist-info metadata and PyPI names in rpm metadata - Fix missing install of typing stub and PySide2.support - Fix ctest suite run by providing some extra paths - Update to 5.15.4 * [PYSIDE-955] QOpenGLContext.versionFunctions() have been implemented. Class QOpenGLVersionFunctionsFactory (from Qt 6) has also been added. * [PYSIDE-1409] signature: The decision heuristics of result tuples have been refined. * [PYSIDE-1438] Crashes in Qt Datavisualization's QBar/SurfaceDataProxy add/set/insertRow() members have been fixed. * [PYSIDE-1502] Import errors will now be properly reported. * [PYSIDE-1513] Documentation on properties has been added. * [PYSIDE-1538] signature: Unrecognized items will no longer raise exceptions. * [PYSIDE-1540] The performance of QPainter::drawPoints(QPolygon) has been improved. * [PYSIDE-1529] Crashes when registering static fields have been fixed. - Update to 5.15.3. Bugs fixed: * [PYSIDE-454] namespace std is no longer rejected in the Qt typesystem files. * [PYSIDE-807] setup.py's 'clean' command has been fixed. * [PYSIDE-1305] The error handling of constructor keyword arguments has been fixed. * [PYSIDE-1422] A crash related to Signal and __eq__ has been fixed. * [PYSIDE-1432] An ownership issue in QLayout::replaceWidget() has been fixed. * [PYSIDE-1442] QFlags operations have been fixed. * [PYSIDE-1447] A crash related to qApp and Python 3.9 has been fixed. * [PYSIDE-1449] QTestlib's QAbstractItemModelTester has been added. * [PYSIDE-1460] An infinite loop changing up directories in the signature bootstrap code has been fixed. * [PYSIDE-1466] The newly introduced overload QSetting.value() taking a type has been documentated. * [PYSIDE-1478] A bug related to using QQmlContext.setContextProperty() with the snake case feature has been fixed. * [PYSIDE-1347] Inheritance for enum types has been fixed. * [PYSIDE-1448] Code injected at target/end being invoked for multiple overload ids has been fixed. * [PYSIDE-1470] shiboken.delete() can now be used to delete Q*Application. * [PYSIDE-1501] The clang parser has been fixed to be able to handle some Boost headers. - Switch to CMake for building pyside2. - Add patch: * 0001-Always-link-to-python-libraries.patch - Rebase patch: * 0001-Don-t-try-to-install-or-use-uic-rcc-designer-copies.patch - Drop now unneeded patches: * lib64.patch * 0002-Fix-the-openSUSE-executable-names.patch - Build pyside without QtWebEngine on powerpc and zSystems OBS-URL: https://build.opensuse.org/request/show/983591 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt5/python3-pyside2?expand=0&rev=55 --- 0001-Always-link-to-python-libraries.patch | 41 ++++ ...stall-or-use-uic-rcc-designer-copies.patch | 73 +----- 0002-Fix-the-openSUSE-executable-names.patch | 52 ---- lib64.patch | 77 ------ pyside-setup-opensource-src-5.15.2.tar.xz | 3 - pyside-setup-opensource-src-5.15.4.tar.xz | 3 + python3-pyside2.changes | 71 ++++++ python3-pyside2.spec | 225 +++++++++++------- 8 files changed, 256 insertions(+), 289 deletions(-) create mode 100644 0001-Always-link-to-python-libraries.patch delete mode 100644 0002-Fix-the-openSUSE-executable-names.patch delete mode 100644 lib64.patch delete mode 100644 pyside-setup-opensource-src-5.15.2.tar.xz create mode 100644 pyside-setup-opensource-src-5.15.4.tar.xz diff --git a/0001-Always-link-to-python-libraries.patch b/0001-Always-link-to-python-libraries.patch new file mode 100644 index 0000000..88eea8e --- /dev/null +++ b/0001-Always-link-to-python-libraries.patch @@ -0,0 +1,41 @@ +From d46be00db12b97bff6b62222ccb4e97fdb0a7ed4 Mon Sep 17 00:00:00 2001 +From: Christophe Giboudeaux +Date: Mon, 21 Mar 2022 14:48:20 +0100 +Subject: [PATCH] Always link to python libraries. + +--- + sources/shiboken2/data/shiboken_helpers.cmake | 18 +++--------------- + 1 file changed, 3 insertions(+), 15 deletions(-) + +diff --git a/sources/shiboken2/data/shiboken_helpers.cmake b/sources/shiboken2/data/shiboken_helpers.cmake +index 5e0c6ea..5c0bcdc 100644 +--- a/sources/shiboken2/data/shiboken_helpers.cmake ++++ b/sources/shiboken2/data/shiboken_helpers.cmake +@@ -413,21 +413,9 @@ macro(shiboken_compute_python_libraries) + "SHIBOKEN_COMPUTE_LIBS" "shiboken_compute_python_libraries" + "IS_CALLED_FROM_EXPORT" "" "" ${ARGN}) + +- if (NOT SHIBOKEN_PYTHON_LIBRARIES) +- set(SHIBOKEN_PYTHON_LIBRARIES "") +- endif() +- +- if(CMAKE_BUILD_TYPE STREQUAL "Debug") +- if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES) +- set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_DEBUG_LIBRARIES}) +- endif() +- endif() +- +- if(CMAKE_BUILD_TYPE STREQUAL "Release") +- if(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES) +- set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_LIBRARIES}) +- endif() +- endif() ++ # Always link to python libraries. ++ message(STATUS "Linking shiboken to ${PYTHON_LIBRARIES}") ++ set(SHIBOKEN_PYTHON_LIBRARIES ${PYTHON_LIBRARIES}) + + # If the resulting variable + # contains a "debug;X;optimized;Y" list like described in shiboken_check_if_limited_api, +-- +2.35.1 + diff --git a/0001-Don-t-try-to-install-or-use-uic-rcc-designer-copies.patch b/0001-Don-t-try-to-install-or-use-uic-rcc-designer-copies.patch index ffe3d3d..cd2d3b9 100644 --- a/0001-Don-t-try-to-install-or-use-uic-rcc-designer-copies.patch +++ b/0001-Don-t-try-to-install-or-use-uic-rcc-designer-copies.patch @@ -1,79 +1,22 @@ -From 06f2d7c11dece8a6e7328cf4f8ade48ce75874b0 Mon Sep 17 00:00:00 2001 +From 88b4cc717777aa88afbed8ec30b6ef95a7ec01d1 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux -Date: Mon, 30 Dec 2019 11:24:23 +0100 +Date: Mon, 21 Mar 2022 17:03:40 +0100 Subject: [PATCH] Don't try to install or use uic/rcc/designer copies. These executables are installed by qtbase and qttools. Making copies is not needed. - -pyside2-tools wrongly assumed the executables were in /usr/bin on Linux. --- - build_scripts/platforms/unix.py | 17 +--------- - sources/pyside2-tools/CMakeLists.txt | 48 ---------------------------- - 2 files changed, 1 insertion(+), 64 deletions(-) + sources/pyside2-tools/CMakeLists.txt | 32 ---------------------------- + 1 file changed, 32 deletions(-) -diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py -index b842510..fd2f71c 100644 ---- a/build_scripts/platforms/unix.py -+++ b/build_scripts/platforms/unix.py -@@ -134,24 +134,9 @@ def prepare_packages_posix(self, vars): - "{st_build_dir}/{st_package_name}", - filter=[ - "pyside2-lupdate", -- "uic", -- "rcc", - ], - recursive=False, vars=vars)) - -- # Copying designer -- if sys.platform == "darwin": -- executables.extend(copydir( -- "{install_dir}/bin/Designer.app", -- "{st_build_dir}/{st_package_name}/Designer.app", -- filter=None, recursive=True, -- force=False, vars=vars)) -- else: -- copyfile( -- "{install_dir}/bin/designer", -- "{st_build_dir}/{st_package_name}/designer", -- force=False, vars=vars) -- - # /lib/lib* -> {st_package_name}/ - copydir( - "{install_dir}/lib/", -@@ -204,7 +189,7 @@ def prepare_packages_posix(self, vars): - # compatibility - if sys.version_info[0] == 3: - examples_path = "{st_build_dir}/{st_package_name}/examples".format(**vars) -- pyside_rcc_path = "{install_dir}/bin/rcc".format(**vars) -+ pyside_rcc_path = "/usr/bin/rcc" - pyside_rcc_options = ['-g', 'python'] - regenerate_qt_resources(examples_path, pyside_rcc_path, pyside_rcc_options) - diff --git a/sources/pyside2-tools/CMakeLists.txt b/sources/pyside2-tools/CMakeLists.txt -index ce65750..ed7fb09 100644 +index ce65750..f9ebd84 100644 --- a/sources/pyside2-tools/CMakeLists.txt +++ b/sources/pyside2-tools/CMakeLists.txt -@@ -39,54 +39,6 @@ if (NOT PYTHON_SITE_PACKAGES) - endif() +@@ -55,38 +55,6 @@ else() + set(DESIGNER_PATH "${TOOLS_PATH}/designer${EXE_EXT}") endif() --# Handling .exe extension for Window and the uic/rcc executables --if (WIN32) -- set(EXE_EXT ".exe") --else() -- set(EXE_EXT "") --endif() -- --set(TOOLS_PATH "${_qt5Core_install_prefix}/bin") --set(UIC_PATH "${TOOLS_PATH}/uic${EXE_EXT}") --set(RCC_PATH "${TOOLS_PATH}/rcc${EXE_EXT}") --if (APPLE) -- set(DESIGNER_PATH "${TOOLS_PATH}/Designer.app") --else() -- set(DESIGNER_PATH "${TOOLS_PATH}/designer${EXE_EXT}") --endif() -- -install(FILES "${UIC_PATH}" - DESTINATION bin - PERMISSIONS @@ -110,5 +53,5 @@ index ce65750..ed7fb09 100644 "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -- -2.26.2 +2.35.1 diff --git a/0002-Fix-the-openSUSE-executable-names.patch b/0002-Fix-the-openSUSE-executable-names.patch deleted file mode 100644 index 2552e48..0000000 --- a/0002-Fix-the-openSUSE-executable-names.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 81ad0e88644af358c30ea036c26b6f2afc457b98 Mon Sep 17 00:00:00 2001 -From: Christophe Giboudeaux -Date: Mon, 30 Dec 2019 12:16:25 +0100 -Subject: [PATCH 2/2] Fix the openSUSE executable names. - ---- - build_scripts/platforms/unix.py | 2 +- - sources/pyside2-tools/pyside_tool.py | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py -index f5b2760..a0109c6 100644 ---- a/build_scripts/platforms/unix.py -+++ b/build_scripts/platforms/unix.py -@@ -189,7 +189,7 @@ def prepare_packages_posix(self, vars): - # compatibility - if sys.version_info[0] == 3: - examples_path = "{st_build_dir}/{st_package_name}/examples".format(**vars) -- pyside_rcc_path = "/usr/bin/rcc" -+ pyside_rcc_path = "/usr/bin/rcc-qt5" - pyside_rcc_options = ['-g', 'python'] - regenerate_qt_resources(examples_path, pyside_rcc_path, pyside_rcc_options) - -diff --git a/sources/pyside2-tools/pyside_tool.py b/sources/pyside2-tools/pyside_tool.py -index da2d741..be32e2f 100755 ---- a/sources/pyside2-tools/pyside_tool.py -+++ b/sources/pyside2-tools/pyside_tool.py -@@ -71,18 +71,18 @@ def qt_tool_wrapper(qt_tool, args): - - - def uic(): -- qt_tool_wrapper("uic", ['-g', 'python'] + sys.argv[1:]) -+ qt_tool_wrapper("uic-qt5", ['-g', 'python'] + sys.argv[1:]) - - - def rcc(): -- qt_tool_wrapper("rcc", ['-g', 'python'] + sys.argv[1:]) -+ qt_tool_wrapper("rcc-qt5", ['-g', 'python'] + sys.argv[1:]) - - - def designer(): - if sys.platform == "darwin": - qt_tool_wrapper("Designer.app/Contents/MacOS/Designer", sys.argv[1:]) - else: -- qt_tool_wrapper("designer", sys.argv[1:]) -+ qt_tool_wrapper("designer-qt5", sys.argv[1:]) - - - if __name__ == "__main__": --- -2.24.1 - diff --git a/lib64.patch b/lib64.patch deleted file mode 100644 index c324c61..0000000 --- a/lib64.patch +++ /dev/null @@ -1,77 +0,0 @@ -From d494a8eb0653b6e22207c48da7808a0bbd86b569 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20Br=C3=BCns?= -Date: Thu, 20 Dec 2018 19:05:03 +0100 -Subject: [PATCH] Lookup clang library and install in arch specific library - path - ---- - build_scripts/platforms/unix.py | 4 ++-- - sources/pyside2/CMakeLists.txt | 2 +- - .../shiboken2/ApiExtractor/clangparser/compilersupport.cpp | 2 +- - sources/shiboken2/CMakeLists.txt | 2 +- - 4 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/build_scripts/platforms/unix.py b/build_scripts/platforms/unix.py -index 60722cd..c9df7f9 100644 ---- a/build_scripts/platforms/unix.py -+++ b/build_scripts/platforms/unix.py -@@ -81,7 +81,7 @@ def prepare_packages_posix(self, vars): - - # /lib/lib* -> {st_package_name}/ - copydir( -- "{install_dir}/lib/", -+ "{install_dir}/lib64/", - "{st_build_dir}/{st_package_name}", - filter=[ - adjusted_lib_name("libshiboken*", -@@ -139,7 +139,7 @@ def prepare_packages_posix(self, vars): - - # /lib/lib* -> {st_package_name}/ - copydir( -- "{install_dir}/lib/", -+ "{install_dir}/lib64/", - "{st_build_dir}/{st_package_name}", - filter=[ - adjusted_lib_name("libpyside*", -diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt -index bab97f4..26fa266 100644 ---- a/sources/pyside2/CMakeLists.txt -+++ b/sources/pyside2/CMakeLists.txt -@@ -98,7 +98,7 @@ endif() - - option(BUILD_TESTS "Build tests." TRUE) - option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE) --set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) -+set(LIB_SUFFIX "64" CACHE STRING "Define suffix of directory name (32/64)" ) - set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) - if(CMAKE_HOST_APPLE) - set(ALTERNATIVE_QT_INCLUDE_DIR "" CACHE PATH "Deprecated. CMake now finds the proper include dir itself.") -diff --git a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp -index dac5110..4b091eb 100644 ---- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp -+++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp -@@ -243,7 +243,7 @@ static QString findClangLibDir() - { - for (const char *envVar : {"LLVM_INSTALL_DIR", "CLANG_INSTALL_DIR"}) { - if (qEnvironmentVariableIsSet(envVar)) { -- const QString path = QFile::decodeName(qgetenv(envVar)) + QLatin1String("/lib"); -+ const QString path = QFile::decodeName(qgetenv(envVar)) + QLatin1String("/lib64"); - if (QFileInfo::exists(path)) - return path; - } -diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt -index 5877971..25a53b3 100644 ---- a/sources/shiboken2/CMakeLists.txt -+++ b/sources/shiboken2/CMakeLists.txt -@@ -121,7 +121,7 @@ else() - endif() - set(CMAKE_CXX_STANDARD_REQUIRED ON) - --set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) -+set(LIB_SUFFIX "64" CACHE STRING "Define suffix of directory name (32/64)" ) - set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install \ - prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) - set(BIN_INSTALL_DIR "bin" CACHE PATH "The subdirectory relative to the install prefix where \ --- -2.26.2 - diff --git a/pyside-setup-opensource-src-5.15.2.tar.xz b/pyside-setup-opensource-src-5.15.2.tar.xz deleted file mode 100644 index 7b84d31..0000000 --- a/pyside-setup-opensource-src-5.15.2.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b306504b0b8037079a8eab772ee774b9e877a2d84bab2dbefbe4fa6f83941418 -size 3472624 diff --git a/pyside-setup-opensource-src-5.15.4.tar.xz b/pyside-setup-opensource-src-5.15.4.tar.xz new file mode 100644 index 0000000..bd452d5 --- /dev/null +++ b/pyside-setup-opensource-src-5.15.4.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c68ed0def4111ef5d0641370306338d277ae8983a77eaf22f223ddd3a14450b +size 3578184 diff --git a/python3-pyside2.changes b/python3-pyside2.changes index e81672b..227d67e 100644 --- a/python3-pyside2.changes +++ b/python3-pyside2.changes @@ -1,3 +1,74 @@ +------------------------------------------------------------------- +Fri Jun 17 21:31:00 UTC 2022 - Ben Greiner + +- Clean up some deprecated python-rpm-macro usage and declare + BuildRequirement on it explicitly. +- Provide python dist-info metadata and PyPI names in rpm metadata +- Fix missing install of typing stub and PySide2.support +- Fix ctest suite run by providing some extra paths + +------------------------------------------------------------------- +Sat Jun 11 19:43:43 UTC 2022 - Christophe Giboudeaux + +- Update to 5.15.4 + * [PYSIDE-955] QOpenGLContext.versionFunctions() have been + implemented. Class QOpenGLVersionFunctionsFactory (from Qt 6) + has also been added. + * [PYSIDE-1409] signature: The decision heuristics of result + tuples have been refined. + * [PYSIDE-1438] Crashes in Qt Datavisualization's + QBar/SurfaceDataProxy add/set/insertRow() members have been + fixed. + * [PYSIDE-1502] Import errors will now be properly reported. + * [PYSIDE-1513] Documentation on properties has been added. + * [PYSIDE-1538] signature: Unrecognized items will no longer raise + exceptions. + * [PYSIDE-1540] The performance of QPainter::drawPoints(QPolygon) + has been improved. + * [PYSIDE-1529] Crashes when registering static fields have been + fixed. + +------------------------------------------------------------------- +Sat Mar 12 08:44:57 UTC 2022 - Christophe Giboudeaux + +- Update to 5.15.3. Bugs fixed: + * [PYSIDE-454] namespace std is no longer rejected in the Qt + typesystem files. + * [PYSIDE-807] setup.py's 'clean' command has been fixed. + * [PYSIDE-1305] The error handling of constructor keyword + arguments has been fixed. + * [PYSIDE-1422] A crash related to Signal and __eq__ has + been fixed. + * [PYSIDE-1432] An ownership issue in QLayout::replaceWidget() + has been fixed. + * [PYSIDE-1442] QFlags operations have been fixed. + * [PYSIDE-1447] A crash related to qApp and Python 3.9 has been + fixed. + * [PYSIDE-1449] QTestlib's QAbstractItemModelTester has been + added. + * [PYSIDE-1460] An infinite loop changing up directories in the + signature bootstrap code has been fixed. + * [PYSIDE-1466] The newly introduced overload QSetting.value() + taking a type has been documentated. + * [PYSIDE-1478] A bug related to using QQmlContext.setContextProperty() + with the snake case feature has been fixed. + * [PYSIDE-1347] Inheritance for enum types has been fixed. + * [PYSIDE-1448] Code injected at target/end being invoked + for multiple overload ids has been fixed. + * [PYSIDE-1470] shiboken.delete() can now be used to delete + Q*Application. + * [PYSIDE-1501] The clang parser has been fixed to be able + to handle some Boost headers. +- Switch to CMake for building pyside2. +- Add patch: + * 0001-Always-link-to-python-libraries.patch +- Rebase patch: + * 0001-Don-t-try-to-install-or-use-uic-rcc-designer-copies.patch +- Drop now unneeded patches: + * lib64.patch + * 0002-Fix-the-openSUSE-executable-names.patch +- Build pyside without QtWebEngine on powerpc and zSystems + ------------------------------------------------------------------- Tue Oct 12 13:52:59 UTC 2021 - Christophe Giboudeaux diff --git a/python3-pyside2.spec b/python3-pyside2.spec index dcc5840..a611088 100644 --- a/python3-pyside2.spec +++ b/python3-pyside2.spec @@ -1,7 +1,7 @@ # # spec file for package python3-pyside2 # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,38 +21,50 @@ # QML imports created and used by examples %global __requires_exclude qmlimport\\((Charts|TextBalloonPlugin) -%define mypython python3 -BuildRequires: python3-devel -BuildRequires: python3-setuptools Name: python3-pyside2 -Version: 5.15.2 +Version: 5.15.4 Release: 0 Summary: Python bindings for Qt # Legal: # Most files are LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later) # pyside2-tools is GPL-2.0-only # shiboken2 contains files under GPL-3.0-only WITH Qt-GPL-exception-1.0 -License: LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later) AND GPL-2.0-only AND GPL-3.0-only WITH Qt-GPL-exception-1.0 +License: (GPL-2.0-only AND (GPL-2.0-only OR GPL-3.0-or-later) AND GPL-3.0-only WITH Qt-GPL-exception-1.0) OR LGPL-3.0-only Group: Development/Languages/Python URL: http://wiki.qt.io/Qt_for_Python Source0: https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-%{version}-src/pyside-setup-opensource-src-%{version}.tar.xz -# PATCH-FIX-UPSTREAM -Patch0: lib64.patch +# PATCH-FIX-OPENSUSE +Patch0: 0001-Always-link-to-python-libraries.patch # PATCH-FIX-UPSTREAM Patch1: 0001-Don-t-try-to-install-or-use-uic-rcc-designer-copies.patch -# PATCH-FIX-OPENSUSE -Patch2: 0002-Fix-the-openSUSE-executable-names.patch # PATCH-FIX-UPSTREAM -Patch3: 0001-cmake-Don-t-assume-qhelpgenerator-is-in-PATH.patch +Patch2: 0001-cmake-Don-t-assume-qhelpgenerator-is-in-PATH.patch # PATCH-FIX-UPSTREAM -Patch4: 0001-Backport-LLVM-13-fix-from-shiboken6.patch +Patch3: 0001-Backport-LLVM-13-fix-from-shiboken6.patch +# Provide the PyPI names +Provides: python3-PySide2 = %{version}-%{release} +Provides: python3-shiboken2 = %{version}-%{release} +Provides: python3-shiboken2_generator = %{version}-%{release} +# SECTION common_dependencies +BuildRequires: clang-devel >= 3.9 BuildRequires: cmake BuildRequires: fdupes BuildRequires: gcc-c++ - BuildRequires: libqt5-qtdeclarative-private-headers-devel - -##### essential modules +BuildRequires: libxslt-devel +BuildRequires: python-rpm-macros +BuildRequires: python3-Sphinx +BuildRequires: python3-devel +BuildRequires: python3-idna +BuildRequires: python3-setuptools +BuildRequires: python3-urllib3 +BuildRequires: python3-wheel +%if %{with tests} +BuildRequires: Mesa-dri +BuildRequires: xvfb-run +%endif +# /SECTION +# SECTION essential_modules BuildRequires: cmake(Qt5Concurrent) BuildRequires: cmake(Qt5Core) >= 5.15 BuildRequires: cmake(Qt5Network) @@ -63,8 +75,8 @@ BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5X11Extras) BuildRequires: cmake(Qt5Xml) BuildRequires: cmake(Qt5XmlPatterns) - -##### optional modules +# /SECTION +# SECTION optional_modules BuildRequires: libQt53DQuickScene2D5 BuildRequires: cmake(Qt53DAnimation) BuildRequires: cmake(Qt53DCore) @@ -89,22 +101,14 @@ BuildRequires: cmake(Qt5SerialPort) BuildRequires: cmake(Qt5Svg) BuildRequires: cmake(Qt5TextToSpeech) BuildRequires: cmake(Qt5WebChannel) +%ifnarch ppc64 ppc64le s390x BuildRequires: cmake(Qt5WebEngineWidgets) +%endif BuildRequires: cmake(Qt5WebSockets) BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5Xml) BuildRequires: cmake(Qt5XmlPatterns) - -BuildRequires: clang-devel >= 3.9 -BuildRequires: libxslt-devel -BuildRequires: python3-Sphinx -BuildRequires: python3-idna -BuildRequires: python3-urllib3 -BuildRequires: python3-wheel -%if %{with tests} -BuildRequires: xvfb-run -BuildRequires: Mesa-dri -%endif +# /SECTION %description The PySide2 project provides Python bindings for the Qt @@ -112,7 +116,7 @@ application and UI framework. %package devel Summary: Header Files for PySide2 -License: LGPL-3.0-only OR (GPL-2.0-only OR GPL-3.0-or-later) AND GPL-2.0-only AND GPL-3.0-only WITH Qt-GPL-exception-1.0 +License: (GPL-2.0-only AND (GPL-2.0-only OR GPL-3.0-or-later) AND GPL-3.0-only WITH Qt-GPL-exception-1.0) OR LGPL-3.0-only Group: Development/Languages/Python Requires: %{name} = %{version} @@ -125,79 +129,105 @@ Summary: Examples for using PySide2 License: BSD-3-Clause Group: Development/Languages/Python Requires: %{name} = %{version} +BuildArch: noarch %description examples Examples and Tutorials for the PySide2 bindings for Qt. %prep -%setup -q -n pyside-setup-opensource-src-%{version} -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%if "%{_lib}" == "lib64" -%patch0 -p1 -%endif - -# Test expects depth of 32 -printf '[QtGui::qdatastream_gui_operators_test]\n linux\n' >> build_history/blacklist.txt - -# bug_307 fails on armv7l only -%ifarch %{arm} -printf '[QtWidgets::bug_307]\n linux\n' >> build_history/blacklist.txt -%endif +%autosetup -p1 -n pyside-setup-opensource-src-%{version} %build -export LLVM_INSTALL_DIR=%{_prefix} -# Workaround for PYSIDE-880 -export LC_ALL=C.utf8 -%{mypython} setup.py build --reuse-build --ignore-git %{?jobs:--parallel=%{jobs}} \ +_libsuffix=$(echo %{_lib} | cut -b4-) + +# NOTE:The compiler and linker flags shall not be defined +%cmake \ + -DLIB_SUFFIX:STRING="${_libsuffix}" \ + -DCMAKE_C_FLAGS:STRING="" \ + -DCMAKE_CXX_FLAGS:STRING="" \ + -DCMAKE_EXE_LINKER_FLAGS:STRING="" \ + -DPYTHON_EXECUTABLE:STRING=python3 \ + -DCMAKE_BUILD_RPATH_USE_ORIGIN:BOOL=ON \ %if %{with tests} - --build-tests + -DBUILD_TESTS:BOOL=ON %endif +%cmake_build + %install -export LC_ALL=C.utf8 -%{mypython} setup.py install --reuse-build --ignore-git --prefix=%{_prefix} --root=%{buildroot} \ -%if %{with tests} - --build-tests -%endif +%cmake_install -# and hack re-installation, since setup is doing it wrong -rm -rf %{buildroot}/* -mkdir -p %{buildroot}/%{_libdir} -cp -a ./pyside?_install/py*-release/* %{buildroot}%{_prefix}/ +sed -i 's#env python$#python%{python3_bin_suffix}#' \ + %{buildroot}%{_bindir}/shiboken_tool.py \ + %{buildroot}%{_bindir}/pyside_tool.py -cp -a ./pyside3_build/py*-release/pyside2/PySide2/*.pyi %{buildroot}%{python_sitearch}/PySide2/ +rm %{buildroot}%{_datadir}/PySide2/typesystems/*_{mac,win}.xml -cp -a ./examples %{buildroot}%{_datadir}/PySide2/ +# The cmake superproject forgets these +cp -r build/sources/pyside2/PySide2/*.pyi \ + build/sources/pyside2/PySide2/py.typed \ + build/sources/pyside2/PySide2/support \ + %{buildroot}%{python3_sitearch}/PySide2/ +# this is not ideal, but at least we get some python dist metadata +python3 setup.py dist_info +for d in *.dist-info; do + # the commands were copied verbatim, not wrapped by entry-points. + rm -f $d/entry_points.txt + cp -r $d %{buildroot}%{python3_sitearch}/${d/.dist-info/-%{version}.dist-info} +done -sed -i 's,=.*/pyside._install/[^\/]*,=/usr,' %{buildroot}/%{_libdir}/pkgconfig/*.pc -sed -i 's,^libdir=.*,libdir=%{_libdir},' %{buildroot}/%{_libdir}/pkgconfig/*.pc - -sed -i 's,"[^"]*/include/shiboken2","%{_includedir}/shiboken2",' %{buildroot}/%{_libdir}/cmake/Shiboken*/*.cmake -sed -i 's,"[^"]*/%{_lib}/libshiboken2.\(.*\)","%{_libdir}/libshiboken2.\1",' %{buildroot}/%{_libdir}/cmake/Shiboken*/*.cmake -sed -i 's,"[^"]*/bin/shiboken2","%{_bindir}/shiboken2",' %{buildroot}/%{_libdir}/cmake/Shiboken*/*.cmake -sed -i 's,^include("[^"]*-release/%{_lib}/,include("%{_libdir}/,' %{buildroot}/%{_libdir}/cmake/Shiboken*/*.cmake - -sed -i 's,"[^"]*/include/PySide2","%{_includedir}/PySide2",' %{buildroot}/%{_libdir}/cmake/PySide2*/*.cmake -sed -i 's,"[^"]*/%{_lib}/cmake/\(.*\)","%{_libdir}/cmake/\1",' %{buildroot}/%{_libdir}/cmake/PySide2*/*.cmake -sed -i 's,"[^"]*/%{_lib}/libpyside2\.\(.*\)","%{_libdir}/libpyside2.\1",' %{buildroot}/%{_libdir}/cmake/PySide2*/*.cmake -sed -i 's,"[^"]*/\(python.*/site-packages\)","%{_libdir}/\1",' %{buildroot}/%{_libdir}/cmake/PySide2*/*.cmake -sed -i 's,"[^"]*/share/PySide2/typesystems","%{_datadir}/PySide2/typesystems",' %{buildroot}/%{_libdir}/cmake/PySide2*/*.cmake -sed -i 's,"[^"]*/share/PySide2/glue","%{_datadir}/PySide2/glue",' %{buildroot}/%{_libdir}/cmake/PySide2*/*.cmake -sed -i 's,^include("[^"]*-release/%{_lib}/,include("%{_libdir}/,' %{buildroot}/%{_libdir}/cmake/PySide2*/*.cmake - -rm %{buildroot}%{_bindir}/*_tool.py -rm -Rf %{buildroot}%{_datadir}/PySide2/typesystems/typesystem_*_win.xml +# Examples must be installed manually +cp -R examples %{buildroot}%{_datadir}/PySide2 %fdupes %{buildroot}%{_datadir}/PySide2/examples/ -%fdupes %{buildroot}%{_libdir}/cmake/ -%fdupes %{buildroot}%{python_sitearch}/shiboken2/ +%fdupes %{buildroot}%{_libqt5_libdir}/cmake/ +%fdupes %{buildroot}%{python3_sitearch} %check %if %{with tests} -xvfb-run -s "-screen 0 1600x1200x16 -ac +extension GLX +render -noreset" %{mypython} testrunner.py test +# Set some environment variables +export PATH=%{_libqt5_bindir}:$PATH +export LD_LIBRARY_PATH=%{buildroot}%{_libqt5_libdir}:$LD_LIBRARY_PATH +export PYTHONPATH=%{buildroot}%{python3_sitearch}:$PWD/build/sources/pyside2/tests/pysidetest +%if 0%{?sle_version} && 0%{?sle_version} <= 150300 +# Leap 15.3: ctest searches the libs before shiboken_paths.py can set the search path (!?) +for binding in $PWD/build/sources/shiboken2/tests/lib*; do + export LD_LIBRARY_PATH=$binding:$LD_LIBRARY_PATH +done +export LD_LIBRARY_PATH=$PWD/build/sources/pyside2/tests/pysidetest:$LD_LIBRARY_PATH +%endif + +%define xvfb_command xvfb-run -s "-screen 0 1600x1200x16 -ac +extension GLX +render -noreset" + +# Tests known to fail (listed in build_history/blacklist.txt) +ctest_exclude_regex="QtMultimedia_audio_test" +ctest_exclude_regex="$ctest_exclude_regex|QtQml_javascript_exceptions" +ctest_exclude_regex="$ctest_exclude_regex|QtScriptTools_debugger_test" +ctest_exclude_regex="$ctest_exclude_regex|registry_existence_test" +ctest_exclude_regex="$ctest_exclude_regex|QtWebEngineWidgets_pyside-474-qtwebengineview" +ctest_exclude_regex="$ctest_exclude_regex|QtWebEngineCore_web_engine_custom_scheme" +%ifarch %{arm} +# bug_307 fails on armv7l only +ctest_exclude_regex="$ctest_exclude_regex|QtWidget_bug_307" +%endif +%ifarch ppc64le +# TODO: investigate/report test failure on PowerPC +ctest_exclude_regex="$ctest_exclude_regex|QtQml_signal_arguments" +%endif + +# Tests are executed from subdirectories. %%ctest can't be used. +%define ctest_command %{shrink:ctest + --output-on-failure + --force-new-ctest-process + --parallel %{_smp_build_ncpus} + --exclude-regex "($ctest_exclude_regex)"} + +pushd build/sources/shiboken2 +%{xvfb_command} %{ctest_command} +popd +pushd build/sources/pyside2 +%{xvfb_command} %{ctest_command} +popd %endif %post -p /sbin/ldconfig @@ -206,20 +236,31 @@ xvfb-run -s "-screen 0 1600x1200x16 -ac +extension GLX +render -noreset" %{mypyt %files %license LICENSE.* %doc dist/changes* -%{_bindir}/* -%{_libdir}/*.so.* -%{python_sitearch}/* +%{_bindir}/pyside2-lupdate +%{_bindir}/pyside_tool.py +%{_bindir}/shiboken2 +%{_bindir}/shiboken_tool.py +%{_libqt5_libdir}/libpyside2.%{py3_soflags}.so.* +%{_libqt5_libdir}/libshiboken2.%{py3_soflags}.so.* +%{python3_sitearch}/PySide2/ +%{python3_sitearch}/PySide2-%{version}.dist-info +%{python3_sitearch}/shiboken2/ +%{python3_sitearch}/shiboken2-%{version}.dist-info +%{python3_sitearch}/shiboken2_generator/ +%{python3_sitearch}/shiboken2_generator-%{version}.dist-info %files devel %{_datadir}/PySide2/ +%{_includedir}/PySide2/ +%{_includedir}/shiboken2/ +%{_libqt5_libdir}/libpyside2.%{py3_soflags}.so +%{_libqt5_libdir}/libshiboken2.%{py3_soflags}.so +%{_libqt5_libdir}/cmake/PySide2-%{version} +%{_libqt5_libdir}/cmake/Shiboken2-%{version} +%{_libqt5_libdir}/pkgconfig/pyside2.pc +%{_libqt5_libdir}/pkgconfig/shiboken2.pc +%{_mandir}/man1/pyside2-lupdate.1%{?ext_man} %exclude %{_datadir}/PySide2/examples -%{_includedir}/* -%{_libdir}/*.so -%{_libdir}/cmake/PySide2-%{version} -%{_libdir}/cmake/Shiboken2-%{version} -%{_libdir}/pkgconfig/pyside2.pc -%{_libdir}/pkgconfig/shiboken2.pc -%{_mandir}/man*/* %files examples %dir %{_datadir}/PySide2