%global with_python3 1 %global python3_dbus_dir %(%{__python3} -c "import dbus.mainloop; print(dbus.mainloop.__path__[0])" 2>/dev/null || echo "%{python3_sitearch}/dbus/mainloop") # enable/disable individual modules # drop power64, it's not supported yet (than) %ifarch %{?qt5_qtwebengine_arches}%{?!qt5_qtwebengine_arches:%{ix86} x86_64 %{arm} aarch64 mips mipsel mips64el} %global webengine 0 %endif %global webkit 1 %global py3_sipdir %{_datadir}/sip/PyQt5 %global sip_ver 4.19.23 # see also https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/JQQ66XJSIT2FGTK2YQY7AXMEH5IXMPUX/ %undefine _strict_symbol_defs_build Summary: PyQt5 is Python bindings for Qt5 Name: python-qt5-epel Version: 5.15.0 Release: 3.0.1%{?dist} License: GPLv3 Url: http://www.riverbankcomputing.com/software/pyqt/ Source0: https://files.pythonhosted.org/packages/8c/90/82c62bbbadcca98e8c6fa84f1a638de1ed1c89e85368241e9cc43fcbc320/PyQt5-%{version}.tar.gz ## upstreamable patches Patch0: python-qt5_sipdir.patch # support newer Qt5 releases Patch1: PyQt5-Timeline.patch #BuildRequires: pkgconfig(dbus-1) BuildRequires: findutils BuildRequires: python%{python3_pkgversion} BuildRequires: python%{python3_pkgversion}-sip-devel >= %{sip_ver} %description %{summary}. %global __provides_exclude_from ^(%{_qt5_plugindir}/.*\\.so)$ %if 0%{?webengine} %package -n python%{python3_pkgversion}-qt5-webengine Summary: Python3 bindings for Qt5 WebEngine BuildRequires: pkgconfig(Qt5WebEngine) #Requires: python%{python3_pkgversion}-qt5%{?_isa} = %{version}-%{release} Requires: python%{python3_pkgversion}-qt5%{?_isa} = %{version} %{?python_provide:%python_provide python%{python3_pkgversion}-qt5-webengine} %description -n python%{python3_pkgversion}-qt5-webengine %{summary}. %endif %package -n python%{python3_pkgversion}-qt5-webkit Summary: Python3 bindings for Qt5 Webkit BuildRequires: pkgconfig(Qt5WebKit) BuildRequires: pkgconfig(Qt5WebKitWidgets) #Requires: python%{python3_pkgversion}-qt5%{?_isa} = %{version}-%{release} Requires: python%{python3_pkgversion}-qt5%{?_isa} = %{version} %{?python_provide:%python_provide python%{python3_pkgversion}-qt5-webkit} %description -n python%{python3_pkgversion}-qt5-webkit %{summary}. %prep %setup -q -n PyQt5-%{version} %patch0 -p1 %patch1 -p1 %build PATH=%{_qt5_bindir}:$PATH ; export PATH mkdir %{_target_platform}-python3 cp -a * %{_target_platform}-python3/ ||: pushd %{_target_platform}-python3 %{__python3} ./configure.py \ --assume-shared \ --confirm-license \ --qmake=%{_qt5_qmake} \ %{?py3_sip:--sip=%{_bindir}/python3-sip} \ %{?py3_sipdir:--sipdir=%{py3_sipdir}} \ --enable QtWebKit \ --enable QtWebKitWidgets \ --verbose \ QMAKE_CFLAGS_RELEASE="%{optflags}" \ QMAKE_CXXFLAGS_RELEASE="%{optflags} `pkg-config --cflags dbus-python`" \ QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}" #--dbus=%{_includedir}/dbus-1.0/ \ %make_build popd %install %make_install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-python3 rm -r %{buildroot}%{_datadir} \ %{buildroot}%{_bindir} \ %{buildroot}%{python3_sitearch}/PyQt5*info \ %{buildroot}%{python3_sitearch}/PyQt5/__init__.py \ %{buildroot}%{python3_sitearch}/PyQt5/py* \ %{buildroot}%{python3_sitearch}/PyQt5/Qt.so \ %{buildroot}%{python3_sitearch}/PyQt5/uic # ensure .so modules are executable for proper -debuginfo extraction find %{buildroot} -type f -name '*.so' | xargs chmod a+rx %if 0%{?webengine} %files -n python%{python3_pkgversion}-qt5-webengine %{python3_sitearch}/PyQt5/QtWebEngine.* %{python3_sitearch}/PyQt5/QtWebEngineCore.* %{python3_sitearch}/PyQt5/QtWebEngineWidgets.* %endif %files -n python%{python3_pkgversion}-qt5-webkit %{python3_sitearch}/PyQt5/QtWebKit.* %{python3_sitearch}/PyQt5/QtWebKitWidgets.* %changelog