commit:     f85e159cd80a8d61e89a64cd4ec9e9abcbf88fcc
Author:     Bernd Waibel <waebbl-gentoo <AT> posteo <DOT> net>
AuthorDate: Tue Nov  1 09:08:08 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Tue Nov 22 15:03:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f85e159c

media-gfx/freecad: adapt for Qt6 related changes

Upstream has introduced cmake changes for handling both Qt5 and Qt6.
No code changes have been made so far, so we don't yet implement the
qt6 USE flag.
This patch reflects the upstream changes and prepares for implementing
the qt6 USE flag, by renaming the "headless" USE flag to "gui" and
passing the new cmake variable FREECAD_QT_VERSION.

Signed-off-by: Bernd Waibel <waebbl-gentoo <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/28069
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 media-gfx/freecad/freecad-9999.ebuild | 10 ++++++----
 media-gfx/freecad/metadata.xml        |  7 +++++++
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/media-gfx/freecad/freecad-9999.ebuild 
b/media-gfx/freecad/freecad-9999.ebuild
index 95e48c37bdac..7a29fc5538d5 100644
--- a/media-gfx/freecad/freecad-9999.ebuild
+++ b/media-gfx/freecad/freecad-9999.ebuild
@@ -26,7 +26,7 @@ fi
 # examples are licensed CC-BY-SA (without note of specific version)
 LICENSE="LGPL-2 CC-BY-SA-4.0"
 SLOT="0"
-IUSE="debug designer headless test"
+IUSE="debug designer +gui test"
 
 FREECAD_EXPERIMENTAL_MODULES="cloud pcl"
 FREECAD_STABLE_MODULES="addonmgr fem idf image inspection material
@@ -159,7 +159,7 @@ src_configure() {
                -DBUILD_FLAT_MESH=ON
                -DBUILD_FORCE_DIRECTORY=ON                              # force 
building in a dedicated directory
                -DBUILD_FREETYPE=ON                                             
# automagic dep
-               -DBUILD_GUI=$(usex !headless)
+               -DBUILD_GUI=$(usex gui)
                -DBUILD_IDF=$(usex idf)
                -DBUILD_IMAGE=$(usex image)
                -DBUILD_IMPORT=ON                                               
# import module for various file formats
@@ -197,6 +197,8 @@ src_configure() {
 
                -DFREECAD_BUILD_DEBIAN=OFF
 
+               -DFREECAD_QT_VERSION="5"
+
                -DFREECAD_USE_EXTERNAL_KDL=ON
                -DFREECAD_USE_EXTERNAL_SMESH=OFF                # no package in 
Gentoo
                -DFREECAD_USE_EXTERNAL_ZIPIOS=OFF               # doesn't work 
yet, also no package in Gentoo tree
@@ -235,7 +237,7 @@ src_configure() {
 
 # We use the FreeCADCmd binary instead of the FreeCAD binary here
 # for two reasons:
-# 1. It works out of the box with USE=headless as well, not needing a guard
+# 1. It works out of the box with USE=-gui as well, not needing a guard
 # 2. We don't need virtualx.eclass and it's dependencies
 # The exported environment variables are needed, so freecad does know
 # where to save it's temporary files, and where to look and write it's
@@ -255,7 +257,7 @@ src_install() {
 
        dobin src/Tools/freecad-thumbnailer
 
-       if ! use headless; then
+       if use gui; then
                dosym -r /usr/$(get_libdir)/${PN}/bin/FreeCAD /usr/bin/freecad
                mv "${ED}"/usr/$(get_libdir)/${PN}/share/* "${ED}"/usr/share || 
die "failed to move shared resources"
        fi

diff --git a/media-gfx/freecad/metadata.xml b/media-gfx/freecad/metadata.xml
index d55000ab3501..6e0770f45ea8 100644
--- a/media-gfx/freecad/metadata.xml
+++ b/media-gfx/freecad/metadata.xml
@@ -26,6 +26,13 @@
                        Build the FEM module and workbench which provides 
Finite Element 
                        Analysis (FEA) workflows
                </flag>
+               <flag name="gui">
+                       Build FreeCAD with a Qt based GUI. If built without 
setting this
+                       USE flag, FreeCAD can be used in a headless mode, for 
server-side
+                       instances.
+                       The Python modules are available, without their GUI 
parts though,
+                       if this is unset.
+               </flag>
                <flag name="headless">
                        Build FreeCAD without a GUI, usable for server-side 
instances.
                        The Python modules are still available, without their 
GUI parts though.

Reply via email to