%global toolchain clang # tmpl.py files fail to bytecompile %global _python_bytecompile_errors_terminate_build 0 %global pypi_name pyside6 %global camel_name PySide6 %global qt6ver 6.6 # Pass `--without tests` to rpmbuild or mock to skip the test suite %bcond_without tests Name: python-%{pypi_name} Epoch: 1 Version: 6.6.0 Release: 1%{?dist} Summary: Python bindings for the Qt 5 cross-platform application and UI framework License: BSD and GPLv2 and GPLv3 and LGPLv3 URL: https://wiki.qt.io/Qt_for_Python Source0: https://download.qt.io/official_releases/QtForPython/%{pypi_name}/%{camel_name}-%{version}-src/pyside-setup-everywhere-src-%{version}.tar.xz # Assorted build fixes Patch0: pyside6_build.patch BuildRequires: cmake BuildRequires: ninja-build BuildRequires: clang-devel llvm-devel BuildRequires: libxml2-devel BuildRequires: libxslt-devel BuildRequires: python3-devel # Shiboken2 BuildRequires: cmake(Qt6Core) >= %{qt6ver} BuildRequires: cmake(Qt6Gui) >= %{qt6ver} BuildRequires: cmake(Qt6Xml) >= %{qt6ver} BuildRequires: cmake(Qt6Widgets) >= %{qt6ver} # Needed for Cmake UI Config BuildRequires: cmake(Qt6UiTools) >= %{qt6ver} # PySide6 BuildRequires: qt6-qtbase-private-devel >= %{qt6ver} BuildRequires: qt6-qtbase-static >= %{qt6ver} BuildRequires: cmake(Qt6Charts) >= %{qt6ver} BuildRequires: cmake(Qt6DataVisualization) >= %{qt6ver} BuildRequires: cmake(Qt6Location) >= %{qt6ver} BuildRequires: cmake(Qt6Multimedia) >= %{qt6ver} BuildRequires: cmake(Qt6NetworkAuth) >= %{qt6ver} BuildRequires: cmake(Qt6Positioning) >= %{qt6ver} BuildRequires: cmake(Qt6QuickControls2) >= %{qt6ver} BuildRequires: cmake(Qt6RemoteObjects) >= %{qt6ver} BuildRequires: cmake(Qt6Scxml) >= %{qt6ver} BuildRequires: cmake(Qt6Sensors) >= %{qt6ver} BuildRequires: cmake(Qt6SerialPort) >= %{qt6ver} BuildRequires: cmake(Qt6Svg) >= %{qt6ver} BuildRequires: cmake(Qt6TextToSpeech) >= %{qt6ver} BuildRequires: cmake(Qt6WebSockets) >= %{qt6ver} BuildRequires: cmake(Qt63DCore) >= %{qt6ver} BuildRequires: cmake(Qt6Designer) >= %{qt6ver} BuildRequires: cmake(Qt6Help) >= %{qt6ver} BuildRequires: cmake(Qt6UiPlugin) >= %{qt6ver} %if %{with tests} # Tests use a fake graphical environment BuildRequires: /usr/bin/xvfb-run BuildRequires: mesa-dri-drivers %endif %description PySide6 is the official Python module from the Qt for Python project, which provides access to the complete Qt 6 framework. %package -n python3-%{pypi_name} Provides: python3-%{camel_name} = %{version}-%{release} Summary: %{summary} %description -n python3-%{pypi_name} PySide6 is the official Python module from the Qt for Python project, which provides access to the complete Qt 6 framework. %package -n python3-%{pypi_name}-devel Requires: pyside6-tools Requires: python3-shiboken6 Summary: Development files related to %{name} %description -n python3-%{pypi_name}-devel %{summary}. %package -n pyside6-tools Summary: PySide6 tools for the Qt 5 framework %description -n pyside6-tools PySide6 provides Python bindings for the Qt6 cross-platform application and UI framework. This package ships the following accompanying tools: * pyside6-rcc - PySide6 resource compiler * pyside6-uic - Python User Interface Compiler for PySide6 * pyside6-lupdate - update Qt Linguist translation files for PySide6 %package -n python3-shiboken6 Summary: Python / C++ bindings libraries for %camel_name %description -n python3-shiboken6 Shiboken is the Python binding generator that Qt for Python uses to create the PySide module, in other words, is the system we use to expose the Qt C++ API to Python. %package -n python3-shiboken6-devel Summary: Python / C++ bindings helper module for %camel_name Requires: python3-shiboken6 %description -n python3-shiboken6-devel Shiboken is the Python binding generator that Qt for Python uses to create the PySide module, in other words, is the system we use to expose the Qt C++ API to Python. %prep %autosetup -p1 -n pyside-setup-everywhere-src-%(echo %{version} | sed 's|\.0$||') %build %cmake -DUSE_PYTHON_VERSION=3 -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_TESTS=ON -DCMAKE_SKIP_RPATH=ON -DNO_QT_TOOLS=yes %cmake_build %install %cmake_install # # Generate egg-info manually and install since we're performing a cmake build. # # Copy CMake configuration files from the BINARY dir back to the SOURCE dir so # setuptools can find them. cp %{__cmake_builddir}/sources/shiboken6/shibokenmodule/{*.py,*.txt} sources/shiboken6/shibokenmodule/ cp %{__cmake_builddir}/sources/pyside6/PySide6/*.py sources/pyside6/PySide6/ %{__python3} setup.py egg_info for name in PySide6 shiboken6 shiboken6_generator; do mkdir -p %{buildroot}%{python3_sitearch}/$name-%{version}-py%{python3_version}.egg-info cp -p $name.egg-info/{PKG-INFO,not-zip-safe,top_level.txt} \ %{buildroot}%{python3_sitearch}/$name-%{version}-py%{python3_version}.egg-info/ done # Fix all Python shebangs recursively # -p preserves timestamps # -n prevents creating ~backup files # -i specifies the interpreter for the shebang # Need to list files that do not match ^[a-zA-Z0-9_]+\.py$ explicitly! %py3_shebang_fix %{buildroot}%{_bindir}/* %check # Do basic import test (even without the test bcond) export LD_LIBRARY_PATH="%{buildroot}%{_libdir}" %py3_check_import PySide6 %py3_check_import shiboken6 %if %{with tests} buildsrcdir=$PWD/%{__cmake_builddir}/sources/ export LD_LIBRARY_PATH=$buildsrcdir/shiboken6/tests/libminimal:$buildsrcdir/shiboken6/tests/libsmart:$buildsrcdir/shiboken6/tests/libsample:$buildsrcdir/shiboken6/tests/libother:$buildsrcdir/shiboken6/tests/libother:$buildsrcdir/pyside6/tests/pysidetest:%{buildroot}%{_libdir} export PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}:$buildsrcdir/pyside6/tests/pysidetest/" export PYTHONDONTWRITEBYTECODE=1 pushd %{__cmake_builddir}/sources/shiboken6 xvfb-run ctest || : popd pushd %{__cmake_builddir}/sources/pyside6 xvfb-run ctest || : popd %endif %files -n python3-%{pypi_name} %license sources/pyside6/COPYING %doc README.md %{_libdir}/libpyside6*.so.6.6* %{_libdir}/qt6/plugins/designer/libPySidePlugin.so %{python3_sitearch}/%{camel_name}/ %{python3_sitearch}/%{camel_name}-%{version}-py%{python3_version}.egg-info/ %files -n python3-%{pypi_name}-devel %{_datadir}/PySide6/ %{_includedir}/PySide6/ %{_libdir}/libpyside6*.so %{_libdir}/cmake/PySide6*/ %{_libdir}/pkgconfig/pyside6.pc %files -n pyside6-tools %doc README.pyside6* %{_bindir}/pyside* %{python3_sitearch}/pyside6_deploy_lib %{python3_sitearch}/pyside6_project %{python3_sitearch}/pyside6_qtpy2cpp_lib %files -n python3-shiboken6 %license sources/shiboken6/COPYING.libshiboken %doc README.shiboken6.md %{_bindir}/shiboken6 %{_bindir}/shiboken_tool.py %{_libdir}/libshiboken6*.so.6.6* %{python3_sitearch}/shiboken6/ %{python3_sitearch}/shiboken6-%{version}-py%{python3_version}.egg-info/ %files -n python3-shiboken6-devel %doc README.shiboken6-generator.md %{_includedir}/shiboken6/ %{_libdir}/cmake/Shiboken6*/ %{_libdir}/libshiboken6*.so %{_libdir}/pkgconfig/shiboken6.pc %{python3_sitearch}/shiboken6_generator/ %{python3_sitearch}/shiboken6_generator-%{version}-py%{python3_version}.egg-info/ %changelog * Sat Dec 02 2023 Sandro Mani - 6.6.0-1 - Update to 6.6.0