* [PR PATCH] freecad: fix python generation with pyside2 5.14
@ 2020-05-29 10:14 yopito
2020-05-31 13:51 ` [PR PATCH] [Closed]: " Piraty
0 siblings, 1 reply; 2+ messages in thread
From: yopito @ 2020-05-29 10:14 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
There is a new pull request by yopito against master on the void-packages repository
https://github.com/yopito/void-packages freecad
https://github.com/void-linux/void-packages/pull/22399
freecad: fix python generation with pyside2 5.14
fix #22261
[ci skip]
A patch file from https://github.com/void-linux/void-packages/pull/22399.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-freecad-22399.patch --]
[-- Type: text/x-diff, Size: 4241 bytes --]
From 6dad5853041673c66e4a185363e4cf215c5efb3e Mon Sep 17 00:00:00 2001
From: yopito <pierre.bourgin@free.fr>
Date: Fri, 29 May 2020 11:44:49 +0200
Subject: [PATCH] freecad: fix python generation with pyside2 5.14
fix #22261
[ci skip]
---
.../101-pyside2-tool-5.14-support.patch | 60 ++++++++++++++++++-
srcpkgs/freecad/template | 2 +-
2 files changed, 59 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch b/srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch
index 7aadc89220c..632384d2df4 100644
--- a/srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch
+++ b/srcpkgs/freecad/patches/101-pyside2-tool-5.14-support.patch
@@ -1,11 +1,67 @@
+backport from FreeCAD git master (rev @1bca539)
+
--- cMake/FindPySide2Tools.cmake.ORIG
+++ cMake/FindPySide2Tools.cmake
-@@ -68,7 +68,7 @@
+@@ -20,8 +20,24 @@
+ set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR})
+ endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
+-FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
+-FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
++# Since Qt v5.14, pyside2-uic and pyside2-rcc are directly provided by Qt5Core uic and rcc, with '-g python' option
++# We test Qt5Core version to act accordingly
++
++FIND_PACKAGE(Qt5Core)
++
++IF(Qt5Core_VERSION VERSION_LESS 5.14)
++ # Legacy (< 5.14)
++ FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
++ FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
++ set(UICOPTIONS "")
++ set(RCCOPTIONS "")
++ELSE(Qt5Core_VERSION VERSION_LESS 5.14)
++ # New (>= 5.14)
++ FIND_PROGRAM(PYSIDE2UICBINARY NAMES uic-qt5 uic)
++ set(UICOPTIONS "--generator=python")
++ FIND_PROGRAM(PYSIDE2RCCBINARY NAMES rcc-qt5 rcc)
++ set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
++ENDIF(Qt5Core_VERSION VERSION_LESS 5.14)
+
+ MACRO(PYSIDE_WRAP_UI outfiles)
+ FOREACH(it ${ARGN})
+@@ -33,7 +49,7 @@
+ #)
+ if(WIN32 OR APPLE)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+- COMMAND ${PYSIDE2UICBINARY} ${infile} -o ${outfile}
++ COMMAND ${PYSIDE2UICBINARY} ${UICOPTIONS} ${infile} -o ${outfile}
+ MAIN_DEPENDENCY ${infile}
+ )
+ else()
+@@ -41,7 +57,7 @@
+ # pyside2-uic generates in comments at beginning., which is why
+ # we follow the tool command with in-place sed.
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+- COMMAND "${PYSIDE2UICBINARY}" "${infile}" -o "${outfile}"
++ COMMAND "${PYSIDE2UICBINARY}" ${UICOPTIONS} "${infile}" -o "${outfile}"
+ COMMAND sed -i "/^# /d" "${outfile}"
+ MAIN_DEPENDENCY "${infile}"
+ )
+@@ -60,7 +76,7 @@
+ #)
+ if(WIN32 OR APPLE)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+- COMMAND ${PYSIDE2RCCBINARY} ${infile} -o ${outfile}
++ COMMAND ${PYSIDE2RCCBINARY} ${RCCOPTIONS} ${infile} -o ${outfile}
+ MAIN_DEPENDENCY ${infile}
+ )
+ else()
+@@ -68,7 +84,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 "${PYSIDE2RCCBINARY}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
COMMAND sed -i "/^# /d" "${outfile}"
MAIN_DEPENDENCY "${infile}"
)
diff --git a/srcpkgs/freecad/template b/srcpkgs/freecad/template
index 41ab8c1c896..0a08bf9eae7 100644
--- a/srcpkgs/freecad/template
+++ b/srcpkgs/freecad/template
@@ -1,7 +1,7 @@
# Template file for 'freecad'
pkgname=freecad
version=0.18.4
-revision=5
+revision=6
wrksrc="FreeCAD-${version}"
build_style=cmake
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PR PATCH] [Closed]: freecad: fix python generation with pyside2 5.14
2020-05-29 10:14 [PR PATCH] freecad: fix python generation with pyside2 5.14 yopito
@ 2020-05-31 13:51 ` Piraty
0 siblings, 0 replies; 2+ messages in thread
From: Piraty @ 2020-05-31 13:51 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 203 bytes --]
There's a closed pull request on the void-packages repository
freecad: fix python generation with pyside2 5.14
https://github.com/void-linux/void-packages/pull/22399
Description:
fix #22261
[ci skip]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-31 13:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 10:14 [PR PATCH] freecad: fix python generation with pyside2 5.14 yopito
2020-05-31 13:51 ` [PR PATCH] [Closed]: " Piraty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).