public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/freecad/, media-gfx/freecad/files/
Date: Sat,  2 Apr 2022 12:58:42 +0000 (UTC)	[thread overview]
Message-ID: <1648904253.728417f0a8ce57a6daaa448100a101d107c25b6d.asturm@gentoo> (raw)

commit:     728417f0a8ce57a6daaa448100a101d107c25b6d
Author:     Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
AuthorDate: Sat Apr  2 08:22:04 2022 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sat Apr  2 12:57:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=728417f0

media-gfx/freecad: fix build of 0.19.4 with Qt 5.15.3

Backport changes from HEAD FindPySide2Tools.cmake to correctly
find the path for uic and rcc binaries.

Closes: https://bugs.gentoo.org/836433
Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/24861
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...19.4-backport-correctly-find-PySide2Tools.patch | 106 +++++++++++++++++++++
 media-gfx/freecad/freecad-0.19.4.ebuild            |   1 +
 2 files changed, 107 insertions(+)

diff --git a/media-gfx/freecad/files/freecad-0.19.4-backport-correctly-find-PySide2Tools.patch b/media-gfx/freecad/files/freecad-0.19.4-backport-correctly-find-PySide2Tools.patch
new file mode 100644
index 000000000000..b297727033db
--- /dev/null
+++ b/media-gfx/freecad/files/freecad-0.19.4-backport-correctly-find-PySide2Tools.patch
@@ -0,0 +1,106 @@
+From https://github.com/FreeCAD/FreeCAD/tree/6b062b25e118fc6d260d8caff6cf46fafd6cfa0f
+From: Bernd Waibel <waebbl-gentoo@posteo.net>
+Date: Sat, 2 Apr 2022 09:30:09 +0200
+Subject: [PATCH] backport correctly find PySide2Tools
+
+Backported from current HEAD
+
+Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
+--- a/cMake/FindPySide2Tools.cmake
++++ b/cMake/FindPySide2Tools.cmake
+@@ -23,7 +23,7 @@ endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ # 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)
++FIND_PACKAGE(Qt5 COMPONENTS Core)
+ 
+ IF(Qt5Core_VERSION VERSION_LESS 5.14)
+   # Legacy (< 5.14)
+@@ -33,13 +33,20 @@ IF(Qt5Core_VERSION VERSION_LESS 5.14)
+   set(RCCOPTIONS "")
+ ELSE(Qt5Core_VERSION VERSION_LESS 5.14)
+   # New (>= 5.14)
+-  FIND_PROGRAM(PYSIDE2UICBINARY NAMES uic-qt5 uic pyside2-uic)
+-  set(UICOPTIONS "--generator=python")
+-  FIND_PROGRAM(PYSIDE2RCCBINARY NAMES rcc-qt5 rcc pyside2-rcc)
+-  set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
++  if (TARGET Qt::uic)
++    get_property(PYSIDE2UICBINARY TARGET Qt::uic PROPERTY LOCATION)
++    set(UICOPTIONS "--generator=python")
++  endif()
++  if (TARGET Qt::rcc)
++    get_property(PYSIDE2RCCBINARY TARGET Qt::rcc PROPERTY LOCATION)
++    set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
++  endif()
+ ENDIF(Qt5Core_VERSION VERSION_LESS 5.14)
+ 
+ MACRO(PYSIDE_WRAP_UI outfiles)
++  if (NOT PYSIDE2UICBINARY)
++    message(FATAL_ERROR "Qt uic is required for generating ${ARGN}")
++  endif()
+   FOREACH(it ${ARGN})
+     GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+     GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+@@ -58,7 +65,7 @@ MACRO(PYSIDE_WRAP_UI outfiles)
+         # we follow the tool command with in-place sed.
+         ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+           COMMAND "${PYSIDE2UICBINARY}" ${UICOPTIONS} "${infile}" -o "${outfile}"
+-          COMMAND sed -i "/^# /d" "${outfile}"
++          COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
+           MAIN_DEPENDENCY "${infile}"
+         )
+     endif()
+@@ -67,6 +74,9 @@ MACRO(PYSIDE_WRAP_UI outfiles)
+ ENDMACRO (PYSIDE_WRAP_UI)
+ 
+ MACRO(PYSIDE_WRAP_RC outfiles)
++  if (NOT PYSIDE2RCCBINARY)
++    message(FATAL_ERROR "Qt rcc is required for generating ${ARGN}")
++  endif()
+   FOREACH(it ${ARGN})
+     GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+     GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+@@ -85,7 +95,7 @@ MACRO(PYSIDE_WRAP_RC outfiles)
+         # we follow the tool command with in-place sed.
+         ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
+           COMMAND "${PYSIDE2RCCBINARY}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
+-          COMMAND sed -i "/^# /d" "${outfile}"
++          COMMAND sed "/^# /d" "${outfile}" >"${outfile}.tmp" && mv "${outfile}.tmp" "${outfile}"
+           MAIN_DEPENDENCY "${infile}"
+         )
+     endif()
+@@ -93,20 +103,17 @@ MACRO(PYSIDE_WRAP_RC outfiles)
+   ENDFOREACH(it)
+ ENDMACRO (PYSIDE_WRAP_RC)
+ 
+-IF(EXISTS ${PYSIDE2UICBINARY} AND EXISTS ${PYSIDE2RCCBINARY})
+-   set(PYSIDE2_TOOLS_FOUND TRUE)
+-ENDIF(EXISTS ${PYSIDE2UICBINARY} AND EXISTS ${PYSIDE2RCCBINARY})
+-
+ if(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY)
++  set(PYSIDE2_TOOLS_FOUND TRUE)
++  if (NOT PySide2Tools_FIND_QUIETLY)
++    message(STATUS "Found PySide2 tools: ${PYSIDE2UICBINARY}, ${PYSIDE2RCCBINARY}")
++  endif (NOT PySide2Tools_FIND_QUIETLY)
++else(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY)
++  if(PySide2Tools_FIND_REQUIRED)
++    message(FATAL_ERROR "PySide2 tools could not be found, but are required.")
++  else(PySide2Tools_FIND_REQUIRED)
+     if (NOT PySide2Tools_FIND_QUIETLY)
+-        message(STATUS "Found PySide2 tools: ${PYSIDE2UICBINARY}, ${PYSIDE2RCCBINARY}")
++      message(STATUS "PySide2 tools: not found.")
+     endif (NOT PySide2Tools_FIND_QUIETLY)
+-else(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY)
+-    if(PySide2Tools_FIND_REQUIRED)
+-        message(FATAL_ERROR "PySide2 tools could not be found, but are required.")
+-    else(PySide2Tools_FIND_REQUIRED)
+-        if (NOT PySide2Tools_FIND_QUIETLY)
+-                message(STATUS "PySide2 tools: not found.")
+-        endif (NOT PySide2Tools_FIND_QUIETLY)
+-    endif(PySide2Tools_FIND_REQUIRED)
++  endif(PySide2Tools_FIND_REQUIRED)
+ endif(PYSIDE2RCCBINARY AND PYSIDE2UICBINARY)
+-- 
+2.35.1
+

