Accepting request 1142540 from home:bnavigator:branches:KDE:Qt5

- Enable SLE15 python module for a more modern python than 3.6
  * disambiguate multiple providers of cmake(Pyside2) with
    pyside2_python_abi() provides
- Use llvm14 for 15.6 in order to workaround PYSIDE-2288:
  * Wrong type for QEvent::Type
  * avoids patch like deb#1051886 for libqt5-qtbase

OBS-URL: https://build.opensuse.org/request/show/1142540
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt5/python3-pyside2?expand=0&rev=86
This commit is contained in:
Christophe Marin 2024-01-29 15:43:03 +00:00 committed by Git OBS Bridge
parent 55d68c814d
commit f4bcb71a10
3 changed files with 98 additions and 37 deletions

4
_multibuild Normal file
View File

@ -0,0 +1,4 @@
<multibuild>
<flavor>sle15_python_module</flavor>
</multibuild>

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Jan 26 14:34:01 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Enable SLE15 python module for a more modern python than 3.6
* disambiguate multiple providers of cmake(Pyside2) with
pyside2_python_abi() provides
- Use llvm14 for 15.6 in order to workaround PYSIDE-2288:
* Wrong type for QEvent::Type
* avoids patch like deb#1051886 for libqt5-qtbase
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jan 12 09:22:25 UTC 2024 - Antonio Larrosa <alarrosa@suse.com> Fri Jan 12 09:22:25 UTC 2024 - Antonio Larrosa <alarrosa@suse.com>

View File

