From bc20522e6a48c48b6cfd30a2e3da64815fb0161514141d63de0060b51a403652 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Wed, 10 Apr 2024 18:55:04 +0000 Subject: [PATCH] pyside 6.7.0 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt6/python3-pyside6?expand=0&rev=65 --- ...-to-revert-of-QAudio-QtAudio-namespa.patch | 225 ++++++++++++++++++ _constraints | 2 +- _service | 16 ++ pyside-setup-everywhere-src-6.6.2.tar.xz | 3 - pyside-setup-everywhere-src-6.7.0~git.obscpio | 3 + pyside-setup-everywhere-src.obsinfo | 4 + python3-pyside6.changes | 12 + python3-pyside6.spec | 21 +- 8 files changed, 275 insertions(+), 11 deletions(-) create mode 100644 0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch create mode 100644 _service delete mode 100644 pyside-setup-everywhere-src-6.6.2.tar.xz create mode 100644 pyside-setup-everywhere-src-6.7.0~git.obscpio create mode 100644 pyside-setup-everywhere-src.obsinfo diff --git a/0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch b/0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch new file mode 100644 index 0000000..3ceef0a --- /dev/null +++ b/0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch @@ -0,0 +1,225 @@ +From 8daf9fb00fd805ce12a6ab18a9af7a5968b78a93 Mon Sep 17 00:00:00 2001 +From: Friedemann Kleint +Date: Tue, 9 Apr 2024 09:44:15 +0200 +Subject: [PATCH] Multimedia: Adapt to revert of QAudio->QtAudio namespace + renaming + +Partially revert 4d761eaaf852f8d82925e111150f25c0dd5f3e83. + +Adapt to qtmultimedia/7fcea568c9c64f3bcebda21f0df02aa0107dfd0c, +reverting qtmultimedia/edaec2bf714c98d65f12c8ed9a2ffbd1603635a7. + +Task-number: QTBUG-123997 +Pick-to: 6.7 +Change-Id: Ibd0ad737293f4b9107909f37554c03f64bce5d1e +--- + .../multimedia/audiooutput/audiooutput.py | 22 +++++++++---------- + .../multimedia/audiosource/audiosource.py | 16 +++++++------- + .../PySide6/QtMultimedia/CMakeLists.txt | 2 +- + .../QtMultimedia/typesystem_multimedia.xml | 8 +------ + sources/pyside6/PySide6/glue/qtmultimedia.cpp | 3 ++- + sources/pyside6/libpyside/signalmanager.cpp | 5 ----- + 6 files changed, 23 insertions(+), 33 deletions(-) + +diff --git a/examples/multimedia/audiooutput/audiooutput.py b/examples/multimedia/audiooutput/audiooutput.py +index 5219bf652..06d52f68a 100644 +--- a/examples/multimedia/audiooutput/audiooutput.py ++++ b/examples/multimedia/audiooutput/audiooutput.py +@@ -10,7 +10,7 @@ from struct import pack + + from PySide6.QtCore import (QByteArray, QIODevice, Qt, QSysInfo, QTimer, + qWarning, Slot) +-from PySide6.QtMultimedia import (QtAudio, QAudioFormat, ++from PySide6.QtMultimedia import (QAudio, QAudioFormat, + QAudioSink, QMediaDevices) + from PySide6.QtWidgets import (QApplication, QComboBox, QHBoxLayout, QLabel, + QMainWindow, QPushButton, QSlider, +@@ -209,7 +209,7 @@ class AudioTest(QMainWindow): + + @Slot() + def pull_timer_expired(self): +- if self.m_audioSink is not None and self.m_audioSink.state() != QtAudio.StoppedState: ++ if self.m_audioSink is not None and self.m_audioSink.state() != QAudio.StoppedState: + bytes_free = self.m_audioSink.bytesFree() + data = self.m_generator.read(bytes_free) + if data: +@@ -234,28 +234,28 @@ class AudioTest(QMainWindow): + + @Slot() + def toggle_suspend_resume(self): +- if self.m_audioSink.state() == QtAudio.State.SuspendedState: ++ if self.m_audioSink.state() == QAudio.SuspendedState: + qWarning("status: Suspended, resume()") + self.m_audioSink.resume() + self.m_suspendResumeButton.setText(self.SUSPEND_LABEL) +- elif self.m_audioSink.state() == QtAudio.State.ActiveState: ++ elif self.m_audioSink.state() == QAudio.ActiveState: + qWarning("status: Active, suspend()") + self.m_audioSink.suspend() + self.m_suspendResumeButton.setText(self.RESUME_LABEL) +- elif self.m_audioSink.state() == QtAudio.State.StoppedState: ++ elif self.m_audioSink.state() == QAudio.StoppedState: + qWarning("status: Stopped, resume()") + self.m_audioSink.resume() + self.m_suspendResumeButton.setText(self.SUSPEND_LABEL) +- elif self.m_audioSink.state() == QtAudio.State.IdleState: ++ elif self.m_audioSink.state() == QAudio.IdleState: + qWarning("status: IdleState") + + state_map = { +- QtAudio.State.ActiveState: "ActiveState", +- QtAudio.State.SuspendedState: "SuspendedState", +- QtAudio.State.StoppedState: "StoppedState", +- QtAudio.State.IdleState: "IdleState"} ++ QAudio.ActiveState: "ActiveState", ++ QAudio.SuspendedState: "SuspendedState", ++ QAudio.StoppedState: "StoppedState", ++ QAudio.IdleState: "IdleState"} + +- @Slot(QtAudio.State) ++ @Slot("QAudio::State") + def handle_state_changed(self, state): + state = self.state_map.get(state, 'Unknown') + qWarning(f"state = {state}") +diff --git a/examples/multimedia/audiosource/audiosource.py b/examples/multimedia/audiosource/audiosource.py +index 40046f0a3..a78beb584 100644 +--- a/examples/multimedia/audiosource/audiosource.py ++++ b/examples/multimedia/audiosource/audiosource.py +@@ -19,7 +19,7 @@ from typing import Optional + import PySide6 + from PySide6.QtCore import QByteArray, QMargins, Qt, Slot, qWarning + from PySide6.QtGui import QPainter, QPalette +-from PySide6.QtMultimedia import QtAudio, QAudioDevice, QAudioFormat, QAudioSource, QMediaDevices ++from PySide6.QtMultimedia import QAudio, QAudioDevice, QAudioFormat, QAudioSource, QMediaDevices + from PySide6.QtWidgets import (QApplication, QComboBox, QPushButton, QSlider, QVBoxLayout, + QWidget, QLabel) + +@@ -164,10 +164,10 @@ class InputTest(QWidget): + self.m_audio_info = AudioInfo(format) + + self.m_audio_input = QAudioSource(device_info, format) +- initial_volume = QtAudio.convertVolume( ++ initial_volume = QAudio.convertVolume( + self.m_audio_input.volume(), +- QtAudio.LinearVolumeScale, +- QtAudio.LogarithmicVolumeScale, ++ QAudio.LinearVolumeScale, ++ QAudio.LogarithmicVolumeScale, + ) + self.m_volume_slider.setValue(int(round(initial_volume * 100))) + self.toggle_mode() +@@ -196,10 +196,10 @@ class InputTest(QWidget): + def toggle_suspend(self): + # toggle suspend/resume + state = self.m_audio_input.state() +- if (state == QtAudio.SuspendedState) or (state == QtAudio.StoppedState): ++ if (state == QAudio.SuspendedState) or (state == QAudio.StoppedState): + self.m_audio_input.resume() + self.m_suspend_resume_button.setText("Suspend recording") +- elif state == QtAudio.ActiveState: ++ elif state == QAudio.ActiveState: + self.m_audio_input.suspend() + self.m_suspend_resume_button.setText("Resume recording") + # else no-op +@@ -212,8 +212,8 @@ class InputTest(QWidget): + + @Slot(int) + def slider_changed(self, value): +- linearVolume = QtAudio.convertVolume( +- value / float(100), QtAudio.LogarithmicVolumeScale, QtAudio.LinearVolumeScale ++ linearVolume = QAudio.convertVolume( ++ value / float(100), QAudio.LogarithmicVolumeScale, QAudio.LinearVolumeScale + ) + + self.m_audio_input.setVolume(linearVolume) +diff --git a/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt b/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt +index 61f52cc2b..5cac97ca9 100644 +--- a/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt ++++ b/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt +@@ -12,6 +12,7 @@ ${QtMultimedia_GEN_DIR}/qaudioinput_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qaudiooutput_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qaudiosink_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qaudiosource_wrapper.cpp ++${QtMultimedia_GEN_DIR}/qaudio_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qcameraformat_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qcameradevice_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qcamera_wrapper.cpp +@@ -28,7 +29,6 @@ ${QtMultimedia_GEN_DIR}/qmediatimerange_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qmediatimerange_interval_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qscreencapture_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qsoundeffect_wrapper.cpp +-${QtMultimedia_GEN_DIR}/qtaudio_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qtvideo_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qvideoframe_wrapper.cpp + ${QtMultimedia_GEN_DIR}/qvideoframeformat_wrapper.cpp +diff --git a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml b/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml +index dc3534299..c4de5dc9a 100644 +--- a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml ++++ b/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml +@@ -8,7 +8,7 @@ + + + +- ++ + + + +@@ -64,9 +64,6 @@ + + + +- +- +- + + + +@@ -81,9 +78,6 @@ + + + +- +- +- + + + +diff --git a/sources/pyside6/PySide6/glue/qtmultimedia.cpp b/sources/pyside6/PySide6/glue/qtmultimedia.cpp +index d193b1bd3..ac8434b97 100644 +--- a/sources/pyside6/PySide6/glue/qtmultimedia.cpp ++++ b/sources/pyside6/PySide6/glue/qtmultimedia.cpp +@@ -2,6 +2,7 @@ + // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + + // @snippet qvideoframe-bits ++#include "object.h" + %BEGIN_ALLOW_THREADS + %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1); + %END_ALLOW_THREADS +@@ -23,5 +24,5 @@ const auto size = %CPPSELF.byteCount(); + + // @snippet qtaudio-namespace-compatibility-alias + Py_INCREF(pyType); +-PyModule_AddObject(module, "QAudio", reinterpret_cast(pyType)); ++PyModule_AddObject(module, "QtAudio", reinterpret_cast(pyType)); + // @snippet qtaudio-namespace-compatibility-alias +diff --git a/sources/pyside6/libpyside/signalmanager.cpp b/sources/pyside6/libpyside/signalmanager.cpp +index 625e4a405..557f130e0 100644 +--- a/sources/pyside6/libpyside/signalmanager.cpp ++++ b/sources/pyside6/libpyside/signalmanager.cpp +@@ -813,11 +813,6 @@ static PyObject *parseArguments(const QMetaMethod &method, void **args) + for (qsizetype i = 0; i < argsSize; ++i) { + void *data = args[i+1]; + auto param = paramTypes.at(i); +-#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) +- // Qt 6.7 renamed namespace "QAudio"->"QtAudio" except for signals +- if (param.startsWith("QAudio::"_ba)) +- param.insert(1, 't'); +-#endif + Shiboken::Conversions::SpecificConverter converter(param.constData()); + if (!converter) { + PyErr_SetString(PyExc_TypeError, msgCannotConvertParameter(method, i).constData()); +-- +2.44.0 + diff --git a/_constraints b/_constraints index 6a18e87..1c6e093 100644 --- a/_constraints +++ b/_constraints @@ -15,7 +15,7 @@ - 6 + 7 6 diff --git a/_service b/_service new file mode 100644 index 0000000..5dfbb12 --- /dev/null +++ b/_service @@ -0,0 +1,16 @@ + + + disable + 6.7.0~git + git://code.qt.io/pyside/pyside-setup.git + 6.7.0 + git + pyside-setup-everywhere-src + + + + + *.tar + xz + + diff --git a/pyside-setup-everywhere-src-6.6.2.tar.xz b/pyside-setup-everywhere-src-6.6.2.tar.xz deleted file mode 100644 index c519e9c..0000000 --- a/pyside-setup-everywhere-src-6.6.2.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:14620b694d7af4c978443016292d3d2108ba5dc105f4170e3b71eadcaf04c9f0 -size 13975896 diff --git a/pyside-setup-everywhere-src-6.7.0~git.obscpio b/pyside-setup-everywhere-src-6.7.0~git.obscpio new file mode 100644 index 0000000..d03c711 --- /dev/null +++ b/pyside-setup-everywhere-src-6.7.0~git.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef1c4c50106645c91cabb4fc61cc000cf82c75063630c58b10e3b0cd2ddb589a +size 31221773 diff --git a/pyside-setup-everywhere-src.obsinfo b/pyside-setup-everywhere-src.obsinfo new file mode 100644 index 0000000..c1dee6c --- /dev/null +++ b/pyside-setup-everywhere-src.obsinfo @@ -0,0 +1,4 @@ +name: pyside-setup-everywhere-src +version: 6.7.0~git +mtime: 1712333469 +commit: 06744deed8bfb71255a74dee9f12c8ec1f79eb49 diff --git a/python3-pyside6.changes b/python3-pyside6.changes index 81c4c2c..8ea7c77 100644 --- a/python3-pyside6.changes +++ b/python3-pyside6.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Apr 9 11:46:05 UTC 2024 - Christophe Marin + +- Add upstream change: + * 0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch + +------------------------------------------------------------------- +Mon Apr 8 08:50:25 UTC 2024 - Christophe Marin + +- 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 diff --git a/python3-pyside6.spec b/python3-pyside6.spec index 1d0ba75..8bd7578 100644 --- a/python3-pyside6.spec +++ b/python3-pyside6.spec @@ -17,7 +17,7 @@ %define tar_name pyside-setup-everywhere-src -%define short_version 6.6 +%define short_version 6.7 %global flavor @BUILD_FLAVOR@%{nil} %if "%flavor" == "" @@ -43,14 +43,17 @@ ExclusiveArch: donotbuild %endif Name: %{mypython}-%{pyside_flavor} -Version: 6.6.2 +Version: 6.7.0~git 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 +# Source: https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-%%{version}-src/%%{tar_name}-%%{version}.tar.xz +Source0: %{tar_name}-%{version}.tar.xz # PATCH-FIX-OPENSUSE Patch0: 0001-Always-link-to-python-libraries.patch +# PATCH-FIX-UPSTREAM +Patch1: 0001-Multimedia-Adapt-to-revert-of-QAudio-QtAudio-namespa.patch # SECTION common_dependencies BuildRequires: clang-devel BuildRequires: %{mypython}-Sphinx @@ -69,7 +72,10 @@ 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 @@ -113,6 +119,7 @@ BuildRequires: cmake(Qt6Qml) BuildRequires: cmake(Qt6Quick) BuildRequires: cmake(Qt6Quick3D) BuildRequires: cmake(Qt6QuickControls2) +BuildRequires: cmake(Qt6QuickTest) BuildRequires: cmake(Qt6QuickWidgets) BuildRequires: cmake(Qt6RemoteObjects) BuildRequires: cmake(Qt6Scxml) @@ -239,7 +246,7 @@ ctest_exclude_regex="smart_smart_pointer" %define xvfb_command xvfb-run -s "-screen 0 1600x1200x16 -ac +extension GLX +render -noreset" \\ %define excluded_tests 1 -# Excluded tests (last update: 2024-03-27) +# Excluded tests (last update: 2024-04-08) # QtWebEngineWidgets_pyside-474-qtwebengineview fails with 'ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer' # QtGui_qpen_test times out # QtMultimediaWidgets_qmultimediawidgets aborts @@ -254,9 +261,9 @@ ctest_exclude_regex="QtWebEngineWidgets_pyside-474-qtwebengineview|QtGui_qpen_te %ifarch aarch64 ctest_exclude_regex="$ctest_exclude_regex|registry_existence_test|QtWebEngineCore_web_engine_custom_scheme" %endif -# Test broken by https://codereview.qt-project.org/c/pyside/pyside-setup/+/478366 -%ifarch aarch64 armv7l armv7hl -ctest_exclude_regex="$ctest_exclude_regex|QtOpenGL_qopenglwindow_test" +# 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