freecad: fix build with pyside2 5.14.2.1 stack

[ci skip]
This commit is contained in:
yopito 2020-05-10 17:03:30 +02:00 committed by Helmut Pozimski
parent f7aa130a2b
commit 60ce4ee1ba
3 changed files with 54 additions and 8 deletions

View file

@ -0,0 +1,33 @@
source: https://svnweb.freebsd.org/ports/head/cad/freecad/files/patch-CMakeLists.txt?revision=504361&view=co
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -989,6 +989,13 @@ endif()
endif()
endif()
+ # pyside2 changed it's cmake files, this is the dance we have
+ # to dance to be compatible with the old and the new versions
+ if(SHIBOKEN_PYTHON_INCLUDE_DIRS AND NOT SHIBOKEN_INCLUDE_DIR)
+ get_property(SHIBOKEN_INCLUDE_DIR TARGET Shiboken2::libshiboken PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+ get_property(SHIBOKEN_LIBRARY TARGET Shiboken2::libshiboken PROPERTY IMPORTED_LOCATION_RELEASE)
+ endif(SHIBOKEN_PYTHON_INCLUDE_DIRS AND NOT SHIBOKEN_INCLUDE_DIR)
+
if(NOT SHIBOKEN_INCLUDE_DIR)
MESSAGE("====================\n"
"shiboken2 not found.\n"
@@ -996,6 +1003,14 @@ endif()
endif(NOT SHIBOKEN_INCLUDE_DIR)
find_package(PySide2 QUIET)# REQUIRED
+
+ # pyside2 changed it's cmake files, this is the dance we have
+ # to dance to be compatible with the old and the new versions
+ if(NOT PYSIDE_INCLUDE_DIR)
+ get_property(PYSIDE_INCLUDE_DIR TARGET PySide2::pyside2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+ get_property(PYSIDE_LIBRARY TARGET PySide2::pyside2 PROPERTY IMPORTED_LOCATION_RELEASE)
+ endif(NOT PYSIDE_INCLUDE_DIR)
+
if(NOT PYSIDE_INCLUDE_DIR)
MESSAGE("==================\n"
"PySide2 not found.\n"

View file

@ -0,0 +1,11 @@
--- cMake/FindPySide2Tools.cmake.ORIG
+++ cMake/FindPySide2Tools.cmake
@@ -68,7 +68,7 @@
# pyside-rcc generates in comments at beginning, which is why
# we follow the tool command with in-place sed.
ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
- COMMAND "${PYSIDE2RCCBINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
+ COMMAND "${PYSIDE2RCCBINARY}" "${infile}" --generator python -o "${outfile}"
COMMAND sed -i "/^# /d" "${outfile}"
MAIN_DEPENDENCY "${infile}"
)

View file

@ -1,7 +1,7 @@
# Template file for 'freecad'
pkgname=freecad
version=0.18.4
revision=4
revision=5
wrksrc="FreeCAD-${version}"
build_style=cmake
@ -12,7 +12,9 @@ configure_args="
-DCMAKE_INSTALL_PREFIX=${_inst_prefix}
-DCMAKE_INSTALL_LIBDIR=${_inst_prefix}/lib
-DCMAKE_INSTALL_DATAROOTDIR=/usr/share
-DMEDFILE_INCLUDE_DIRS=/usr/include/med"
-DMEDFILE_INCLUDE_DIRS=/usr/include/med
-DPYSIDE2RCCBINARY=/usr/bin/rcc-qt5
-DPYSIDE2UICBINARY=/usr/bin/uic-qt5"
hostmakedepends="pkg-config swig doxygen graphviz"
makedepends="python3-devel boost-devel libxerces-c-devel zlib-devel occt-devel
vtk-devel hdf5-devel openmpi-devel libmed-devel eigen double-conversion-devel
@ -21,12 +23,6 @@ makedepends="python3-devel boost-devel libxerces-c-devel zlib-devel occt-devel
jsoncpp-devel qt5-devel qt5-svg-devel qt5-tools-devel qt5-webkit-devel
qt5-x11extras-devel coin3-doc glew-devel"
case "$XBPS_TARGET_MACHINE" in
*-musl) # SIGSEGV with musl, see https://github.com/void-linux/void-packages/issues/12595
makedepends=${makedepends/qt5-webkit-devel/}
;;
esac
# FreeCAD help: qt5/assistant with datas in SQLite format
depends="python3-matplotlib python3-pyside2 qt5-plugin-sqlite python3-pivy"
@ -40,6 +36,12 @@ homepage="https://freecadweb.org/"
distfiles="https://github.com/FreeCAD/FreeCAD/archive/${version}.tar.gz"
checksum=4e0cce447b31b8989a00cf68c49ae012ce8e5546a56c6e0874fbd8f7ddedffd2
case "$XBPS_TARGET_MACHINE" in
*-musl) # SIGSEGV with musl, see https://github.com/void-linux/void-packages/issues/12595
makedepends=${makedepends/qt5-webkit-devel/}
;;
esac
post_extract() {
# Report exact minor version
sed -i -e "s,^\(set(PACKAGE_VERSION_MINOR\) .*,\1 \"${version#*.}\")," CMakeLists.txt