@ -1,5 +1,5 @@
# #
# spec file for package python3-pyside2 # spec file
# #
# Copyright (c) 2024 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
@ -18,10 +18,25 @@
%bcond_without tests %bcond_without tests
%global flavor @BUILD_FLAVOR@%{nil}
%if "%flavor" == "sle15_python_module"
%{?sle15_python_module_pythons}
%{!?sle15_python_module_pythons:ExclusiveArch: donotbuild}
%{!?sle15_python_module_pythons:BuildRequires: no-build-without-sle15_python_module}
%else
# SLE15: python3.6, Tumbleweed: primary python
%define pythons python3
%endif
%global mypython %pythons
%global __mypython %{expand:%%__%{mypython}}
%global mypython_sitearch %{expand:%%%{mypython}_sitearch}
%global mypython_version_nodots %{expand:%%%{mypython}_version_nodots}
%global mypython_soflags %(%__mypython -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))")
# QML imports created and used by examples # QML imports created and used by examples
%global __requires_exclude qmlimport\\((Charts|TextBalloonPlugin) %global __requires_exclude qmlimport\\((Charts|TextBalloonPlugin)
Name: python3-pyside2 Name: %{mypython}-pyside2
Version: 5.15.12 Version: 5.15.12
Release: 0 Release: 0
Summary: Python bindings for Qt Summary: Python bindings for Qt
@ -41,30 +56,41 @@ Patch2: 0001-cmake-Don-t-assume-qhelpgenerator-is-in-PATH.patch
# PATCH-FIX-UPSTREAM # PATCH-FIX-UPSTREAM
Patch3: 0001-Fix-tests-sample_privatector-sample_privatedtor-fail.patch Patch3: 0001-Fix-tests-sample_privatector-sample_privatedtor-fail.patch
# Provide the PyPI names # Provide the PyPI names
Provides: python3-PySide2 = %{version}-%{release} Provides: %{mypython}-PySide2 = %{version}-%{release}
Provides: python3-shiboken2 = %{version}-%{release} Provides: %{mypython}-shiboken2 = %{version}-%{release}
Provides: python3-shiboken2_generator = %{version}-%{release} Provides: %{mypython}-shiboken2_generator = %{version}-%{release}
Requires(post): update-alternatives
Requires(postun):update-alternatives
# SECTION common_dependencies # SECTION common_dependencies
%if 0%{?suse_version} > 1500 %if 0%{?suse_version} > 1500
# boo#1210176 - PYSIDE-2268 # boo#1210176 - PYSIDE-2268
BuildRequires: clang15-devel BuildRequires: clang15-devel
BuildRequires: llvm15-libclang13 BuildRequires: llvm15-libclang13
#!BuildIgnore: clang16 #!BuildIgnore: clang16
#!BuildIgnore: clang17
%else
%if 0%{?sle_version} >= 150600
# boo#1210176 - PYSIDE-2268, PY-2288
BuildRequires: clang14-devel
BuildRequires: llvm14-libclang13
#!BuildIgnore: clang16
#!BuildIgnore: clang17
%else %else
BuildRequires: clang-devel >= 3.9 BuildRequires: clang-devel >= 3.9
%endif %endif
%endif
BuildRequires: %{mypython}-Sphinx
BuildRequires: %{mypython}-devel
BuildRequires: %{mypython}-idna
BuildRequires: %{mypython}-setuptools
BuildRequires: %{mypython}-urllib3
BuildRequires: %{mypython}-wheel
BuildRequires: cmake BuildRequires: cmake
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libqt5-qtdeclarative-private-headers-devel BuildRequires: libqt5-qtdeclarative-private-headers-devel
BuildRequires: libxslt-devel BuildRequires: libxslt-devel
BuildRequires: python-rpm-macros 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} %if %{with tests}
BuildRequires: Mesa-dri BuildRequires: Mesa-dri
BuildRequires: xvfb-run BuildRequires: xvfb-run
@ -124,6 +150,12 @@ application and UI framework.
Summary: Header Files for PySide2 Summary: Header Files for PySide2
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 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
Requires: %{name} = %{version} Requires: %{name} = %{version}
# can be used to disambiguate multiple providers of cmake(PySide2) and cmake(Shiboken2)
Provides: pyside2_python_abi(%{mypython_soflags}) = %{version}
%if "%{mypython}" != "python3"
# Can only build for one flavor at a time
Conflicts: python3-pyside2-devel
%endif
%description devel %description devel
Files needed for development with the PySide2 bindings Files needed for development with the PySide2 bindings
@ -133,8 +165,12 @@ for Qt.
Summary: Examples for using PySide2 Summary: Examples for using PySide2
License: BSD-3-Clause License: BSD-3-Clause
Requires: %{name} = %{version} Requires: %{name} = %{version}
%if "%{mypython}" != "python3"
Conflicts: python3-pyside2-examples
%endif
BuildArch: noarch BuildArch: noarch
%description examples %description examples
Examples and Tutorials for the PySide2 bindings for Qt. Examples and Tutorials for the PySide2 bindings for Qt.
@ -150,7 +186,7 @@ _libsuffix=$(echo %{_lib} | cut -b4-)
-DCMAKE_C_FLAGS:STRING="" \ -DCMAKE_C_FLAGS:STRING="" \
-DCMAKE_CXX_FLAGS:STRING="" \ -DCMAKE_CXX_FLAGS:STRING="" \
-DCMAKE_EXE_LINKER_FLAGS:STRING="" \ -DCMAKE_EXE_LINKER_FLAGS:STRING="" \
-DPYTHON_EXECUTABLE:STRING=python3 \ -DPYTHON_EXECUTABLE:STRING=%{__mypython} \
-DCMAKE_BUILD_RPATH_USE_ORIGIN:BOOL=ON \ -DCMAKE_BUILD_RPATH_USE_ORIGIN:BOOL=ON \
%if %{with tests} %if %{with tests}
-DBUILD_TESTS:BOOL=ON -DBUILD_TESTS:BOOL=ON
@ -161,10 +197,11 @@ _libsuffix=$(echo %{_lib} | cut -b4-)
%install %install
%cmake_install %cmake_install
sed -i 's#env python$#python%{python3_bin_suffix}#' \ %python_clone -a %{buildroot}%{_bindir}/pyside2-lupdate
%{buildroot}%{_bindir}/pyside_tool.py %python_clone -a %{buildroot}%{_bindir}/pyside_tool.py
%python_clone -a %{buildroot}%{_bindir}/shiboken2
# Broken and conflicts with python3-pyside6 # Broken and conflicts with python3X-pyside6
rm %{buildroot}%{_bindir}/shiboken_tool.py rm %{buildroot}%{_bindir}/shiboken_tool.py
# No use on linux # No use on linux
@ -174,16 +211,16 @@ rm %{buildroot}%{_datadir}/PySide2/typesystems/*_{mac,win}.xml
cp -r build/sources/pyside2/PySide2/*.pyi \ cp -r build/sources/pyside2/PySide2/*.pyi \
build/sources/pyside2/PySide2/py.typed \ build/sources/pyside2/PySide2/py.typed \
build/sources/pyside2/PySide2/support \ build/sources/pyside2/PySide2/support \
%{buildroot}%{python3_sitearch}/PySide2/ %{buildroot}%{mypython_sitearch}/PySide2/
# this is not ideal, but at least we get some python dist metadata # this is not ideal, but at least we get some python dist metadata
python3 setup.py dist_info %{__mypython} setup.py dist_info
for d in *.dist-info; do for d in *.dist-info; do
# the commands were copied verbatim, not wrapped by entry-points. # the commands were copied verbatim, not wrapped by entry-points.
rm -f $d/entry_points.txt rm -f $d/entry_points.txt
%if %{pkg_vcmp python3-setuptools < 63} %if %{pkg_vcmp %{mypython}-setuptools < 63}
cp -r $d %{buildroot}%{python3_sitearch}/${d/.dist-info/-%{version}.dist-info} cp -r $d %{buildroot}%{mypython_sitearch}/${d/.dist-info/-%{version}.dist-info}
%else %else
cp -r $d %{buildroot}%{python3_sitearch}/${d} cp -r $d %{buildroot}%{mypython_sitearch}/${d}
%endif %endif
done done
@ -192,14 +229,14 @@ cp -R examples %{buildroot}%{_datadir}/PySide2
%fdupes %{buildroot}%{_datadir}/PySide2/examples/ %fdupes %{buildroot}%{_datadir}/PySide2/examples/
%fdupes %{buildroot}%{_libqt5_libdir}/cmake/ %fdupes %{buildroot}%{_libqt5_libdir}/cmake/
%fdupes %{buildroot}%{python3_sitearch} %fdupes %{buildroot}%{mypython_sitearch}
%check %check
%if %{with tests} %if %{with tests}
# Set some environment variables # Set some environment variables
export PATH=%{_libqt5_bindir}:$PATH export PATH=%{_libqt5_bindir}:$PATH
export LD_LIBRARY_PATH=%{buildroot}%{_libqt5_libdir}:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=%{buildroot}%{_libqt5_libdir}:$LD_LIBRARY_PATH
export PYTHONPATH=%{buildroot}%{python3_sitearch}:$PWD/build/sources/pyside2/tests/pysidetest export PYTHONPATH=%{buildroot}%{mypython_sitearch}:$PWD/build/sources/pyside2/tests/pysidetest
%if 0%{?sle_version} && 0%{?sle_version} <= 150300 %if 0%{?sle_version} && 0%{?sle_version} <= 150300
# Leap 15.3: ctest searches the libs before shiboken_paths.py can set the search path (!?) # 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 for binding in $PWD/build/sources/shiboken2/tests/lib*; do
@ -218,7 +255,7 @@ 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|QtWebEngineWidgets_pyside-474-qtwebengineview"
ctest_exclude_regex="$ctest_exclude_regex|QtWebEngineCore_web_engine_custom_scheme" ctest_exclude_regex="$ctest_exclude_regex|QtWebEngineCore_web_engine_custom_scheme"
%if 0%{?suse_version} > 1500 %if %{mypython_version_nodots} >= 311
# Blacklist broken test with python 3.11 # Blacklist broken test with python 3.11
ctest_exclude_regex="$ctest_exclude_regex|signal_enum_test|QtCore_qenum_test" ctest_exclude_regex="$ctest_exclude_regex|signal_enum_test|QtCore_qenum_test"
%endif %endif
@ -247,29 +284,39 @@ pushd build/sources/pyside2
popd popd
%endif %endif
%ldconfig_scriptlets %post
%{?ldconfig}
%python_install_alternative pyside2-lupdate
%python_install_alternative pyside_tool.py
%python_install_alternative shiboken2
%postun
%{?ldconfig}
%python_uninstall_alternative pyside2-lupdate
%python_uninstall_alternative pyside_tool.py
%python_uninstall_alternative shiboken2
%files %files
%license LICENSE.* %license LICENSE.*
%doc dist/changes* %doc dist/changes*
%{_bindir}/pyside2-lupdate %python_alternative %{_bindir}/pyside2-lupdate
%{_bindir}/pyside_tool.py %python_alternative %{_bindir}/pyside_tool.py
%{_bindir}/shiboken2 %python_alternative %{_bindir}/shiboken2
%{_libqt5_libdir}/libpyside2.%{py3_soflags}.so.* %{_libqt5_libdir}/libpyside2.%{mypython_soflags}.so.*
%{_libqt5_libdir}/libshiboken2.%{py3_soflags}.so.* %{_libqt5_libdir}/libshiboken2.%{mypython_soflags}.so.*
%{python3_sitearch}/PySide2/ %{mypython_sitearch}/PySide2/
%{python3_sitearch}/PySide2-%{version}.dist-info %{mypython_sitearch}/PySide2-%{version}.dist-info
%{python3_sitearch}/shiboken2/ %{mypython_sitearch}/shiboken2/
%{python3_sitearch}/shiboken2-%{version}.dist-info %{mypython_sitearch}/shiboken2-%{version}.dist-info
%{python3_sitearch}/shiboken2_generator/ %{mypython_sitearch}/shiboken2_generator/
%{python3_sitearch}/shiboken2_generator-%{version}.dist-info %{mypython_sitearch}/shiboken2_generator-%{version}.dist-info
%files devel %files devel
%{_datadir}/PySide2/ %{_datadir}/PySide2/
%{_includedir}/PySide2/ %{_includedir}/PySide2/
%{_includedir}/shiboken2/ %{_includedir}/shiboken2/
%{_libqt5_libdir}/libpyside2.%{py3_soflags}.so %{_libqt5_libdir}/libpyside2.%{mypython_soflags}.so
%{_libqt5_libdir}/libshiboken2.%{py3_soflags}.so %{_libqt5_libdir}/libshiboken2.%{mypython_soflags}.so
%{_libqt5_libdir}/cmake/PySide2-%{version} %{_libqt5_libdir}/cmake/PySide2-%{version}
%{_libqt5_libdir}/cmake/Shiboken2-%{version} %{_libqt5_libdir}/cmake/Shiboken2-%{version}
%{_libqt5_libdir}/pkgconfig/pyside2.pc %{_libqt5_libdir}/pkgconfig/pyside2.pc