diff --git a/media-gfx/freecad/freecad-0.19.4.ebuild b/media-gfx/freecad/freecad-0.19.4.ebuild
index cab7693eaacd..270ba00b2832 100644
--- a/media-gfx/freecad/freecad-0.19.4.ebuild
+++ b/media-gfx/freecad/freecad-0.19.4.ebuild
@@ -125,6 +125,7 @@ REQUIRED_USE="
 
 PATCHES=(
 	"${FILESDIR}"/${P}-Gentoo-specific-don-t-check-vcs.patch
+	"${FILESDIR}"/${P}-backport-correctly-find-PySide2Tools.patch
 	"${FILESDIR}"/${PN}-0.19.1-0001-Gentoo-specific-Remove-ccache-usage.patch
 	"${WORKDIR}"/${PN}-0.19.2-0005-Make-smesh-compile-with-vtk9.patch
 	"${FILESDIR}"/${PN}-0.19.2-0006-add-boost-serialization-to-find_package.patch


             reply	other threads:[~2022-04-02 12:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-02 12:58 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-03  0:41 [gentoo-commits] repo/gentoo:master commit in: media-gfx/freecad/, media-gfx/freecad/files/ Sam James
2025-08-01  8:10 Sam James
2025-05-08  6:29 Sam James
2024-11-24 20:25 Sam James
2024-11-23 19:40 Andreas Sturmlechner
2024-11-20 10:31 Nowa Ammerlaan
2024-06-03 15:00 Andrew Ammerlaan
2024-05-29 17:07 Andrew Ammerlaan
2024-04-14  8:56 Andrew Ammerlaan
2023-08-19  9:05 Miroslav Šulc
2022-02-03  2:19 Sam James
2021-11-02 10:04 Sam James
2021-06-21 22:26 Sam James
2021-05-04 22:02 Sam James
2021-03-14 11:41 Joonas Niilola
2021-02-15  9:04 Joonas Niilola
2017-11-06  1:58 Andreas Sturmlechner
2016-04-03 19:08 David Seifert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1648904253.728417f0a8ce57a6daaa448100a101d107c25b6d.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox