- Tumbleweed now has numpy2: Fix include path

OBS-URL: https://build.opensuse.org/package/show/KDE:Qt6/python3-pyside6?expand=0&rev=77
This commit is contained in:
Christophe Marin 2024-09-06 14:26:31 +00:00 committed by Git OBS Bridge
commit 5816922062
9 changed files with 755 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

View File

@ -0,0 +1,28 @@
From 3de1ff0464ccf0f5e88c62330e98cb816c42f7b2 Mon Sep 17 00:00:00 2001
From: Christophe Giboudeaux <christophe@krop.fr>
Date: Tue, 27 Jul 2021 14:54:00 +0200
Subject: [PATCH] Always link to python libraries.
Change-Id: I687191431adaff55927de353db8f81dfa30ba1b1
---
diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake
index 1a46e5b..6c10c07 100644
--- a/sources/shiboken6/cmake/ShibokenHelpers.cmake
+++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake
@@ -420,13 +420,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(WIN32 AND NOT SHIBOKEN_PYTHON_LIBRARIES)
- set(SHIBOKEN_PYTHON_LIBRARIES ${Python_LIBRARIES})
- 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,

25
_constraints Normal file
View File

@ -0,0 +1,25 @@
<constraints>
<overwrite>
<conditions>
<package>python3-pyside6:shiboken6</package>
</conditions>
<hardware>
<disk>
<size unit="G">4</size>
</disk>
</hardware>
</overwrite>
<overwrite>
<conditions>
<package>python3-pyside6:pyside6</package>
</conditions>
<hardware>
<disk>
<size unit="G">7</size>
</disk>
<memory>
<size unit="G">6</size>
</memory>
</hardware>
</overwrite>
</constraints>

5
_multibuild Normal file
View File

@ -0,0 +1,5 @@
<multibuild>
<flavor>pyside6</flavor>
<flavor>shiboken6</flavor>
</multibuild>

41
fix-pytest-qt.patch Normal file
View File

@ -0,0 +1,41 @@
From: Antonio Larrosa <alarrosa@suse.com>
Subject: Fix for pytest-qt test_destroyed failure
This fixes the issue in the python-pytest-qt package (test-pyside6 flavor)
that triggered the following failure:
[ 90s] ________________________________ test_destroyed ________________________________
[ 90s] CALL ERROR: Exceptions caught in Qt event loop:
[ 90s] ________________________________________________________________________________
[ 90s] RuntimeError: Internal C++ object (Obj) already deleted.
[ 90s]
[ 90s] The above exception was the direct cause of the following exception:
[ 90s]
[ 90s] Traceback (most recent call last):
[ 90s] File "/usr/lib/python3.11/site-packages/pytestqt/wait_signal.py", line 219, in _quit_loop_by_signal
[ 90s] self._cleanup()
[ 90s] File "/usr/lib/python3.11/site-packages/pytestqt/wait_signal.py", line 226, in _cleanup
[ 90s] _silent_disconnect(signal, self._quit_loop_by_signal)
[ 90s] File "/usr/lib/python3.11/site-packages/pytestqt/wait_signal.py", line 741, in _silent_disconnect
[ 90s] signal.disconnect(slot)
[ 90s] SystemError: <class 'RuntimeError'> returned a result with an exception set
This happened because PyObject_CallObject (or PyObject_GetAttr) was
setting an exception and warnDisconnectFailed was generating a new one
without the first one being processed yet.
Submitted to upstream in https://codereview.qt-project.org/c/pyside/pyside-setup/+/567559
Index: pyside-setup-everywhere-src-6.7.1/sources/pyside6/libpyside/pysidesignal.cpp
===================================================================
--- pyside-setup-everywhere-src-6.7.1.orig/sources/pyside6/libpyside/pysidesignal.cpp
+++ pyside-setup-everywhere-src-6.7.1/sources/pyside6/libpyside/pysidesignal.cpp
@@ -718,7 +718,7 @@ static PyObject *signalInstanceDisconnec
Shiboken::AutoDecRef pyMethod(PyObject_GetAttr(source->d->source,
PySide::PySideName::qtDisconnect()));
PyObject *result = PyObject_CallObject(pyMethod, tupleArgs);
- if (result != Py_True)
+ if (result && result != Py_True)
warnDisconnectFailed(slot, source->d->signature);
return result;
}

