Skip to content

Commit 5112a0a

Browse files
authored
Merge pull request #7911 from daniviga/f29-patch
Fix a build error on Fedora 29+
2 parents 953ea96 + d0aae2f commit 5112a0a

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

rpm/qgis.spec.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Source5: %{name}-mime.xml
4646
# https://github.com/qgis/QGIS/commit/718581ffb12b723f9a3c0ae01b7ec2d8aed9d4bb.patch
4747
Patch0: %{name}-lib64.patch
4848

49+
# Fix build error "PyCapsule_GetPointer called with incorrect name" on >=F29
50+
# https://issues.qgis.org/issues/19476
51+
Patch1: %{name}-fix-sip-name.patch
52+
4953
# Compiling stuff
5054
BuildRequires: bison
5155
BuildRequires: clang
@@ -184,6 +188,9 @@ Please refer to %{name}-server-README.fedora for details!
184188
%prep
185189
%setup -q
186190
%patch0 -p0 -b .lib64
191+
%if 0%{?fedora} >= 29
192+
%patch1 -p1
193+
%endif
187194

188195
# Remove executable permissions from source code files
189196
find . \( -name "*.cpp" -o -name "*.h" \) -type f -perm /111 -execdir chmod -x {} \+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
--- qgis-3.2.1/python/CMakeLists.txt.orig 2018-07-28 21:05:44.650275372 +0100
2+
+++ qgis-3.2.1/python/CMakeLists.txt 2018-07-28 21:06:31.702276533 +0100
3+
@@ -174,7 +174,7 @@ FILE(GLOB_RECURSE sip_files_core core/*.
4+
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core})
5+
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.core.api)
6+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
7+
- SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n sip)
8+
+ SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n PyQt5.sip)
9+
ENDIF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
10+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.18) OR (${SIP_VERSION_STR} VERSION_GREATER 4.18))
11+
SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -y ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_core.pyi)
12+
@@ -198,7 +198,7 @@ IF (WITH_GUI)
13+
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_gui})
14+
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.gui.api)
15+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
16+
- SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n sip)
17+
+ SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n PyQt5.sip)
18+
ENDIF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
19+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.18) OR (${SIP_VERSION_STR} VERSION_GREATER 4.18))
20+
SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -y ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_gui.pyi)
21+
@@ -227,7 +227,7 @@ IF (WITH_SERVER AND WITH_SERVER_PLUGINS)
22+
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_server})
23+
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.server.api)
24+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
25+
- SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n sip)
26+
+ SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n PyQt5.sip)
27+
ENDIF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
28+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.18) OR (${SIP_VERSION_STR} VERSION_GREATER 4.18))
29+
SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -y ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_server.pyi)
30+
@@ -257,7 +257,7 @@ FILE(GLOB_RECURSE sip_files_analysis ana
31+
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_analysis})
32+
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.analysis.api)
33+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
34+
- SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n sip)
35+
+ SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -n PyQt5.sip)
36+
ENDIF((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11))
37+
IF((${SIP_VERSION_STR} VERSION_EQUAL 4.18) OR (${SIP_VERSION_STR} VERSION_GREATER 4.18))
38+
SET(SIP_EXTRA_OPTIONS ${SIP_EXTRA_OPTIONS} -y ${QGIS_PYTHON_OUTPUT_DIRECTORY}/_analysis.pyi)
39+
diff -rup qgis-3.2.1.orig/python/plugins/processing/gui/NumberInputPanel.py qgis-3.2.1/python/plugins/processing/gui/NumberInputPanel.py
40+
--- qgis-3.2.1.orig/python/plugins/processing/gui/NumberInputPanel.py 2018-07-20 13:00:05.000000000 +0100
41+
+++ qgis-3.2.1/python/plugins/processing/gui/NumberInputPanel.py 2018-07-29 06:01:51.016024892 +0100
42+
@@ -27,7 +27,7 @@ __revision__ = '1edf372fb80f2a35c77b128d
43+
44+
import os
45+
import math
46+
-import sip
47+
+import PyQt5.sip as sip
48+
import warnings
49+
50+
from qgis.PyQt import uic
51+
diff -rup qgis-3.2.1.orig/src/python/qgspythonutilsimpl.cpp qgis-3.2.1/src/python/qgspythonutilsimpl.cpp
52+
--- qgis-3.2.1.orig/src/python/qgspythonutilsimpl.cpp 2018-07-20 13:00:05.000000000 +0100
53+
+++ qgis-3.2.1/src/python/qgspythonutilsimpl.cpp 2018-07-29 06:03:57.048028001 +0100
54+
@@ -104,7 +104,7 @@ bool QgsPythonUtilsImpl::checkSystemImpo
55+
runString( "sys.path = [" + newpaths.join( QStringLiteral( "," ) ) + "] + sys.path" );
56+
57+
// import SIP
58+
- if ( !runString( QStringLiteral( "import sip" ),
59+
+ if ( !runString( QStringLiteral( "import PyQt5.sip as sip" ),
60+
QObject::tr( "Couldn't load SIP module." ) + '\n' + QObject::tr( "Python support will be disabled." ) ) )
61+
{
62+
return false;

0 commit comments

Comments
 (0)