From 60ce4ee1baa9d9537e5a67b65ef7be13ca9547f0 Mon Sep 17 00:00:00 2001 From: yopito Date: Sun, 10 May 2020 17:03:30 +0200 Subject: [PATCH] freecad: fix build with pyside2 5.14.2.1 stack [ci skip] --- ...00-detect-shiboken2-and-pyside2-5.14.patch | 33 +++++++++++++++++++ .../101-pyside2-tool-5.14-support.patch | 11 +++++++ srcpkgs/freecad/template | 18 +++++----- 3 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 srcpkgs/freecad/patches/100-detect-shiboken2-and-pyside2-5.14.patch create mode 100644 srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch diff --git a/srcpkgs/freecad/patches/100-detect-shiboken2-and-pyside2-5.14.patch b/srcpkgs/freecad/patches/100-detect-shiboken2-and-pyside2-5.14.patch new file mode 100644 index 00000000000..14ce9d5fcf9 --- /dev/null +++ b/srcpkgs/freecad/patches/100-detect-shiboken2-and-pyside2-5.14.patch @@ -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" diff --git a/srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch b/srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch new file mode 100644 index 00000000000..7aadc89220c --- /dev/null +++ b/srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch @@ -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}" + ) diff --git a/srcpkgs/freecad/template b/srcpkgs/freecad/template index e57b74d7dd0..41ab8c1c896 100644 --- a/srcpkgs/freecad/template +++ b/srcpkgs/freecad/template @@ -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