Accepting request 709775 from home:cgiboudeaux:branches:science

- Add 0001-Fix-build-with-pyside2-shiboken2-5.12.1.patch to fix
  build with recent shiboken2/pyside2 releases.

OBS-URL: https://build.opensuse.org/request/show/709775
OBS-URL: https://build.opensuse.org/package/show/science/FreeCAD?expand=0&rev=88
This commit is contained in:
2019-06-13 17:44:27 +00:00
committed by Git OBS Bridge
parent 4682ebafc3
commit 0c36b899ed
3 changed files with 98 additions and 2 deletions

View File

@@ -0,0 +1,88 @@
From 7d362752633f0e47cebc44f52db8dffbc3b3c2e6 Mon Sep 17 00:00:00 2001
From: Christophe Giboudeaux <christophe@krop.fr>
Date: Thu, 13 Jun 2019 14:15:07 +0200
Subject: [PATCH] Fix build with pyside2/shiboken2 >= 5.12.1
Starting with 5.12.2, pyside2 and shiboken2 now create CMake build targets.
The old variables were removed, leading to linker errors when building FreeCAD.
---
src/Gui/CMakeLists.txt | 54 ++++++++++++++++++++++++------------------
1 file changed, 31 insertions(+), 23 deletions(-)
diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt
index 3bd96e0..93babc5 100644
--- a/src/Gui/CMakeLists.txt
+++ b/src/Gui/CMakeLists.txt
@@ -137,38 +137,46 @@ IF(OCULUS_FOUND)
)
ENDIF(OCULUS_FOUND)
-if(SHIBOKEN_INCLUDE_DIR)
- if (BUILD_QT5)
+if(BUILD_QT5)
+ if(Shiboken2_FOUND)
add_definitions(-DHAVE_SHIBOKEN2)
- else()
+ if("${Shiboken2_VERSION}" VERSION_GREATER 5.12.1)
+ list(APPEND FreeCADGui_LIBS Shiboken2::libshiboken)
+ else()
+ include_directories(${SHIBOKEN_INCLUDE_DIR})
+ list(APPEND FreeCADGui_LIBS ${SHIBOKEN_LIBRARY})
+ endif()
+ endif()
+ if(PySide2_FOUND)
+ add_definitions(-DHAVE_PYSIDE2)
+ if("${PySide2_VERSION}" VERSION_GREATER 5.12.1)
+ list(APPEND FreeCADGui_LIBS PySide2::pyside2)
+ # Needed to '#include pyside2_<module_name>_python.h'
+ get_target_property(PYSIDE_INCLUDE_DIR PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)
+ else()
+ list(APPEND FreeCADGui_LIBS ${PYSIDE_LIBRARY})
+ endif()
+ include_directories(${PYSIDE_INCLUDE_DIR}/QtWidgets)
+ endif()
+else()
+ if(SHIBOKEN_INCLUDE_DIR)
add_definitions(-DHAVE_SHIBOKEN)
+ include_directories(${SHIBOKEN_INCLUDE_DIR})
+ list(APPEND FreeCADGui_LIBS ${SHIBOKEN_LIBRARY})
endif()
- include_directories(
- ${SHIBOKEN_INCLUDE_DIR}
- )
- list(APPEND FreeCADGui_LIBS
- ${SHIBOKEN_LIBRARY}
- )
-endif(SHIBOKEN_INCLUDE_DIR)
+ if(PYSIDE_INCLUDE_DIR)
+ add_definitions(-DHAVE_PYSIDE)
+ list(APPEND FreeCADGui_LIBS ${PYSIDE_LIBRARY})
+ endif()
+endif()
-if(PYSIDE_INCLUDE_DIR)
+if(DEFINED PYSIDE_INCLUDE_DIR)
include_directories(
${PYSIDE_INCLUDE_DIR}
${PYSIDE_INCLUDE_DIR}/QtCore
${PYSIDE_INCLUDE_DIR}/QtGui
)
- list(APPEND FreeCADGui_LIBS
- ${PYSIDE_LIBRARY}
- )
- if (BUILD_QT5)
- include_directories(
- ${PYSIDE_INCLUDE_DIR}/QtWidgets
- )
- add_definitions(-DHAVE_PYSIDE2)
- else()
- add_definitions(-DHAVE_PYSIDE)
- endif()
-endif(PYSIDE_INCLUDE_DIR)
+endif()
generate_from_xml(DocumentPy)
generate_from_xml(PythonWorkbenchPy)
--
2.22.0

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jun 13 12:25:02 UTC 2019 - Christophe Giboudeaux <christophe@krop.fr>
- Add 0001-Fix-build-with-pyside2-shiboken2-5.12.1.patch to fix
build with recent shiboken2/pyside2 releases.
-------------------------------------------------------------------
Sun May 12 07:21:14 UTC 2019 - Adrian Schröter <adrian@suse.de>

View File

@@ -39,7 +39,9 @@ Source0: %{name}-%version.tar.xz
Source1: FreeCAD.sh
Source2: FreeCADCmd.sh
Source3: FreeCAD_shared_mimeinfo
Patch2: 0001-find-openmpi2-include-files.patch
Patch0: 0001-find-openmpi2-include-files.patch
# PATCH-FIX-UPSTREAM 0001-Fix-build-with-pyside2-shiboken2-5.12.1.patch -- Fix build with shiboken2/pyside2 >= 5.12.1
Patch1: 0001-Fix-build-with-pyside2-shiboken2-5.12.1.patch
# Test suite fails on 32bit and I don't want to debug that anymore
ExcludeArch: %ix86 %arm ppc s390 s390x
@@ -170,7 +172,7 @@ This package contains the files needed for development with FreeCAD.
mv %_sourcedir/%name-%version %_builddir/%name-%version
%setup -q -D -T 0
%endif
%patch2 -p1
%autopatch -p1
# fix env-script-interpreter
sed -i '1c#!%{__python2}' \