BIN
pyside-setup-everywhere-src-6.7.2.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

310
python3-pyside6.changes Normal file
View File

@ -0,0 +1,310 @@
-------------------------------------------------------------------
Thu Sep 5 19:17:03 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Tumbleweed now has numpy2: Fix include path
-------------------------------------------------------------------
Wed Jun 19 07:48:28 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Update to 6.7.2. Check the installed changes-6.7.2 file for the
full list of changes
- Drop patch, merged upstream:
* 0001-shiboken-add-missing-include.patch
-------------------------------------------------------------------
Wed May 29 07:28:11 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>
- Add patch to fix build of python-pytest-qt with test-pyside6
flavor, which fails the test_destroyed test with a SystemError
exception:
* fix-pytest-qt.patch
-------------------------------------------------------------------
Tue May 28 15:46:43 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Update build constraints
-------------------------------------------------------------------
Fri May 24 11:22:44 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Update to 6.7.1. Check the installed changes-6.7.1 file for the
full list of changes
- Drop patch, merged upstream:
* 0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch
- Add upstream build fix:
* 0001-shiboken-add-missing-include.patch
-------------------------------------------------------------------
Tue Apr 9 11:46:05 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Add upstream change:
* 0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch
-------------------------------------------------------------------
Mon Apr 8 08:50:25 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Use a git snapshot to fix build with Qt 6.7 until a new release
is available
-------------------------------------------------------------------
Wed Mar 27 08:26:57 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Exclude a broken pyside test since Qt 6.6.3 release
-------------------------------------------------------------------
Sat Feb 17 17:52:19 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Update to 6.6.2. Check the installed changes-6.6.2 file for the
full list of changes
- Rebase 0001-Always-link-to-python-libraries.patch
-------------------------------------------------------------------
Fri Jan 26 12:07:41 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Enable SLE15 python module for a more modern python than 3.6
- Use primary_python flavor for Tumbleweed (which provides python3)
-------------------------------------------------------------------
Thu Dec 7 10:54:43 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 6.6.1. Check the installed changes-6.6.1 file for the
full list of changes
- Drop patch, merged upstream:
* 0001-Fix-QtAsyncio-install-dir.patch
-------------------------------------------------------------------
Tue Oct 17 10:35:38 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 6.6.0. Check the installed changes-6.6.0 file for the
full list of changes
- Drop patches, merged upstream:
* 0001-Fix-tests-sample_privatector-sample_privatedtor-fail.patch
* 0001-adapt-qC_Debug_Info_Warning_Critical_-for-new-definition.patch
- Add patch:
* 0001-Fix-QtAsyncio-install-dir.patch
-------------------------------------------------------------------
Wed Oct 4 09:00:16 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>
- Add patch from upstream to fix a build failure:
* 0001-adapt-qC_Debug_Info_Warning_Critical_-for-new-definition.patch
-------------------------------------------------------------------
Mon Sep 18 12:54:20 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Add patch to fix failure with Python 3.11.5:
* 0001-Fix-tests-sample_privatector-sample_privatedtor-fail.patch
-------------------------------------------------------------------
Wed Jul 26 10:48:26 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 6.5.2. Check the installed changes-6.5.2 file for the
full list of changes
- Drop patch, merged upstream:
* 0001-CMake-Fix-installation-of-pyi-files.patch
-------------------------------------------------------------------
Tue May 30 08:23:43 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 6.5.1. Check the installed changes-6.5.1 file for the
full list of changes
- Drop patch, merged upstream:
* 0001-Fix-build-when-using-QT_FEATURE_opengles2.patch
- Add patch:
* 0001-CMake-Fix-installation-of-pyi-files.patch
-------------------------------------------------------------------
Mon Apr 24 09:45:54 UTC 2023 - Frederic Crozat <fcrozat@suse.com>
- Generate egg-info.
-------------------------------------------------------------------
Sat Apr 22 08:38:24 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Add patch to fix build on arm (boo#1210723):
* 0001-Fix-build-when-using-QT_FEATURE_opengles2.patch
-------------------------------------------------------------------
Tue Apr 4 23:22:25 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 6.5.0. Check the installed changes-6.5.0 file for the
full list of changes
- Drop patch, merged upstream:
* 0001-Don-t-install-CMake-files-into-versioned-directories.patch
- Build pyside with llvm15 on Tumbleweed to work around
boo#1210176 / https://bugreports.qt.io/browse/PYSIDE-2268
-------------------------------------------------------------------
Fri Mar 17 09:04:56 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Temporarily disable Qt3D bindings on x86
-------------------------------------------------------------------
Wed Jan 11 11:11:25 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 6.4.2. Check the installed changes-6.4.2 file for the
full list of changes
- Drop patches, merged upstream:
* 0001-Fix-a-cmake-only-build.patch
* 0002-Fix-a-cmake-only-build-amended.patch
-------------------------------------------------------------------
Tue Dec 6 07:34:22 UTC 2022 - Christophe Marin <christophe@krop.fr>
- Disable two additional tests on aarch64
-------------------------------------------------------------------
Thu Nov 24 08:14:56 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.4.1. Check the installed changes-6.4.1 file for the
full list of changes
* The long missing support for __slots__ was finally added
* Documentation builds have been fixed to work with
system-installed versions of Qt 6.
* A bug when passing wrong keyword args to signals has been fixed
* The build with OpenGLES has been fixed
* Crashes when not implementing abstract methods have been
fixed
* Python 3.10 and higher are not compatible to the
__signature__ attribute. This has been fixed by a temporary
patch until the final removal of that attribute.
- Drop patch, merged upstream:
* pyside-6.4.0-arm_gles.patch
- Add patches to fix CMake builds:
* 0001-Fix-a-cmake-only-build.patch
* 0002-Fix-a-cmake-only-build-amended.patch
-------------------------------------------------------------------
Sun Oct 16 07:04:40 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.4.0. Check the installed changes-6.4.0 file for the
full list of changes
* Modules QtPdf, QtPdfWidgets and QtSpatialAudio have been added
* The Qt5Compat QML imports have been added (QtGraphicalEffects)
* Errors message about test-configuring projects with cmake
have been improved
* The feature module has been improved by a reset function
* The documentation build process has been improved; it no
longer requires a complete PySide6 build
* Support for Python 3.11 has been added
- Drop patch, fixed upstream
* 0001-Adapt-to-Qt-6.4.patch
- Fix the shiboken constraints
- Add patch to fix build failures on ARM:
* pyside-6.4.0-arm_gles.patch
-------------------------------------------------------------------
Fri Sep 30 20:54:07 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Add Qt 6.4 compatibility patch:
* 0001-Adapt-to-Qt-6.4.patch
- Add QtQuick3D and QtSpeech bindings
- Disable a failing test when building with Qt 6.4
-------------------------------------------------------------------
Tue Sep 13 06:51:16 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.3.2. Check the installed changes-6.3.2 file for the
complete list of changes.
-------------------------------------------------------------------
Sat Aug 6 09:27:06 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Use CMAKE_SKIP_RPATH when building python3-shiboken6 to avoid
non-existent RUNPATH entries in the library.
-------------------------------------------------------------------
Sun Jun 19 19:11:09 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.3.1. Check the installed changes-6.3.1 file for the
complete list of changes.
- Drop patch, fixed upstream:
* 0001-Work-around-build-issue-in-pyside-6.3.patch
-------------------------------------------------------------------
Sun Apr 17 13:25:54 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Add patch to fix build:
* 0001-Work-around-build-issue-in-pyside-6.3.patch
- Rebase patch:
* 0001-Don-t-install-CMake-files-into-versioned-directories.patch
-------------------------------------------------------------------
Tue Apr 12 10:26:46 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.3.0. Check the installed changes-6.3.0 file for the
complete list of changes.
* The QtNfc module has been added.
* New QML tools have been added: pyside6-metaobjectdump,
pyside6-qmltyperegistrar and pyside6-qmllint.
* Several class decorators have been added for QML: QmlAttached,
QmlExtended, QmlForeign, QmlNamedElement, QmlSingleton and
QmlUncreatable.
* class QPyQmlPropertyValueSource for implementing QML value
property sources has been added.
* QML code has been split out from libpyside into a new library
libpysideqml. libpyside thus no longer depends on QtQml and
pyside.h no longer includes QML headers. pyside.h has been
split into smaller headers.
* A context manager for override cursors has been added. It is
now possible to write code like: with
QApplication.setOverrideCursor(Qt.WaitCursor):...
- Don't build QtWebEngine bindings on 32 bits archs.
-------------------------------------------------------------------
Wed Mar 23 11:37:45 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.2.4
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/doc/changelogs/changes-6.2.4
- Drop patches, now upstream:
* 0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch
* 0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch
-------------------------------------------------------------------
Thu Feb 3 15:43:44 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.2.3
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/doc/changelogs/changes-6.2.3
- Add upstream patches to fix issues on big endian archs:
* 0001-Prospective-fix-for-broken-QByteArray-__msetitem__-o.patch
* 0002-Refactor-code-snippets-for-QByteArray-__msetitem__-_.patch
- Update _constraints for pyside6.
-------------------------------------------------------------------
Thu Dec 9 08:23:19 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.2.2
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/doc/changelogs/changes-6.2.2
- Rebase patches:
* 0001-Don-t-install-CMake-files-into-versioned-directories.patch
* 0001-Always-link-to-python-libraries.patch
-------------------------------------------------------------------
Sat Oct 30 09:41:32 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.2.1
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/dist/changes-6.2.1
- Drop upstream changes:
* 0001-Fix-hang-in-test-bug_430.py-in-Qt-6.3.patch
* 0001-shiboken6-Adapt-to-LLVM-12.01.patch
-------------------------------------------------------------------
Tue Oct 12 09:51:22 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Add upstream patches to fix a test failure...
* 0001-Fix-hang-in-test-bug_430.py-in-Qt-6.3.patch
- ...and failures with llvm > 12
* 0001-shiboken6-Adapt-to-LLVM-12.01.patch
-------------------------------------------------------------------
Thu Sep 30 13:14:54 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 6.2.0
-------------------------------------------------------------------
Tue Jul 27 16:40:23 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>
- Init python3-pyside6
- Add patches:
* 0001-Don-t-install-CMake-files-into-versioned-directories.patch
* 0001-Always-link-to-python-libraries.patch

319
python3-pyside6.spec Normal file
View File

@ -0,0 +1,319 @@
#
# spec file for package python3-pyside6
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define tar_name pyside-setup-everywhere-src
%define short_version 6.7
%global flavor @BUILD_FLAVOR@%{nil}
%if "%flavor" == ""
# factory-auto requires the main build_flavor to match the specfile name
%define mypython python3
%global pyside_flavor pyside6
# stop-gap for local builds
BuildRequires: no-build-without-multibuild-flavor
ExclusiveArch: donotbuild
%else
%global pyside_flavor %flavor
%if 0%{suse_version} > 1500
# This builds only for the primary python flavor, it provides the python3 flavor
%define pythons %{primary_python}
%else
# This only works with the SLE15 python module for a more modern python than 3.6.
# The build will stay unresolvable for regular python3 = 3.6
%{?sle15_python_module_pythons}
%endif
%define mypython %pythons
%define __mypython %{expand:%%__%{mypython}}
%define mypython_sitearch %{expand:%%%{mypython}_sitearch}
%endif
Name: %{mypython}-%{pyside_flavor}
Version: 6.7.2
Release: 0
Summary: Python bindings for Qt 6
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
URL: https://www.qt.io
Source: https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-%{version}-src/%{tar_name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE
Patch0: 0001-Always-link-to-python-libraries.patch
# PATCH-FIX-UPSTREAM https://codereview.qt-project.org/c/pyside/pyside-setup/+/567559
Patch1: fix-pytest-qt.patch
# SECTION common_dependencies
BuildRequires: clang-devel
BuildRequires: %{mypython}-Sphinx
BuildRequires: %{mypython}-devel >= 3.7
BuildRequires: %{mypython}-numpy-devel
BuildRequires: %{mypython}-setuptools
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: qt6-macros
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Test)
BuildRequires: cmake(Qt6Xml)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libxslt)
# /SECTION
%if "%{pyside_flavor}" == "pyside6"
# For the registry_existence test
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150500
# Not available in 15.5
BuildRequires: %{mypython}-distro
%endif
BuildRequires: %{mypython}-shiboken6-devel = %{version}
# SECTION test_dependencies
BuildRequires: Mesa-dri
BuildRequires: qt6-location
BuildRequires: qt6-sql-sqlite
BuildRequires: xvfb-run
# /SECTION
# SECTION essential_modules
BuildRequires: cmake(Qt6Concurrent)
BuildRequires: cmake(Qt6ExampleIconsPrivate)
BuildRequires: cmake(Qt6Gui)
BuildRequires: cmake(Qt6Network)
BuildRequires: cmake(Qt6PrintSupport)
BuildRequires: cmake(Qt6Sql)
BuildRequires: cmake(Qt6Widgets)
# /SECTION
# SECTION optional_modules
BuildRequires: qt6-qml-private-devel
BuildRequires: cmake(Qt63DAnimation)
BuildRequires: cmake(Qt63DCore)
BuildRequires: cmake(Qt63DExtras)
BuildRequires: cmake(Qt63DInput)
BuildRequires: cmake(Qt63DLogic)
BuildRequires: cmake(Qt63DRender)
BuildRequires: cmake(Qt6Bluetooth)
BuildRequires: cmake(Qt6Charts)
BuildRequires: cmake(Qt6DBus)
BuildRequires: cmake(Qt6DataVisualization)
BuildRequires: cmake(Qt6Designer)
BuildRequires: cmake(Qt6Graphs)
BuildRequires: cmake(Qt6Help)
BuildRequires: cmake(Qt6HttpServer)
BuildRequires: cmake(Qt6Location)
BuildRequires: cmake(Qt6Multimedia)
BuildRequires: cmake(Qt6MultimediaWidgets)
BuildRequires: cmake(Qt6NetworkAuth)
BuildRequires: cmake(Qt6OpenGL)
BuildRequires: cmake(Qt6OpenGLWidgets)
BuildRequires: cmake(Qt6Positioning)
BuildRequires: cmake(Qt6Qml)
BuildRequires: cmake(Qt6Quick)
BuildRequires: cmake(Qt6Quick3D)
BuildRequires: cmake(Qt6QuickControls2)
BuildRequires: cmake(Qt6QuickTest)
BuildRequires: cmake(Qt6QuickWidgets)
BuildRequires: cmake(Qt6RemoteObjects)
BuildRequires: cmake(Qt6Scxml)
BuildRequires: cmake(Qt6Sensors)
BuildRequires: cmake(Qt6SerialBus)
BuildRequires: cmake(Qt6SerialPort)
BuildRequires: cmake(Qt6SpatialAudio)
BuildRequires: cmake(Qt6StateMachine)
BuildRequires: cmake(Qt6Svg)
BuildRequires: cmake(Qt6SvgWidgets)
BuildRequires: cmake(Qt6TextToSpeech)
BuildRequires: cmake(Qt6UiPlugin)
BuildRequires: cmake(Qt6UiTools)
BuildRequires: cmake(Qt6WebChannel)
%ifarch x86_64 %x86_64 aarch64 riscv64
BuildRequires: cmake(Qt6Pdf)
BuildRequires: cmake(Qt6PdfWidgets)
BuildRequires: cmake(Qt6WebEngineCore)
BuildRequires: cmake(Qt6WebEngineQuick)
BuildRequires: cmake(Qt6WebEngineWidgets)
%endif
BuildRequires: cmake(Qt6WebSockets)
# /SECTION
Requires: %{mypython}-shiboken6
%endif
%if 0%{?suse_version} > 1500
Provides: python3-%{pyside_flavor} = %{version}-%{release}
Obsoletes: python3-%{pyside_flavor} < %{version}-%{release}
%endif
%description
Python bindings for the Qt cross-platform application and UI framework.
%package devel
Summary: Development files for %{name}
Requires: %{name} = %{version}
%if 0%{?suse_version} > 1500
Provides: python3-%{pyside_flavor}-devel = %{version}-%{release}
Obsoletes: python3-%{pyside_flavor}-devel < %{version}-%{release}
%endif
%description devel
Python bindings for the Qt cross-platform application and UI framework
%prep
%autosetup -p1 -n %{tar_name}-%{version}
# Restore 6.6.1 RPATH value. rpmlint will complain otherwise
sed -i 's#${base}/../shiboken6/##' sources/pyside6/CMakeLists.txt
%build
_libsuffix=$(echo %{_lib} | cut -b4-)
# The python script used to set paths before running tests
# doesn't handle build dirs called 'build'
%global __qt6_builddir %{pyside_flavor}
# Fix installation dir
sed -i 's#purelib#platlib#' sources/shiboken6/cmake/ShibokenHelpers.cmake
pushd sources/%{pyside_flavor}
# numpy changed the include path on 2.0
numpyinc=$(%{__mypython} -c 'import numpy; print(numpy.get_include())')
# NOTE:The compiler and linker flags shall not be defined
%cmake_qt6 \
-DBUILD_TESTS:BOOL=ON \
-DLIB_SUFFIX:STRING="${_libsuffix}" \
-DCMAKE_C_FLAGS:STRING="" \
-DCMAKE_CXX_FLAGS:STRING="" \
-DCMAKE_EXE_LINKER_FLAGS:STRING="" \
-DPython_EXECUTABLE:STRING=%{__mypython} \
-DNUMPY_INCLUDE_DIR:STRING=${numpyinc} \
-DCMAKE_BUILD_RPATH_USE_ORIGIN:BOOL=ON \
%if "%{pyside_flavor}" == "shiboken6"
-DCMAKE_SKIP_RPATH:BOOL=ON \
%endif
-DQFP_NO_STRIP:BOOL=ON
%{qt6_build}
popd
%install
pushd sources/%{pyside_flavor}
%{qt6_install}
popd
%if "%{pyside_flavor}" == "shiboken6"
sed -i 's@^#.*env python.*$@#!%{__mypython}@' %{buildroot}%{_bindir}/shiboken_tool.py
%else
rm %{buildroot}%{_datadir}/PySide6/typesystems/*_{mac,win}.xml
%endif
# Install egg-info
# qtpaths is needed
export PATH="%{_qt6_bindir}:$PATH"
%__mypython setup.py egg_info --build-type=%{pyside_flavor}
# fdupes macro does not expand this (!?)
sitearch=%{buildroot}%{mypython_sitearch}
cp -r *.egg-info $sitearch
%fdupes $sitearch
%fdupes -s %{buildroot}%{_libdir}/cmake
%check
# the pyside tests need to know the path to the 'qmake' executable
export PATH=%{_qt6_bindir}:$PATH
# Needed by the shiboken tests
export LD_LIBRARY_PATH=%{buildroot}%{_qt6_libdir}:$LD_LIBRARY_PATH
%if "%{pyside_flavor}" == "shiboken6"
# Since we need CMAKE_SKIP_RPATH to avoid having bogus RUNPATH in the shiboken libraries,
# It needs to know the path to a couple tests folders
for dir in libminimal libother libsample libsmart; do
export LD_LIBRARY_PATH=$PWD/sources/shiboken6/shiboken6/tests/$dir:$LD_LIBRARY_PATH
done
# 2023-05-30 Only fails on armv7l
%ifarch armv7l armv7hl
%define excluded_tests 1
ctest_exclude_regex="smart_smart_pointer"
%endif
%endif
%if "%{pyside_flavor}" == "pyside6"
%define xvfb_command xvfb-run -s "-screen 0 1600x1200x16 -ac +extension GLX +render -noreset" \\
%define excluded_tests 1
# Excluded tests (last update: 2024-05-27)
# QtWebEngineWidgets_pyside-474-qtwebengineview fails with 'ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer'
# QtGui_qpen_test times out
# QtMultimediaWidgets_qmultimediawidgets aborts
# Qt3DExtras_qt3dextras_test fails on s390x (timeout) and randomly everywhere else (exception)
# QtPositioning_positioning fails
# QtWidgets_qwidget_test fails randomly
# pyside6-android-deploy_test_pyside6_android_deploy
# QtCore_qoperatingsystemversion_test fails after https://code.qt.io/cgit/qt/qtbase.git/commit/?id=1214edc
ctest_exclude_regex="QtWebEngineWidgets_pyside-474-qtwebengineview|QtGui_qpen_test|QtMultimediaWidgets_qmultimediawidgets|Qt3DExtras_qt3dextras_test|QtPositioning_positioning|pyside6-deploy_test_pyside6_deploy|QtWidgets_qwidget_test|pyside6-android-deploy_test_pyside6_android_deploy|qoperatingsystemversion"
# registry_existence_test randomly times out and QtWebEngineCore_web_engine_custom_scheme asserts
# QtWebEngineCore_qwebenginecookiestore_test fails with a mesa error ('MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)')
%ifarch aarch64
ctest_exclude_regex="$ctest_exclude_regex|registry_existence_test|QtWebEngineCore_web_engine_custom_scheme|QtWebEngineCore_qwebenginecookiestore_test"
%endif
# python311-distro is unavailable in 15.5, skip registry_existence_test
%if 0%{?sle_version} == 150500
ctest_exclude_regex="$ctest_exclude_regex|registry_existence_test"
%endif
%endif
pushd sources/%{pyside_flavor}
%{?xvfb_command}
ctest \
--output-on-failure \
--force-new-ctest-process \
--test-dir %{__qt6_builddir} \
--parallel %{_smp_build_ncpus} \
%{?excluded_tests:--exclude-regex "($ctest_exclude_regex)"}
popd
%ldconfig_scriptlets
%files
%license sources/%{pyside_flavor}/COPYING*
%doc doc/changelogs/changes-*
%{_libdir}/lib%{pyside_flavor}.abi3.so.*
%if "%{pyside_flavor}" == "shiboken6"
%{_bindir}/shiboken6
%{_bindir}/shiboken_tool.py
%{mypython_sitearch}/shiboken6/
%{mypython_sitearch}/shiboken6_generator/
%endif
%if "%{pyside_flavor}" == "pyside6"
%{_libdir}/libpyside6qml.abi3.so.*
%dir %{_qt6_pluginsdir}/designer
%{_qt6_pluginsdir}/designer/libPySidePlugin.so
%{mypython_sitearch}/PySide6/
%endif
%{mypython_sitearch}/*.egg-info
%files devel
%if "%{pyside_flavor}" == "shiboken6"
%{_includedir}/shiboken6/
%{_qt6_cmakedir}/Shiboken6/
%{_qt6_cmakedir}/Shiboken6Tools/
%endif
%if "%{pyside_flavor}" == "pyside6"
%{_datadir}/PySide6/
%{_includedir}/PySide6/
%{_libdir}/libpyside6qml.abi3.so
%{_qt6_cmakedir}/PySide6/
%{_qt6_cmakedir}/PySide6Qml/
%endif
%{_libdir}/lib%{pyside_flavor}.abi3.so
%{_libdir}/pkgconfig/%{pyside_flavor}.pc
%changelog