From 6adc9211dd877cd06295e44bd68c9f19c2d247c4 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sun, 8 Dec 2024 00:20:16 +0800 Subject: [PATCH] fix ldflags and linking libs --- PyQt4.spec | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/PyQt4.spec b/PyQt4.spec index 55b111e..41c92c6 100644 --- a/PyQt4.spec +++ b/PyQt4.spec @@ -3,11 +3,12 @@ %global __provides_exclude_from ^(%{python3_sitearch}/.*\\.so|%{_qt4_plugindir}/.*\\.so)$ Name: PyQt4 Version: 4.12.3 -Release: 2 +Release: 3 Summary: Python bindings for Qt4 -License: (GPLv3 or GPLv2 with exceptions) and BSD -Url: http://www.riverbankcomputing.com/software/pyqt/ -Source0: http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-%{version}/PyQt4_gpl_x11-%{version}.tar.gz/download?use_mirror=ufpr#/PyQt4_gpl_x11-%{version}.tar.gz +SourceLicense: GPL-3.0-only AND BSD-3-Clause +License: GPL-3.0-only +Url: https://www.riverbankcomputing.com/software/pyqt/ +Source0: https://www.riverbankcomputing.com/static/Downloads/PyQt4/%{version}/PyQt4_gpl_x11-%{version}.tar.gz Patch0001: qreal_float_support.diff Patch0002: PyQt4-4.12.3-pyframe_getback.patch @@ -41,6 +42,7 @@ The Qt4-devel package includes header files and libraries necessary for the Qt4 %package help Summary: This package contains help documents +License: GPL-3.0-only AND BSD-3-Clause BuildArch: noarch Requires: PyQt4 = %{version}-%{release} Provides: PyQt4-doc = %{version}-%{release} python-qt4-doc = %{version}-%{release} @@ -77,21 +79,30 @@ find examples/ -name "*.py" | xargs chmod a-x %build QT4DIR=%{_qt4_prefix} PATH=%{_qt4_bindir}:$PATH ; export PATH -install -d %{_target_platform}-python3 -cd %{_target_platform}-python3 -%{__python3} ../configure.py --assume-shared --confirm-license --no-timestamp --qmake=%{_qt4_qmake} --no-qsci-api \ - --sipdir=%{_datadir}/python3-sip/PyQt4 --verbose CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}" +%{__python3} ./configure.py --assume-shared --confirm-license --no-timestamp --qmake=%{_qt4_qmake} --no-qsci-api \ + --sipdir=%{_datadir}/python3-sip/PyQt4 --verbose CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LFLAGS="%{?build_ldflags}" + +# Some modules not requires X libraries +# Python sip not diferentiate qt modules and always add a X set of +# libs to link. We're explicitely this unecessary links +# Using same approach to add missin libpython linh + +for name in Qt dbus phonon QtAssistant QtCore QtDBus QtDeclarative QtGui QtMultimedia QtNetwork QtOpenGL QtScript QtSvg QtSql QtDesigner QtTest QtXml QtXmlPatterns QtHelp QtScriptTools; do + sed -i "s,^LIBS.*= ,LIBS = $(python3-config --libs --embed) ,g" ${name}/Makefile + sed -i "s#^LFLAGS.*= #LFLAGS = %{build_ldflags} #g" ${name}/Makefile +done +sed -i "s#^LFLAGS.*= #LFLAGS = %{build_ldflags} #g" designer/Makefile pyrcc/Makefile %make_build %install -%make_install INSTALL_ROOT=%{buildroot} -C %{_target_platform}-python3 +%make_install INSTALL_ROOT=%{buildroot} rm -rfv %{buildroot}%{python3_sitearch}/PyQt4/uic/port_v2/ %check diff -u ./sip/QtGui/opengl_types.sip.orig ./sip/QtGui/opengl_types.sip ||: %files -%doc LICENSE +%license LICENSE %{_qt4_plugindir}/designer/* %files devel @@ -111,6 +122,11 @@ diff -u ./sip/QtGui/opengl_types.sip.orig ./sip/QtGui/opengl_types.sip ||: %{_datadir}/python3-sip/PyQt4/ %changelog +* Sat Dec 07 2024 Funda Wang - 4.12.3-3 +- fix ldflags and linking libs +- drop workaround for multi version of python +- clearify license + * Thu Jul 20 2023 xu_ping <707078654@qq.com> - 4.12.3-2 - fix build error with python 3.11.4 -- Gitee