From c0c3078d1c64ca26a5c5b036bca8d7020454b403806e7b9bbb9ec985258be300 Mon Sep 17 00:00:00 2001 From: Todd R Date: Thu, 21 Feb 2019 16:04:46 +0000 Subject: [PATCH] Accepting request 678046 from home:TheBlackCat:branches:KDE:Qt5 Fix building python-qt4 OBS-URL: https://build.opensuse.org/request/show/678046 OBS-URL: https://build.opensuse.org/package/show/KDE:Qt5/python-sip?expand=0&rev=27 --- fix_qt4_code_gen.patch | 70 ++++++++++++++++++++++++++++++++++++++++++ python-sip.changes | 8 +++++ python-sip.spec | 2 ++ 3 files changed, 80 insertions(+) create mode 100644 fix_qt4_code_gen.patch diff --git a/fix_qt4_code_gen.patch b/fix_qt4_code_gen.patch new file mode 100644 index 0000000..40cce2a --- /dev/null +++ b/fix_qt4_code_gen.patch @@ -0,0 +1,70 @@ +# HG changeset patch +# User Phil Thompson +# Date 1550579387 0 +# Node ID 7bd4d19479adc46c40e8d43629aaac871fae6cd7 +# Parent 4ab117a13343cd8d8f5804600936f445fb2d59ef +Fixed a code generation regression specific to PyQt4. + +diff -r 4ab117a13343 -r 7bd4d19479ad sipgen/gencode.c +--- a/sipgen/gencode.c Tue Feb 12 09:27:11 2019 +0000 ++++ b/sipgen/gencode.c Tue Feb 19 12:29:47 2019 +0000 +@@ -295,7 +295,7 @@ + static int emptyIfaceFile(sipSpec *pt, ifaceFileDef *iff); + static void declareLimitedAPI(int py_debug, moduleDef *mod, FILE *fp); + static int generatePluginSignalsTable(sipSpec *pt, classDef *cd, +- const char *pyqt_prefix, FILE *fp); ++ int pyqt_version, FILE *fp); + static int generatePyQt5ClassPlugin(sipSpec *pt, classDef *cd, FILE *fp); + static int generatePyQt4ClassPlugin(sipSpec *pt, classDef *cd, FILE *fp); + static void generateGlobalFunctionTableEntries(sipSpec *pt, moduleDef *mod, +@@ -15542,7 +15542,7 @@ + * Generate the PyQt4/5 signals table. + */ + static int generatePluginSignalsTable(sipSpec *pt, classDef *cd, +- const char *pyqt_prefix, FILE *fp) ++ int pyqt_version, FILE *fp) + { + int is_signals = FALSE; + +@@ -15586,8 +15586,8 @@ + "\n" + "\n" + "/* Define this type's signals. */\n" +-"static const %sQtSignal signals_%C[] = {\n" +- , pyqt_prefix, classFQCName(cd)); ++"static const pyqt%dQtSignal signals_%C[] = {\n" ++ , pyqt_version, classFQCName(cd)); + } + + /* +@@ -15628,9 +15628,9 @@ + + if (is_signals) + prcode(fp, +-" {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR}\n" ++" {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, %s}\n" + "};\n" +- ); ++ , (pyqt_version == 5 ? "SIP_NULLPTR" : "0")); + } + + return is_signals; +@@ -15643,7 +15643,7 @@ + */ + static int generatePyQt5ClassPlugin(sipSpec *pt, classDef *cd, FILE *fp) + { +- int is_signals = generatePluginSignalsTable(pt, cd, "pyqt5", fp); ++ int is_signals = generatePluginSignalsTable(pt, cd, 5, fp); + + prcode(fp, + "\n" +@@ -15696,7 +15696,7 @@ + */ + static int generatePyQt4ClassPlugin(sipSpec *pt, classDef *cd, FILE *fp) + { +- int is_signals = generatePluginSignalsTable(pt, cd, "pyqt4", fp); ++ int is_signals = generatePluginSignalsTable(pt, cd, 4, fp); + + prcode(fp, + "\n" + diff --git a/python-sip.changes b/python-sip.changes index 93f227b..ccacdd6 100644 --- a/python-sip.changes +++ b/python-sip.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Feb 21 15:13:17 UTC 2019 - Todd R + +- Add fix_qt4_code_gen.patch + Fixes python-qt4 building. Should be in next upstream release. + See: http://python.6.x6.nabble.com/PyQt4-compilation-error-with-sip-4-19-14-convert-std-nullptr-t-to-int-in-initialization-td5248504.html + From: https://www.riverbankcomputing.com/hg/sip/rev/7bd4d19479ad + ------------------------------------------------------------------- Wed Feb 13 09:54:09 UTC 2019 - Fabian Vogt diff --git a/python-sip.spec b/python-sip.spec index f375426..13c4af0 100644 --- a/python-sip.spec +++ b/python-sip.spec @@ -30,6 +30,8 @@ Source0: https://www.riverbankcomputing.com/static/Downloads/sip/sip-%{ve Patch0: disable-rpaths.diff # PATCH-FIX-OPENSUSE disable-strip.diff -- Disable stripping Patch1: disable-strip.diff +# PATCH-FIX-UPSTREAM fix_qt4_code_gen.patch -- Fixed a code generation regression specific to PyQt4. +Patch2: fix_qt4_code_gen.patch BuildRequires: %{python_module devel} BuildRequires: c++_compiler BuildRequires: fdupes