From dafa6f367240d1f5329ca89fb6f78985dbdc025b Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 4 Jun 2024 00:07:50 +0100 Subject: gentoo auto-resync : 04:06:2024 - 00:07:50 --- media-gfx/freecad/Manifest | 7 +- .../freecad/files/freecad-0.21.2-navcube-qt6.patch | 29 ++ .../freecad/files/freecad-0.21.2-py312-qt6.patch | 186 ++++++++++ .../freecad/files/freecad-0.21.2-qtsvg-qt6.patch | 148 ++++++++ media-gfx/freecad/freecad-0.21.2-r2.ebuild | 390 -------------------- media-gfx/freecad/freecad-0.21.2-r3.ebuild | 398 +++++++++++++++++++++ media-gfx/freecad/freecad-9999.ebuild | 8 +- 7 files changed, 770 insertions(+), 396 deletions(-) create mode 100644 media-gfx/freecad/files/freecad-0.21.2-navcube-qt6.patch create mode 100644 media-gfx/freecad/files/freecad-0.21.2-py312-qt6.patch create mode 100644 media-gfx/freecad/files/freecad-0.21.2-qtsvg-qt6.patch delete mode 100644 media-gfx/freecad/freecad-0.21.2-r2.ebuild create mode 100644 media-gfx/freecad/freecad-0.21.2-r3.ebuild (limited to 'media-gfx/freecad') diff --git a/media-gfx/freecad/Manifest b/media-gfx/freecad/Manifest index 69bbfe3bcba1..4089309a177d 100644 --- a/media-gfx/freecad/Manifest +++ b/media-gfx/freecad/Manifest @@ -3,11 +3,14 @@ AUX freecad-0.21.1-Gentoo-specific-don-t-check-vcs.patch 375 BLAKE2B 27fd88fe3f1 AUX freecad-0.21.2-boost-175-1.patch 969 BLAKE2B 94e8efec851f0359a611bc95066b53d84a2489bcb45e7e77b1d5c167d033ce69a87853fe3fe56a3addff3305c53f556abb8f1f48727e6bc6a8bc43932ef475c2 SHA512 d012a219a6767449bd458a808dccb03d6b7332235ea7331c1c3178ef053e1c3e5898daed78e99ffc80504c7472c3fc34cfc275fab571b068f1955c3741f0eb65 AUX freecad-0.21.2-boost-175-2.patch 973 BLAKE2B b9df6cb8d28c08a80387b9374e0eb663e747e4b07509af651c838c3b773242f3e129be07a307f5ed1fef7c4b633143636e1c40105e11d5c184cddfa08954f4f4 SHA512 2ad2137c328930ac9b786535502b16ec76d00b3af3b4c275a54cb00770d9a7ebad8e1a5c6126b6e6095fbac0e7c84c0b2436845bc16141d6f4c3164615a35a9b AUX freecad-0.21.2-boost-175-3.patch 1015 BLAKE2B 547338ced16847270e599a2f3111309f28fe52b57a09e0afaaf353336c0b935c6bb37ea26a2402cffd219e3a06ca412cae90d16bfc8a4c8f25b5f0b752249b0f SHA512 abc03f8ae63ce03ab3bdfa9e64b71c7bebe6bc1fd9b576ad06b9b00513b261df3265ed770cca5b017eb13e3d66504eabc6e24996b804de57ddf0cd7749a6fdbd +AUX freecad-0.21.2-navcube-qt6.patch 1329 BLAKE2B 96eae9bf5af8c041876cf6afd09f2b0dbc12369469ceb6d5c4607fccee8914dfd9b3eef8291ccdc6aded0369a6bcf0fb159dbfb8172b0f7b95324c22310e21f5 SHA512 cc4559599650df261a60c61138063e60880f0cf02d0b9a320d24fc6801a5fe0bfda8db42b58840aa9d99fa86f324a796b5bc8b690f38d0b3ea9718aa9ad08128 +AUX freecad-0.21.2-py312-qt6.patch 7477 BLAKE2B de4b98c4b488045f9810dce124c271d6f4f629922e026f2d4f1efd6c9060b92309db41f8e0f6ebe5e7a27399911ac908cc8935c2501214326dbb1c4b739d46cc SHA512 a1617514ec41fac9b6694ebc81c025cefdd0e35e05be09b0f860c1b6424007116aff153eac71bc16e4c53d9d510f07dda839addc5a90197933cf82eb986e0e6f +AUX freecad-0.21.2-qtsvg-qt6.patch 7188 BLAKE2B 02284db1b17dc88d0522eb3a726076b9f1ded740fdab1a185e48534c3606c77e51a12690b02bf5e0d9d1f72d1d8389ba84a54cba274200e69b6b10a431bbfdfe SHA512 a0629eed70e042f572876f77d953cee204a226d9d8431c10ed50fcde236d546d869afc623fc1779e891d44d61663cdcb254260f5a78d99aebfb3ac5874152f6e AUX freecad-0.21.2-shiboken-6.7.0.patch 306 BLAKE2B 03ddf2bfe249856aec0624054eb9db68c1239e153bff91cab16d04b9dad4c341714eecd338ce90b2f5b4aedf26515dee6390fad1b104189fd3a8cf15556f04fa SHA512 cb7c4d699149b839a2b841d71a7bf2983635ed4e3f93ad25ab97c8dcd616c6e48b9fd4ce0e368ec516edb79794b7a98ebda645f09aada7e41228fc5bca1d8cc1 AUX freecad-0.21.2-vtk9.3-fix.patch 1065 BLAKE2B d0fccb7c19dc9a5efedb5691a74c6ba62b76afe12ecd4876292478459a895409e9448ad319b05fdff2952e8f031e5e2d1cd08fd279f6c6d38d6136f6a8c7c2ab SHA512 aaf4729ac1623cd73405da82980603e5e4aaacf4fb34751dabaa8cc64e69f91d325c855bc2f23aeaa1f4052848af696e7edadeb144f06ce12775bc4c2333a137 AUX freecad-9999-Gentoo-specific-don-t-check-vcs.patch 350 BLAKE2B e1b612ac81f73546a3a7ae93e447aba6e3f28dea1292f5d308f567307c8c6146b8dfdcc1cef946c64991d41c41fa9c8949f56e2e8573833bad2a3826bab960ba SHA512 f96678dbfe13668a9f65131996ddc5eb2cbe80296b7eb2cc7d248e3ee1d991bea95568b0241da8387106812aac5762c330afb1d8c38b2281c3ee2600db120627 AUX freecad-9999-tests-src-Qt-only-build-test-for-BUILD_GUI-ON.patch 469 BLAKE2B 23e56fbc49b3c3d5ede85e6ec15d26c88c93590fce105e0b75e8b0bd3fee125c500cd59d8db0144c610edb371df318396e056333ec7a411f7647b38d18006efc SHA512 82737af95603ff1f667bf49ee43b85b411eeeb5fd9b577ad7fca6e02bcbfda5c3bbb6c70386e5f69d2181d6226574f82cb68b7e66dfe8f4bb14d946f594582cf DIST freecad-0.21.2.tar.gz 66124278 BLAKE2B 84a4f8008192cd1a2ee1737b537b2668a8c028aa8c8645e6e412ab9ef79bf3bdd2cb73d96fcfd2dbcff613cdcc59cbab95821406acdc9cd7d4eb4636c081be78 SHA512 bd7e9029b24d49ac0955797bcdbea1fd0826bdf9ab246135366dfc35b427004f103acccfc66d008e3ab3928f99e04200e335908a03166545554e2d3e969ae0f5 -EBUILD freecad-0.21.2-r2.ebuild 12148 BLAKE2B 9e732034980c3d5e1aad7b08956e9fbb3bb51c9fbd69be3c2c73d6aee3418fed8669ec878ac915d1667487939d6194466492952d7727c79ee28340ea4e3fe9e6 SHA512 85de5b676ed22f1534cf33379a7d973362425b3df1cfddbc0a83183493af5af82d11df6e16f5c7d71e36b56c3332a562428666a51c33ec67d759d97f7c263cc4 -EBUILD freecad-9999.ebuild 11965 BLAKE2B 5a7e8c7b1fc66c83a105cd6b7b5ac6428d1d5034f30a9c9aab0d9442c3fa26566cd6da1a71d8822bb126dd289c5158128ac096362cbc03dc330e093e94dc739b SHA512 cc841f24be77f3807e3ea29dd3d109ae0f0c21f63befc42ccd892e6036f222e68f415236dc4305efd202395ece5b96d19bbe495c395cfd67b34ec1610479bcf6 +EBUILD freecad-0.21.2-r3.ebuild 12437 BLAKE2B c9c9a77f7b7b0aadee67b3fb2aa6ac13da06bcc790e4291e6413826b246a92052f535962c974654646c79a481378b99582d2499b134d57b76cbcad4056fc2fc7 SHA512 c68c9f9a7d106ac48ddf280f716cd73398693e058e8c475d912e61d43466e80041d60847efa2cd5d022d1ac59d1057c14c61943c2eb3ce68032d232b29469c08 +EBUILD freecad-9999.ebuild 11973 BLAKE2B 9befb852d6d7b8f5310c0692c5175ddb87a45260eddbe31a3376362218136a2e27b5cc5fbeff8269558c02b4448bdc553a68772ad9b565d19d3e2aa34dbb6fd8 SHA512 bf284186d32f598ab85fab40c7cdd67f185d8147e5951681ad86c030c523453049365c6cfc2a503268f82cf3ce0a5387e61541f765ca1fbffeee18cb5b875d1e MISC metadata.xml 3190 BLAKE2B 5f8776248055147c9b2a308913e1d3476ad27b5a3b7795b4fdf15b4d7f10451d6f5ce16ab1ef691daedd74f02fa12efb6341a7ec10456786c427d7707948fdbc SHA512 2163a91c7f7ec97acf81e7c4a2481667388fb43f60ee48d40a09c9bebfebffa8a807ff275385d8dcbefefe16c51bc9de3c07c84d92344f968985693117007042 diff --git a/media-gfx/freecad/files/freecad-0.21.2-navcube-qt6.patch b/media-gfx/freecad/files/freecad-0.21.2-navcube-qt6.patch new file mode 100644 index 000000000000..0ab999771068 --- /dev/null +++ b/media-gfx/freecad/files/freecad-0.21.2-navcube-qt6.patch @@ -0,0 +1,29 @@ +From ccaee18917432fd02e4371a7847bdfaf0692edd1 Mon Sep 17 00:00:00 2001 +From: Martin Rodriguez Reboredo +Date: Sun, 19 May 2024 23:23:45 -0300 +Subject: [PATCH] Gui: Fix NaviCube for Qt6 + +--- + src/Gui/NaviCube.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp +index 2d164f196b3c..9e3a62d66c81 100644 +--- a/src/Gui/NaviCube.cpp ++++ b/src/Gui/NaviCube.cpp +@@ -926,6 +926,7 @@ NaviCubeImplementation::PickId NaviCubeImplementation::pickFace(short x, short y + GLubyte pixels[4] = {0}; + if (m_PickingFramebuffer && std::abs(x) <= m_CubeWidgetSize / 2 && + std::abs(y) <= m_CubeWidgetSize / 2) { ++ static_cast(m_View3DInventorViewer->viewport())->makeCurrent(); + m_PickingFramebuffer->bind(); + + glViewport(0, 0, m_CubeWidgetSize * 2, m_CubeWidgetSize * 2); +@@ -936,6 +937,7 @@ NaviCubeImplementation::PickId NaviCubeImplementation::pickFace(short x, short y + glReadPixels(2 * x + m_CubeWidgetSize, 2 * y + m_CubeWidgetSize, 1, 1, + GL_RGBA, GL_UNSIGNED_BYTE, &pixels); + m_PickingFramebuffer->release(); ++ static_cast(m_View3DInventorViewer->viewport())->doneCurrent(); + } + return pixels[3] == 255 ? static_cast(pixels[0]) : PickId::None; + } diff --git a/media-gfx/freecad/files/freecad-0.21.2-py312-qt6.patch b/media-gfx/freecad/files/freecad-0.21.2-py312-qt6.patch new file mode 100644 index 000000000000..c1fe31ab05ad --- /dev/null +++ b/media-gfx/freecad/files/freecad-0.21.2-py312-qt6.patch @@ -0,0 +1,186 @@ +From 6043c90462e85fbf15e30ea4c7da7d9a22d570f2 Mon Sep 17 00:00:00 2001 +From: wmayer +Date: Wed, 7 Feb 2024 15:25:13 +0100 +Subject: [PATCH] Py3.12: harmonize with upstream of PyCXX + +--- + src/CXX/IndirectPythonInterface.cxx | 36 +++++++++++++++------ + src/CXX/Python3/IndirectPythonInterface.hxx | 6 ++-- + src/CXX/Python3/cxx_extensions.cxx | 2 +- + src/CXX/Python3/cxxextensions.c | 10 ++++++ + src/CXX/Version.hxx | 2 +- + 5 files changed, 42 insertions(+), 14 deletions(-) + +diff --git a/src/CXX/IndirectPythonInterface.cxx b/src/CXX/IndirectPythonInterface.cxx +index 3d810cea88a5..fc9e45cbd64f 100644 +--- a/src/CXX/IndirectPythonInterface.cxx ++++ b/src/CXX/IndirectPythonInterface.cxx +@@ -122,17 +122,21 @@ static PyTypeObject *ptr__Bytes_Type = NULL; + # endif + + # if PY_MAJOR_VERSION == 2 || !defined( Py_LIMITED_API ) ++# if PY_MAJOR_VERSION == 2 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11) + static int *ptr_Py_DebugFlag = NULL; + static int *ptr_Py_InteractiveFlag = NULL; + static int *ptr_Py_OptimizeFlag = NULL; + static int *ptr_Py_NoSiteFlag = NULL; + static int *ptr_Py_VerboseFlag = NULL; ++# endif + +-# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 + static const char **ptr__Py_PackageContext = NULL; +-# else ++# else + static char **ptr__Py_PackageContext = NULL; +-# endif ++# endif ++# endif + # endif + + # ifdef Py_REF_DEBUG +@@ -242,17 +246,21 @@ bool InitialisePythonIndirectInterface() + ptr_Py_RefTotal = GetInt_as_IntPointer( "_Py_RefTotal" ); + # endif + # if PY_MAJOR_VERSION == 2 || !defined( Py_LIMITED_API ) ++# if PY_MAJOR_VERSION == 2 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11) + ptr_Py_DebugFlag = GetInt_as_IntPointer( "Py_DebugFlag" ); + ptr_Py_InteractiveFlag = GetInt_as_IntPointer( "Py_InteractiveFlag" ); + ptr_Py_OptimizeFlag = GetInt_as_IntPointer( "Py_OptimizeFlag" ); + ptr_Py_NoSiteFlag = GetInt_as_IntPointer( "Py_NoSiteFlag" ); + ptr_Py_VerboseFlag = GetInt_as_IntPointer( "Py_VerboseFlag" ); ++# endif + +-# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 + ptr__Py_PackageContext = GetConstCharPointer_as_ConstCharPointerPointer( "_Py_PackageContext" ); +-# else ++# else + ptr__Py_PackageContext = GetCharPointer_as_CharPointerPointer( "_Py_PackageContext" ); +-# endif ++# endif ++# endif + # endif + + # define PYCXX_STANDARD_EXCEPTION( eclass, bclass ) +@@ -397,17 +405,21 @@ PYCXX_EXPORT PyTypeObject *_Bytes_Type() { return ptr__Bytes_Type; } + // wrap the Python Flag variables + // + # if PY_MAJOR_VERSION == 2 || !defined( Py_LIMITED_API ) ++# if PY_MAJOR_VERSION == 2 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11) + PYCXX_EXPORT int &_Py_DebugFlag() { return *ptr_Py_DebugFlag; } + PYCXX_EXPORT int &_Py_InteractiveFlag() { return *ptr_Py_InteractiveFlag; } + PYCXX_EXPORT int &_Py_OptimizeFlag() { return *ptr_Py_OptimizeFlag; } + PYCXX_EXPORT int &_Py_NoSiteFlag() { return *ptr_Py_NoSiteFlag; } + PYCXX_EXPORT int &_Py_VerboseFlag() { return *ptr_Py_VerboseFlag; } ++# endif + # endif + +-# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 + PYCXX_EXPORT const char *__Py_PackageContext() { return *ptr__Py_PackageContext; } +-# else ++# else + PYCXX_EXPORT char *__Py_PackageContext() { return *ptr__Py_PackageContext; } ++# endif + # endif + + # if 0 +@@ -518,15 +530,19 @@ PYCXX_EXPORT PyTypeObject *_Bytes_Type() { return &PyBytes_Type; } + // wrap flags + // + # if PY_MAJOR_VERSION == 2 || !defined( Py_LIMITED_API ) ++# if PY_MAJOR_VERSION == 2 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11) + PYCXX_EXPORT int &_Py_DebugFlag() { return Py_DebugFlag; } + PYCXX_EXPORT int &_Py_InteractiveFlag() { return Py_InteractiveFlag; } + PYCXX_EXPORT int &_Py_OptimizeFlag() { return Py_OptimizeFlag; } + PYCXX_EXPORT int &_Py_NoSiteFlag() { return Py_NoSiteFlag; } + PYCXX_EXPORT int &_Py_VerboseFlag() { return Py_VerboseFlag; } +-# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 ++# endif ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 + PYCXX_EXPORT const char *__Py_PackageContext() { return _Py_PackageContext; } +-# else ++# else + PYCXX_EXPORT char *__Py_PackageContext() { return _Py_PackageContext; } ++# endif + # endif + # endif + +diff --git a/src/CXX/Python3/IndirectPythonInterface.hxx b/src/CXX/Python3/IndirectPythonInterface.hxx +index bf2c15c53f9a..eb4ae4fe63b9 100644 +--- a/src/CXX/Python3/IndirectPythonInterface.hxx ++++ b/src/CXX/Python3/IndirectPythonInterface.hxx +@@ -149,10 +149,12 @@ PYCXX_EXPORT int &_Py_NoSiteFlag(); + PYCXX_EXPORT int &_Py_TabcheckFlag(); + PYCXX_EXPORT int &_Py_VerboseFlag(); + +-# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 11 ++# if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 + PYCXX_EXPORT const char *__Py_PackageContext(); +-# else ++# else + PYCXX_EXPORT char *__Py_PackageContext(); ++# endif + # endif + # endif + +diff --git a/src/CXX/Python3/cxx_extensions.cxx b/src/CXX/Python3/cxx_extensions.cxx +index 7371810be4a9..e6eefdafea17 100644 +--- a/src/CXX/Python3/cxx_extensions.cxx ++++ b/src/CXX/Python3/cxx_extensions.cxx +@@ -152,7 +152,7 @@ PyMethodDef *MethodTable::table() + //================================================================================ + ExtensionModuleBase::ExtensionModuleBase( const char *name ) + : m_module_name( name ) +-#if defined( Py_LIMITED_API ) ++#if defined( Py_LIMITED_API ) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 12) + , m_full_module_name( m_module_name ) + #else + , m_full_module_name( __Py_PackageContext() != NULL ? std::string( __Py_PackageContext() ) : m_module_name ) +diff --git a/src/CXX/Python3/cxxextensions.c b/src/CXX/Python3/cxxextensions.c +index 3b0f8ef7c588..afb9313ad0a8 100644 +--- a/src/CXX/Python3/cxxextensions.c ++++ b/src/CXX/Python3/cxxextensions.c +@@ -42,6 +42,14 @@ extern "C" + { + #endif + ++#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 13 ++PyObject py_object_initializer = ++ { ++ { 1 }, ++ NULL // type must be init'ed by user ++ }; ++ ++#else + PyObject py_object_initializer = + { + _PyObject_EXTRA_INIT +@@ -49,6 +57,8 @@ PyObject py_object_initializer = + NULL // type must be init'ed by user + }; + ++#endif ++ + #ifdef __cplusplus + } + #endif +diff --git a/src/CXX/Version.hxx b/src/CXX/Version.hxx +index e6069aad335e..59fe3c203b86 100644 +--- a/src/CXX/Version.hxx ++++ b/src/CXX/Version.hxx +@@ -40,7 +40,7 @@ + + #define PYCXX_VERSION_MAJOR 7 + #define PYCXX_VERSION_MINOR 1 +-#define PYCXX_VERSION_PATCH 7 ++#define PYCXX_VERSION_PATCH 9 + #define PYCXX_MAKEVERSION( major, minor, patch ) ((major<<16)|(minor<<8)|(patch)) + #define PYCXX_VERSION PYCXX_MAKEVERSION( PYCXX_VERSION_MAJOR, PYCXX_VERSION_MINOR, PYCXX_VERSION_PATCH ) + #endif diff --git a/media-gfx/freecad/files/freecad-0.21.2-qtsvg-qt6.patch b/media-gfx/freecad/files/freecad-0.21.2-qtsvg-qt6.patch new file mode 100644 index 000000000000..505862aa2bf1 --- /dev/null +++ b/media-gfx/freecad/files/freecad-0.21.2-qtsvg-qt6.patch @@ -0,0 +1,148 @@ +From ac9a88c2c59a2d2002a7740a1597a05c819220e0 Mon Sep 17 00:00:00 2001 +From: wmayer +Date: Sat, 20 Apr 2024 14:02:38 +0200 +Subject: [PATCH] PySide6: Fixes #13533: QSvgWidget is not a child of QtSvg in + PySide6 + +* Create a compatibility module QtSvgWidgets.py to handle PySide2 & PySide6 +* In the Arch and Material modules use the QtSvgWidgets module +* Since Qt6 the method QFont.setWeight() doesn't accept an int any more but requires an enum. Since the call of QFont.setBold(True) sets + a weight of 75 the extra calls of QFont.setWeight(75) can be safely removed +--- + cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake | 3 +++ + src/Mod/Arch/ArchPrecast.py | 8 ++++---- + src/Mod/Arch/ArchWindow.py | 4 ++-- + src/Mod/Arch/importIFClegacy.py | 1 - + src/Mod/Draft/DraftGui.py | 1 - + src/Mod/Material/MaterialEditor.py | 6 +++--- + 6 files changed, 12 insertions(+), 11 deletions(-) + +diff --git a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake +index 0569c1fde9f2..fa872e287b59 100644 +--- a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake ++++ b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake +@@ -91,9 +91,12 @@ macro(SetupShibokenAndPyside) + file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWidgets import *\n") + if(PYSIDE_MAJOR_VERSION LESS 6) + file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n") ++ file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvgWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtSvg import QGraphicsSvgItem\n" ++ "from PySide${PYSIDE_MAJOR_VERSION}.QtSvg import QSvgWidget\n") + else() + file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n" + "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineCore import QWebEnginePage\n") ++ file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvgWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtSvgWidgets import *\n") + endif() + endif() + +diff --git a/src/Mod/Arch/ArchPrecast.py b/src/Mod/Arch/ArchPrecast.py +index 7bb929b10e34..2f482902c1ce 100644 +--- a/src/Mod/Arch/ArchPrecast.py ++++ b/src/Mod/Arch/ArchPrecast.py +@@ -777,14 +777,14 @@ class _PrecastTaskPanel: + def __init__(self): + + import FreeCADGui +- from PySide import QtCore,QtGui,QtSvg ++ from PySide import QtCore,QtGui,QtSvgWidgets + self.form = QtGui.QWidget() + self.grid = QtGui.QGridLayout(self.form) + self.PrecastTypes = ["Beam","I-Beam","Pillar","Panel","Slab","Stairs"] + self.SlabTypes = ["Champagne","Hat"] + + # image display +- self.preview = QtSvg.QSvgWidget(":/ui/ParametersBeam.svg") ++ self.preview = QtSvgWidgets.QSvgWidget(":/ui/ParametersBeam.svg") + self.preview.setMaximumWidth(200) + self.preview.setMinimumHeight(120) + self.grid.addWidget(self.preview,0,0,1,2) +@@ -1263,7 +1263,7 @@ class _DentsTaskPanel: + def __init__(self): + + import FreeCADGui +- from PySide import QtCore,QtGui,QtSvg ++ from PySide import QtCore,QtGui,QtSvgWidgets + self.form = QtGui.QWidget() + self.grid = QtGui.QGridLayout(self.form) + self.Rotations = ["N","S","E","O"] +@@ -1282,7 +1282,7 @@ def __init__(self): + self.grid.addWidget(self.buttonRemove,2,1,1,1) + + # image display +- self.preview = QtSvg.QSvgWidget(":/ui/ParametersDent.svg") ++ self.preview = QtSvgWidgets.QSvgWidget(":/ui/ParametersDent.svg") + self.preview.setMaximumWidth(200) + self.preview.setMinimumHeight(120) + self.grid.addWidget(self.preview,3,0,1,2) +diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py +index f3c11c5e9c7a..dc9c84f9a8bf 100644 +--- a/src/Mod/Arch/ArchWindow.py ++++ b/src/Mod/Arch/ArchWindow.py +@@ -34,7 +34,7 @@ + + if FreeCAD.GuiUp: + import FreeCADGui +- from PySide import QtCore, QtGui, QtSvg ++ from PySide import QtCore, QtGui, QtSvgWidgets + from draftutils.translate import translate + from PySide.QtCore import QT_TRANSLATE_NOOP + import draftguitools.gui_trackers as DraftTrackers +@@ -426,7 +426,7 @@ def taskbox(self): + self.pic.hide() + + # SVG display +- self.im = QtSvg.QSvgWidget(":/ui/ParametersWindowFixed.svg") ++ self.im = QtSvgWidgets.QSvgWidget(":/ui/ParametersWindowFixed.svg") + self.im.setMaximumWidth(200) + self.im.setMinimumHeight(120) + grid.addWidget(self.im,4,0,1,2) +diff --git a/src/Mod/Arch/importIFClegacy.py b/src/Mod/Arch/importIFClegacy.py +index 037e889ce5b9..256b29056b33 100644 +--- a/src/Mod/Arch/importIFClegacy.py ++++ b/src/Mod/Arch/importIFClegacy.py +@@ -1795,7 +1795,6 @@ def explorer(filename,schema="IFC2X3_TC1.exp"): + tree.headerItem().setText(1, "") + tree.headerItem().setText(2, "Item and Properties") + bold = QtGui.QFont() +- bold.setWeight(75) + bold.setBold(True) + + #print(ifc.Entities) +diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py +index c6e8584f4a71..2471bb66c61a 100644 +--- a/src/Mod/Draft/DraftGui.py ++++ b/src/Mod/Draft/DraftGui.py +@@ -312,7 +312,6 @@ def setupToolBar(self,task=False): + self.promptlabel = self._label("promptlabel", self.layout, hide=task) + self.cmdlabel = self._label("cmdlabel", self.layout, hide=task) + boldtxt = QtGui.QFont() +- boldtxt.setWeight(75) + boldtxt.setBold(True) + self.cmdlabel.setFont(boldtxt) + +diff --git a/src/Mod/Material/MaterialEditor.py b/src/Mod/Material/MaterialEditor.py +index cbcbde924609..28dbe83bc026 100644 +--- a/src/Mod/Material/MaterialEditor.py ++++ b/src/Mod/Material/MaterialEditor.py +@@ -27,7 +27,7 @@ + import os + from pathlib import PurePath + import sys +-from PySide import QtCore, QtGui, QtSvg ++from PySide import QtCore, QtGui, QtSvgWidgets + + import FreeCAD + import FreeCADGui +@@ -92,11 +92,11 @@ def __init__(self, obj=None, prop=None, material=None, card_path="", category="S + treeView = widget.treeView + + # create preview svg slots +- self.widget.PreviewRender = QtSvg.QSvgWidget(self.iconPath + "preview-rendered.svg") ++ self.widget.PreviewRender = QtSvgWidgets.QSvgWidget(self.iconPath + "preview-rendered.svg") + self.widget.PreviewRender.setMaximumWidth(64) + self.widget.PreviewRender.setMinimumHeight(64) + self.widget.topLayout.addWidget(self.widget.PreviewRender) +- self.widget.PreviewVector = QtSvg.QSvgWidget(self.iconPath + "preview-vector.svg") ++ self.widget.PreviewVector = QtSvgWidgets.QSvgWidget(self.iconPath + "preview-vector.svg") + self.widget.PreviewVector.setMaximumWidth(64) + self.widget.PreviewVector.setMinimumHeight(64) + self.widget.topLayout.addWidget(self.widget.PreviewVector) diff --git a/media-gfx/freecad/freecad-0.21.2-r2.ebuild b/media-gfx/freecad/freecad-0.21.2-r2.ebuild deleted file mode 100644 index b65ac07c0858..000000000000 --- a/media-gfx/freecad/freecad-0.21.2-r2.ebuild +++ /dev/null @@ -1,390 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..11} ) - -inherit check-reqs cmake flag-o-matic optfeature python-single-r1 qmake-utils xdg - -DESCRIPTION="QT based Computer Aided Design application" -HOMEPAGE="https://www.freecad.org/ https://github.com/FreeCAD/FreeCAD" - -MY_PN=FreeCAD - -if [[ ${PV} = *9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git" - S="${WORKDIR}/freecad-${PV}" -else - SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="amd64" - S="${WORKDIR}/FreeCAD-${PV}" -fi - -# code is licensed LGPL-2 -# examples are licensed CC-BY-SA (without note of specific version) -LICENSE="LGPL-2 CC-BY-SA-4.0" -SLOT="0" -IUSE="debug designer +gui qt6 test" - -FREECAD_EXPERIMENTAL_MODULES="cloud netgen pcl" -FREECAD_STABLE_MODULES="addonmgr fem idf image inspection material - openscad part-design path points raytracing robot show surface - techdraw tux" - -for module in ${FREECAD_STABLE_MODULES}; do - IUSE="${IUSE} +${module}" -done -for module in ${FREECAD_EXPERIMENTAL_MODULES}; do - IUSE="${IUSE} ${module}" -done -unset module - -RESTRICT="!test? ( test )" - -RDEPEND=" - ${PYTHON_DEPS} - dev-libs/OpenNI2[opengl(+)] - dev-libs/boost:= - dev-libs/libfmt:= - dev-libs/libspnav[X] - dev-libs/xerces-c[icu] - !qt6? ( - dev-qt/qtconcurrent:5 - dev-qt/qtcore:5 - dev-qt/qtnetwork:5 - dev-qt/qtxml:5 - dev-qt/qtxmlpatterns:5 - ) - qt6? ( - dev-qt/qtbase:6[concurrent,network,xml] - ) - media-libs/freetype - media-libs/qhull:= - sci-libs/hdf5:=[fortran,zlib] - >=sci-libs/med-4.0.0-r1 - =media-libs/coin-4.0.0 - virtual/glu - virtual/opengl - !qt6? ( - dev-qt/designer:5 - dev-qt/qtgui:5 - dev-qt/qtopengl:5 - dev-qt/qtprintsupport:5 - dev-qt/qtsvg:5 - dev-qt/qtwebengine:5[widgets] - dev-qt/qtwidgets:5 - dev-qt/qtx11extras:5 - pcl? ( sci-libs/pcl[qt5] ) - $(python_gen_cond_dep ' - dev-python/matplotlib[${PYTHON_USEDEP}] - >=dev-python/pivy-0.6.5[${PYTHON_USEDEP}] - dev-python/pyside2[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] - dev-python/shiboken2[${PYTHON_USEDEP}] - ' python3_{10..11} ) - ) - qt6? ( - sci-libs/opencascade[-inspector(-)] - designer? ( dev-qt/qttools:6[designer] ) - dev-qt/qt5compat:6 - dev-qt/qttools:6[widgets] - dev-qt/qtbase:6[gui,opengl,widgets] - dev-qt/qtsvg:6 - dev-qt/qtwebengine:6[widgets] - pcl? ( sci-libs/pcl[-qt5,qt6(-)] ) - $(python_gen_cond_dep ' - dev-python/matplotlib[${PYTHON_USEDEP}] - >=dev-python/pivy-0.6.5[${PYTHON_USEDEP}] - dev-python/pyside6[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] - dev-python/shiboken6[${PYTHON_USEDEP}] - ' ) - ) - ) - netgen? ( media-gfx/netgen[opencascade] ) - openscad? ( media-gfx/openscad ) - pcl? ( sci-libs/pcl:=[opengl,openni2,vtk] ) - $(python_gen_cond_dep ' - dev-python/numpy[${PYTHON_USEDEP}] - dev-python/pybind11[${PYTHON_USEDEP}] - addonmgr? ( dev-python/GitPython[${PYTHON_USEDEP}] ) - fem? ( dev-python/ply[${PYTHON_USEDEP}] ) - ') -" -DEPEND=" - ${RDEPEND} - >=dev-cpp/eigen-3.3.1:3 - test? ( - $(python_gen_cond_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]') - !qt6? ( dev-qt/qttest:5 ) - ) -" -BDEPEND=" - app-text/dos2unix - dev-lang/swig - test? ( - $(python_gen_cond_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]') - !qt6? ( dev-qt/qttest:5 ) - ) -" - -# To get required dependencies: -# 'grep REQUIRES_MODS cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake' -# We set the following requirements by default: -# arch, draft, drawing, import, mesh, part, qt5, sketcher, spreadsheet, start, web. -# -# Additionally, we auto-enable mesh_part, flat_mesh and smesh -# Fem actually needs smesh, but as long as we don't have a smesh package, we enable -# smesh through the mesh USE flag. Note however, the fem<-smesh dependency isn't -# reflected by the REQUIRES_MODS macro, but at -# cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake:187. -# -# The increase in auto-enabled workbenches is due to their need in parts of the -# test suite when compiled with a minimal set of USE flags. -REQUIRED_USE=" - ${PYTHON_REQUIRED_USE} - designer? ( gui ) - inspection? ( points ) - path? ( robot ) -" - -PATCHES=( - "${FILESDIR}"/${PN}-0.21.0-0001-Gentoo-specific-disable-ccache-usage.patch - "${FILESDIR}"/${PN}-0.21.1-Gentoo-specific-don-t-check-vcs.patch - "${FILESDIR}"/${PN}-0.21.2-vtk9.3-fix.patch - "${FILESDIR}"/${PN}-0.21.2-boost-175-1.patch - "${FILESDIR}"/${PN}-0.21.2-boost-175-2.patch - "${FILESDIR}"/${PN}-0.21.2-boost-175-3.patch -) - -DOCS=( CODE_OF_CONDUCT.md README.md ) - -CHECKREQS_DISK_BUILD="2G" - -pkg_setup() { - check-reqs_pkg_setup - python-single-r1_pkg_setup - [[ -z ${CASROOT} ]] && die "\${CASROOT} not set, please run eselect opencascade" -} - -src_prepare() { - # Fix desktop file - sed -e 's/Exec=FreeCAD/Exec=freecad/' -i src/XDGData/org.freecadweb.FreeCAD.desktop || die - - find "${S}" -type f -exec dos2unix -q {} \; || die "failed to convert to unix line endings" - - if has_version ">=dev-python/shiboken6-6.7.0"; then - # https://bugs.gentoo.org/929973 - eapply "${FILESDIR}/${PN}-0.21.2-shiboken-6.7.0.patch" - fi - - cmake_src_prepare -} - -src_configure() { - # -Werror=odr, -Werror=lto-type-mismatch - # https://bugs.gentoo.org/875221 - # https://github.com/FreeCAD/FreeCAD/issues/13173 - filter-lto - - local mycmakeargs=( - -DBUILD_ADDONMGR=$(usex addonmgr) - -DBUILD_ARCH=ON - -DBUILD_ASSEMBLY=OFF # deprecated - -DBUILD_CLOUD=$(usex cloud) - -DBUILD_COMPLETE=OFF # deprecated - -DBUILD_DRAFT=ON - -DBUILD_DESIGNER_PLUGIN=$(usex designer) - -DBUILD_ENABLE_CXX_STD:STRING="C++17" # needed for >=boost-1.77.0 - -DBUILD_FEM=$(usex fem) - -DBUILD_FEM_NETGEN=$(usex netgen) - -DBUILD_FLAT_MESH=ON - -DBUILD_FORCE_DIRECTORY=ON # force building in a dedicated directory - -DBUILD_FREETYPE=ON # automagic dep - -DBUILD_GUI=$(usex gui) - -DBUILD_IDF=$(usex idf) - -DBUILD_IMAGE=$(usex image) - -DBUILD_IMPORT=ON # import module for various file formats - -DBUILD_INSPECTION=$(usex inspection) - -DBUILD_JTREADER=OFF # code has been removed upstream, but option is still there - -DBUILD_MATERIAL=$(usex material) - -DBUILD_MESH=ON - -DBUILD_MESH_PART=ON - -DBUILD_OPENSCAD=$(usex openscad) - -DBUILD_PART=ON - -DBUILD_PART_DESIGN=$(usex part-design) - -DBUILD_PATH=$(usex path) - -DBUILD_POINTS=$(usex points) - -DBUILD_RAYTRACING=$(usex raytracing) - -DBUILD_REVERSEENGINEERING=OFF # currently only an empty sandbox - -DBUILD_ROBOT=$(usex robot) - -DBUILD_SHOW=$(usex show) - -DBUILD_SKETCHER=ON # needed by draft workspace - -DBUILD_SMESH=ON - -DBUILD_SPREADSHEET=ON - -DBUILD_START=ON - -DBUILD_SURFACE=$(usex surface) - -DBUILD_TECHDRAW=$(usex techdraw) - -DBUILD_TEST=ON # always build test workbench for run-time testing - -DBUILD_TUX=$(usex tux) - -DBUILD_VR=OFF - -DBUILD_WEB=ON # needed by start workspace - -DBUILD_WITH_CONDA=OFF - - -DCMAKE_INSTALL_DATADIR=/usr/share/${PN}/data - -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF} - -DCMAKE_INSTALL_INCLUDEDIR=/usr/include/${PN} - -DCMAKE_INSTALL_PREFIX=/usr/$(get_libdir)/${PN} - - -DFREECAD_BUILD_DEBIAN=OFF - - -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 - -DFREECAD_USE_FREETYPE=ON - -DFREECAD_USE_OCC_VARIANT:STRING="Official Version" - -DFREECAD_USE_PCL=$(usex pcl) - -DFREECAD_USE_PYBIND11=ON - -DFREECAD_USE_QT_FILEDIALOG=ON - -DFREECAD_USE_QTWEBMODULE:STRING="Qt WebEngine" - - # install python modules to site-packages' dir. True only for the main package, - # sub-packages will still be installed inside /usr/lib64/freecad - -DINSTALL_TO_SITEPACKAGES=ON - - # Use the version of shiboken2 that matches the selected python version - -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}" - -DPython3_EXECUTABLE=${PYTHON} - ) - - if use debug; then - # BUILD_SANDBOX currently broken, see - # https://forum.freecadweb.org/viewtopic.php?f=4&t=36071&start=30#p504595 - mycmakeargs+=( - -DBUILD_SANDBOX=OFF - -DBUILD_TEMPLATE=ON - ) - else - mycmakeargs+=( - -DBUILD_SANDBOX=OFF - -DBUILD_TEMPLATE=OFF - ) - fi - - if use qt6; then - mycmakeargs+=( - -DFREECAD_QT_MAJOR_VERSION=6 - -DFREECAD_QT_VERSION=6 - -DQT_DEFAULT_MAJOR_VERSION=6 - -DQt6Core_MOC_EXECUTABLE="$(qt6_get_bindir)/moc" - -DQt6Core_RCC_EXECUTABLE="$(qt6_get_bindir)/rcc" - -DBUILD_QT5=OFF - # Drawing module unmaintained and not ported to qt6 - -DBUILD_DRAWING=OFF - ) - else - mycmakeargs+=( - -DFREECAD_QT_MAJOR_VERSION=5 - -DFREECAD_QT_VERSION=5 - -DQT_DEFAULT_MAJOR_VERSION=5 - -DQt5Core_MOC_EXECUTABLE="$(qt5_get_bindir)/moc" - -DQt5Core_RCC_EXECUTABLE="$(qt5_get_bindir)/rcc" - -DBUILD_QT5=ON - # Drawing module unmaintained and not ported to qt6 - -DBUILD_DRAWING=ON - ) - fi - - cmake_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=-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 -# configuration. Without those, there are sandbox violation, when it -# tries to create /var/lib/portage/home/.FreeCAD directory. -src_test() { - pushd "${BUILD_DIR}" > /dev/null || die - export FREECAD_USER_HOME="${HOME}" - export FREECAD_USER_DATA="${T}" - export FREECAD_USER_TEMP="${T}" - nonfatal ./bin/FreeCADCmd --run-test 0 - popd > /dev/null || die -} - -src_install() { - cmake_src_install - - dobin src/Tools/freecad-thumbnailer - - if use gui; then - newbin - freecad <<- _EOF_ - #!/bin/sh - # https://github.com/coin3d/coin/issues/451 - : \${QT_QPA_PLATFORM:=xcb} - export QT_QPA_PLATFORM - exec /usr/$(get_libdir)/${PN}/bin/FreeCAD \${@} - _EOF_ - mv "${ED}"/usr/$(get_libdir)/${PN}/share/* "${ED}"/usr/share || die "failed to move shared resources" - fi - dosym -r /usr/$(get_libdir)/${PN}/bin/FreeCADCmd /usr/bin/freecadcmd - - rm -r "${ED}"/usr/$(get_libdir)/${PN}/include/E57Format || die "failed to drop unneeded include directory E57Format" - use test && (rm -r "${ED}"/usr/include/${PN}/{gmock,gtest} || die) - - python_optimize "${ED}"/usr/share/${PN}/data/Mod/Start/StartPage "${ED}"/usr/$(get_libdir)/${PN}{/Ext,/Mod}/ - # compile main package in python site-packages as well - python_optimize -} - -pkg_postinst() { - xdg_pkg_postinst - - einfo "You can load a lot of additional workbenches using the integrated" - einfo "AddonManager." - - # ToDo: check opencv, pysolar (::science), elmerfem (::science) - # ifc++, ifcopenshell, z88 (no pkgs), calculix-ccx (::waebbl) - einfo "There are a lot of additional tools, for which FreeCAD has builtin" - einfo "support. Some of them are available in Gentoo. Take a look at" - einfo "https://wiki.freecadweb.org/Installing#External_software_supported_by_FreeCAD" - optfeature_header "Computational utilities" - optfeature "BLAS library" sci-libs/openblas - optfeature "Statistical computation with Python" dev-python/pandas - optfeature "Use scientific computation with Python" dev-python/scipy - optfeature "Use symbolic math with Python" dev-python/sympy - optfeature_header "Imaging, Plotting and Rendering utilities" - optfeature "Dependency graphs" media-gfx/graphviz - optfeature "PBR Rendering" media-gfx/povray - optfeature_header "Import / Export" - optfeature "Interact with git repositories" dev-python/GitPython - optfeature "Work with COLLADA documents" dev-python/pycollada - optfeature "YAML importer and emitter" dev-python/pyyaml - optfeature "Importing and exporting 2D AutoCAD DWG files" media-gfx/libredwg - optfeature "Importing and exporting geospatial data formats" sci-libs/gdal - optfeature "Working with projection data" sci-libs/proj - optfeature_header "Meshing and FEM" - optfeature "FEM mesh generator" sci-libs/gmsh - optfeature "Triangulating meshes" sci-libs/gts - optfeature "Visualization" sci-visualization/paraview -} - -pkg_postrm() { - xdg_pkg_postrm -} diff --git a/media-gfx/freecad/freecad-0.21.2-r3.ebuild b/media-gfx/freecad/freecad-0.21.2-r3.ebuild new file mode 100644 index 000000000000..bf1b98990bc0 --- /dev/null +++ b/media-gfx/freecad/freecad-0.21.2-r3.ebuild @@ -0,0 +1,398 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +inherit check-reqs cmake flag-o-matic optfeature python-single-r1 qmake-utils xdg + +DESCRIPTION="QT based Computer Aided Design application" +HOMEPAGE="https://www.freecad.org/ https://github.com/FreeCAD/FreeCAD" + +MY_PN=FreeCAD + +if [[ ${PV} = *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/${MY_PN}/${MY_PN}.git" + S="${WORKDIR}/freecad-${PV}" +else + SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="amd64" + S="${WORKDIR}/FreeCAD-${PV}" +fi + +# code is licensed LGPL-2 +# examples are licensed CC-BY-SA (without note of specific version) +LICENSE="LGPL-2 CC-BY-SA-4.0" +SLOT="0" +IUSE="debug designer +gui qt6 test" + +FREECAD_EXPERIMENTAL_MODULES="cloud netgen pcl" +FREECAD_STABLE_MODULES="addonmgr fem idf image inspection material + openscad part-design path points raytracing robot show surface + techdraw tux" + +for module in ${FREECAD_STABLE_MODULES}; do + IUSE="${IUSE} +${module}" +done +for module in ${FREECAD_EXPERIMENTAL_MODULES}; do + IUSE="${IUSE} ${module}" +done +unset module + +RESTRICT="!test? ( test )" + +RDEPEND=" + ${PYTHON_DEPS} + dev-libs/OpenNI2[opengl(+)] + dev-libs/boost:= + dev-libs/libfmt:= + dev-libs/libspnav[X] + dev-libs/xerces-c[icu] + !qt6? ( + dev-qt/qtconcurrent:5 + dev-qt/qtcore:5 + dev-qt/qtnetwork:5 + dev-qt/qtxml:5 + dev-qt/qtxmlpatterns:5 + ) + qt6? ( + dev-qt/qtbase:6[concurrent,network,xml] + ) + media-libs/freetype + media-libs/qhull:= + sci-libs/hdf5:=[fortran,zlib] + >=sci-libs/med-4.0.0-r1 + =media-libs/coin-4.0.0 + virtual/glu + virtual/opengl + !qt6? ( + dev-qt/designer:5 + dev-qt/qtgui:5 + dev-qt/qtopengl:5 + dev-qt/qtprintsupport:5 + dev-qt/qtsvg:5 + dev-qt/qtwebengine:5[widgets] + dev-qt/qtwidgets:5 + dev-qt/qtx11extras:5 + pcl? ( sci-libs/pcl[qt5] ) + $(python_gen_cond_dep ' + dev-python/matplotlib[${PYTHON_USEDEP}] + >=dev-python/pivy-0.6.5[${PYTHON_USEDEP}] + dev-python/pyside2:=[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] + dev-python/shiboken2:=[${PYTHON_USEDEP}] + ' python3_{10..11} ) + ) + qt6? ( + sci-libs/opencascade[-inspector(-)] + designer? ( dev-qt/qttools:6[designer] ) + dev-qt/qt5compat:6 + dev-qt/qttools:6[widgets] + dev-qt/qtbase:6[gui,opengl,widgets] + dev-qt/qtsvg:6 + dev-qt/qtwebengine:6[widgets] + pcl? ( sci-libs/pcl[-qt5,qt6(-)] ) + $(python_gen_cond_dep ' + dev-python/matplotlib[${PYTHON_USEDEP}] + >=dev-python/pivy-0.6.5[${PYTHON_USEDEP}] + dev-python/pyside6:=[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] + dev-python/shiboken6:=[${PYTHON_USEDEP}] + ' ) + ) + ) + netgen? ( media-gfx/netgen[opencascade] ) + openscad? ( media-gfx/openscad ) + pcl? ( sci-libs/pcl:=[opengl,openni2,vtk] ) + $(python_gen_cond_dep ' + dev-python/numpy[${PYTHON_USEDEP}] + dev-python/pybind11[${PYTHON_USEDEP}] + addonmgr? ( dev-python/GitPython[${PYTHON_USEDEP}] ) + fem? ( dev-python/ply[${PYTHON_USEDEP}] ) + ') +" +DEPEND=" + ${RDEPEND} + >=dev-cpp/eigen-3.3.1:3 + test? ( + $(python_gen_cond_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]') + !qt6? ( dev-qt/qttest:5 ) + ) +" +BDEPEND=" + app-text/dos2unix + dev-lang/swig + test? ( + $(python_gen_cond_dep 'dev-python/pyyaml[${PYTHON_USEDEP}]') + !qt6? ( dev-qt/qttest:5 ) + ) +" + +# To get required dependencies: +# 'grep REQUIRES_MODS cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake' +# We set the following requirements by default: +# arch, draft, drawing, import, mesh, part, qt5, sketcher, spreadsheet, start, web. +# +# Additionally, we auto-enable mesh_part, flat_mesh and smesh +# Fem actually needs smesh, but as long as we don't have a smesh package, we enable +# smesh through the mesh USE flag. Note however, the fem<-smesh dependency isn't +# reflected by the REQUIRES_MODS macro, but at +# cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake:187. +# +# The increase in auto-enabled workbenches is due to their need in parts of the +# test suite when compiled with a minimal set of USE flags. +REQUIRED_USE=" + ${PYTHON_REQUIRED_USE} + designer? ( gui ) + inspection? ( points ) + path? ( robot ) + python_single_target_python3_12? ( gui? ( qt6 ) ) +" +# There is no py3.12 support planned for pyside2 + +PATCHES=( + "${FILESDIR}"/${PN}-0.21.0-0001-Gentoo-specific-disable-ccache-usage.patch + "${FILESDIR}"/${PN}-0.21.1-Gentoo-specific-don-t-check-vcs.patch + "${FILESDIR}"/${PN}-0.21.2-vtk9.3-fix.patch + "${FILESDIR}"/${PN}-0.21.2-boost-175-1.patch + "${FILESDIR}"/${PN}-0.21.2-boost-175-2.patch + "${FILESDIR}"/${PN}-0.21.2-boost-175-3.patch +) + +DOCS=( CODE_OF_CONDUCT.md README.md ) + +CHECKREQS_DISK_BUILD="2G" + +pkg_setup() { + check-reqs_pkg_setup + python-single-r1_pkg_setup + [[ -z ${CASROOT} ]] && die "\${CASROOT} not set, please run eselect opencascade" +} + +src_prepare() { + # Fix desktop file + sed -e 's/Exec=FreeCAD/Exec=freecad/' -i src/XDGData/org.freecadweb.FreeCAD.desktop || die + + find "${S}" -type f -exec dos2unix -q {} \; || die "failed to convert to unix line endings" + + if has_version ">=dev-python/shiboken6-6.7.0"; then + # https://bugs.gentoo.org/929973 + eapply "${FILESDIR}/${PN}-0.21.2-shiboken-6.7.0.patch" + fi + + if use qt6; then + eapply "${FILESDIR}/${PN}-0.21.2-navcube-qt6.patch" + eapply "${FILESDIR}/${PN}-0.21.2-qtsvg-qt6.patch" + eapply "${FILESDIR}/${PN}-0.21.2-py312-qt6.patch" + fi + + cmake_src_prepare +} + +src_configure() { + # -Werror=odr, -Werror=lto-type-mismatch + # https://bugs.gentoo.org/875221 + # https://github.com/FreeCAD/FreeCAD/issues/13173 + filter-lto + + local mycmakeargs=( + -DBUILD_ADDONMGR=$(usex addonmgr) + -DBUILD_ARCH=ON + -DBUILD_ASSEMBLY=OFF # deprecated + -DBUILD_CLOUD=$(usex cloud) + -DBUILD_COMPLETE=OFF # deprecated + -DBUILD_DRAFT=ON + -DBUILD_DESIGNER_PLUGIN=$(usex designer) + -DBUILD_ENABLE_CXX_STD:STRING="C++17" # needed for >=boost-1.77.0 + -DBUILD_FEM=$(usex fem) + -DBUILD_FEM_NETGEN=$(usex netgen) + -DBUILD_FLAT_MESH=ON + -DBUILD_FORCE_DIRECTORY=ON # force building in a dedicated directory + -DBUILD_FREETYPE=ON # automagic dep + -DBUILD_GUI=$(usex gui) + -DBUILD_IDF=$(usex idf) + -DBUILD_IMAGE=$(usex image) + -DBUILD_IMPORT=ON # import module for various file formats + -DBUILD_INSPECTION=$(usex inspection) + -DBUILD_JTREADER=OFF # code has been removed upstream, but option is still there + -DBUILD_MATERIAL=$(usex material) + -DBUILD_MESH=ON + -DBUILD_MESH_PART=ON + -DBUILD_OPENSCAD=$(usex openscad) + -DBUILD_PART=ON + -DBUILD_PART_DESIGN=$(usex part-design) + -DBUILD_PATH=$(usex path) + -DBUILD_POINTS=$(usex points) + -DBUILD_RAYTRACING=$(usex raytracing) + -DBUILD_REVERSEENGINEERING=OFF # currently only an empty sandbox + -DBUILD_ROBOT=$(usex robot) + -DBUILD_SHOW=$(usex show) + -DBUILD_SKETCHER=ON # needed by draft workspace + -DBUILD_SMESH=ON + -DBUILD_SPREADSHEET=ON + -DBUILD_START=ON + -DBUILD_SURFACE=$(usex surface) + -DBUILD_TECHDRAW=$(usex techdraw) + -DBUILD_TEST=ON # always build test workbench for run-time testing + -DBUILD_TUX=$(usex tux) + -DBUILD_VR=OFF + -DBUILD_WEB=ON # needed by start workspace + -DBUILD_WITH_CONDA=OFF + + -DCMAKE_INSTALL_DATADIR=/usr/share/${PN}/data + -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF} + -DCMAKE_INSTALL_INCLUDEDIR=/usr/include/${PN} + -DCMAKE_INSTALL_PREFIX=/usr/$(get_libdir)/${PN} + + -DFREECAD_BUILD_DEBIAN=OFF + + -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 + -DFREECAD_USE_FREETYPE=ON + -DFREECAD_USE_OCC_VARIANT:STRING="Official Version" + -DFREECAD_USE_PCL=$(usex pcl) + -DFREECAD_USE_PYBIND11=ON + -DFREECAD_USE_QT_FILEDIALOG=ON + -DFREECAD_USE_QTWEBMODULE:STRING="Qt WebEngine" + + # install python modules to site-packages' dir. True only for the main package, + # sub-packages will still be installed inside /usr/lib64/freecad + -DINSTALL_TO_SITEPACKAGES=ON + + # Use the version of shiboken2 that matches the selected python version + -DPYTHON_CONFIG_SUFFIX="-${EPYTHON}" + -DPython3_EXECUTABLE=${PYTHON} + ) + + if use debug; then + # BUILD_SANDBOX currently broken, see + # https://forum.freecadweb.org/viewtopic.php?f=4&t=36071&start=30#p504595 + mycmakeargs+=( + -DBUILD_SANDBOX=OFF + -DBUILD_TEMPLATE=ON + ) + else + mycmakeargs+=( + -DBUILD_SANDBOX=OFF + -DBUILD_TEMPLATE=OFF + ) + fi + + if use qt6; then + mycmakeargs+=( + -DFREECAD_QT_MAJOR_VERSION=6 + -DFREECAD_QT_VERSION=6 + -DQT_DEFAULT_MAJOR_VERSION=6 + -DQt6Core_MOC_EXECUTABLE="$(qt6_get_bindir)/moc" + -DQt6Core_RCC_EXECUTABLE="$(qt6_get_bindir)/rcc" + -DBUILD_QT5=OFF + # Drawing module unmaintained and not ported to qt6 + -DBUILD_DRAWING=OFF + ) + else + mycmakeargs+=( + -DFREECAD_QT_MAJOR_VERSION=5 + -DFREECAD_QT_VERSION=5 + -DQT_DEFAULT_MAJOR_VERSION=5 + -DQt5Core_MOC_EXECUTABLE="$(qt5_get_bindir)/moc" + -DQt5Core_RCC_EXECUTABLE="$(qt5_get_bindir)/rcc" + -DBUILD_QT5=ON + # Drawing module unmaintained and not ported to qt6 + -DBUILD_DRAWING=ON + ) + fi + + cmake_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=-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 +# configuration. Without those, there are sandbox violation, when it +# tries to create /var/lib/portage/home/.FreeCAD directory. +src_test() { + pushd "${BUILD_DIR}" > /dev/null || die + export FREECAD_USER_HOME="${HOME}" + export FREECAD_USER_DATA="${T}" + export FREECAD_USER_TEMP="${T}" + nonfatal ./bin/FreeCADCmd --run-test 0 + popd > /dev/null || die +} + +src_install() { + cmake_src_install + + dobin src/Tools/freecad-thumbnailer + + if use gui; then + newbin - freecad <<- _EOF_ + #!/bin/sh + # https://github.com/coin3d/coin/issues/451 + : \${QT_QPA_PLATFORM:=xcb} + export QT_QPA_PLATFORM + exec /usr/$(get_libdir)/${PN}/bin/FreeCAD \${@} + _EOF_ + mv "${ED}"/usr/$(get_libdir)/${PN}/share/* "${ED}"/usr/share || die "failed to move shared resources" + fi + dosym -r /usr/$(get_libdir)/${PN}/bin/FreeCADCmd /usr/bin/freecadcmd + + rm -r "${ED}"/usr/$(get_libdir)/${PN}/include/E57Format || die "failed to drop unneeded include directory E57Format" + use test && (rm -r "${ED}"/usr/include/${PN}/{gmock,gtest} || die) + + python_optimize "${ED}"/usr/share/${PN}/data/Mod/Start/StartPage "${ED}"/usr/$(get_libdir)/${PN}{/Ext,/Mod}/ + # compile main package in python site-packages as well + python_optimize +} + +pkg_postinst() { + xdg_pkg_postinst + + einfo "You can load a lot of additional workbenches using the integrated" + einfo "AddonManager." + + # ToDo: check opencv, pysolar (::science), elmerfem (::science) + # ifc++, ifcopenshell, z88 (no pkgs), calculix-ccx (::waebbl) + einfo "There are a lot of additional tools, for which FreeCAD has builtin" + einfo "support. Some of them are available in Gentoo. Take a look at" + einfo "https://wiki.freecadweb.org/Installing#External_software_supported_by_FreeCAD" + optfeature_header "Computational utilities" + optfeature "BLAS library" sci-libs/openblas + optfeature "Statistical computation with Python" dev-python/pandas + optfeature "Use scientific computation with Python" dev-python/scipy + optfeature "Use symbolic math with Python" dev-python/sympy + optfeature_header "Imaging, Plotting and Rendering utilities" + optfeature "Dependency graphs" media-gfx/graphviz + optfeature "PBR Rendering" media-gfx/povray + optfeature_header "Import / Export" + optfeature "Interact with git repositories" dev-python/GitPython + optfeature "Work with COLLADA documents" dev-python/pycollada + optfeature "YAML importer and emitter" dev-python/pyyaml + optfeature "Importing and exporting 2D AutoCAD DWG files" media-gfx/libredwg + optfeature "Importing and exporting geospatial data formats" sci-libs/gdal + optfeature "Working with projection data" sci-libs/proj + optfeature_header "Meshing and FEM" + optfeature "FEM mesh generator" sci-libs/gmsh + optfeature "Triangulating meshes" sci-libs/gts + optfeature "Visualization" sci-visualization/paraview +} + +pkg_postrm() { + xdg_pkg_postrm +} diff --git a/media-gfx/freecad/freecad-9999.ebuild b/media-gfx/freecad/freecad-9999.ebuild index f5778af821ff..250c1a1dbbf7 100644 --- a/media-gfx/freecad/freecad-9999.ebuild +++ b/media-gfx/freecad/freecad-9999.ebuild @@ -94,8 +94,8 @@ RDEPEND=" $(python_gen_cond_dep ' dev-python/matplotlib[${PYTHON_USEDEP}] >=dev-python/pivy-0.6.5[${PYTHON_USEDEP}] - dev-python/pyside2[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] - dev-python/shiboken2[${PYTHON_USEDEP}] + dev-python/pyside2:=[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] + dev-python/shiboken2:=[${PYTHON_USEDEP}] ' python3_{10..11} ) ) qt6? ( @@ -109,8 +109,8 @@ RDEPEND=" $(python_gen_cond_dep ' dev-python/matplotlib[${PYTHON_USEDEP}] >=dev-python/pivy-0.6.5[${PYTHON_USEDEP}] - dev-python/pyside6[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] - dev-python/shiboken6[${PYTHON_USEDEP}] + dev-python/pyside6:=[gui,svg,webchannel,webengine,${PYTHON_USEDEP}] + dev-python/shiboken6:=[${PYTHON_USEDEP}] ' ) ) ) -- cgit v1.2.3