From aa13922f5c0aa55184c364c1bbf7075b3b26c0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 5 Jun 2023 23:39:27 +0700 Subject: [PATCH] freecad: fix build for occt 7.7 --- srcpkgs/freecad/patches/001-include.patch | 112 ++++++++++++++++++ .../patches/153-limits.h-for-musl.patch | 4 +- .../154-revert-gui-tmp-redirect-stderr.patch | 5 - ...d63c8c9b1280978be841d04e68a0a55cceb9.patch | 6 +- 4 files changed, 116 insertions(+), 11 deletions(-) create mode 100644 srcpkgs/freecad/patches/001-include.patch diff --git a/srcpkgs/freecad/patches/001-include.patch b/srcpkgs/freecad/patches/001-include.patch new file mode 100644 index 00000000000..28b5af54999 --- /dev/null +++ b/srcpkgs/freecad/patches/001-include.patch @@ -0,0 +1,112 @@ +From 9a41845a417189776741297c50a3827ce292bc4f Mon Sep 17 00:00:00 2001 +From: Uwe +Date: Sun, 3 Jul 2022 22:51:16 +0200 +Subject: [PATCH] [Part] OCCError.h: remove unneeded includes + +- also sort includes +--- + src/Mod/Part/App/OCCError.h | 36 +++---------------------- + src/Mod/Part/App/OffsetCurvePyImp.cpp | 12 ++++----- + src/Mod/Part/App/OffsetSurfacePyImp.cpp | 10 +++---- + 3 files changed, 12 insertions(+), 46 deletions(-) + +--- a/src/Mod/Part/App/OCCError.h ++++ b/src/Mod/Part/App/OCCError.h +@@ -23,36 +23,8 @@ + #ifndef _OCCError_h_ + #define _OCCError_h_ + +-# include + # include +-# include +-# include +-# if OCC_VERSION_HEX >= 0x060500 +-# include +-# endif +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include ++# include + + #include + #include +@@ -88,4 +60,3 @@ PartExport extern PyObject* PartExceptio + + #define PY_CATCH_OCC _PY_CATCH_OCC(return(NULL)) + #endif // _OCCError_h_ +- +--- a/src/Mod/Part/App/OffsetCurvePyImp.cpp ++++ b/src/Mod/Part/App/OffsetCurvePyImp.cpp +@@ -20,20 +20,20 @@ + * * + ***************************************************************************/ + +- + #include "PreCompiled.h" + #ifndef _PreComp_ + # include + #endif + +-#include "OCCError.h" +-#include "Geometry.h" ++#include ++#include ++#include ++ + #include "OffsetCurvePy.h" + #include "OffsetCurvePy.cpp" ++#include "Geometry.h" ++#include "OCCError.h" + +-#include +-#include +-#include + + using namespace Part; + +--- a/src/Mod/Part/App/OffsetSurfacePyImp.cpp ++++ b/src/Mod/Part/App/OffsetSurfacePyImp.cpp +@@ -20,20 +20,16 @@ + * * + ***************************************************************************/ + +- + #include "PreCompiled.h" + #ifndef _PreComp_ + # include + # include + #endif + +-#include +-#include +- + #include "OCCError.h" +-#include "Geometry.h" +-#include +-#include ++#include "OffsetSurfacePy.h" ++#include "OffsetSurfacePy.cpp" ++ + + using namespace Part; + diff --git a/srcpkgs/freecad/patches/153-limits.h-for-musl.patch b/srcpkgs/freecad/patches/153-limits.h-for-musl.patch index 59b0ff178ef..4c1b369680b 100644 --- a/srcpkgs/freecad/patches/153-limits.h-for-musl.patch +++ b/srcpkgs/freecad/patches/153-limits.h-for-musl.patch @@ -1,6 +1,6 @@ ---- a/src/FCConfig.h.ORIG +--- a/src/FCConfig.h +++ b/src/FCConfig.h -@@ -321,4 +321,10 @@ +@@ -321,4 +321,10 @@ typedef unsigned __int64 uint64_t; //# define _PreComp_ // use precompiled header #endif diff --git a/srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch b/srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch index 287179a23c3..d6a9adabdec 100644 --- a/srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch +++ b/srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch @@ -12,8 +12,6 @@ Subject: [PATCH] Gui: remove workaround for spnav 0.23 due to build failure src/Gui/3Dconnexion/GuiNativeEventLinux.cpp | 27 --------------------- 1 file changed, 27 deletions(-) -diff --git a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp -index 7f0ddd75d..455ece0b3 100644 --- a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp +++ b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp @@ -21,42 +21,17 @@ @@ -68,6 +66,3 @@ index 7f0ddd75d..455ece0b3 100644 Q_UNUSED(window) if (spnav_open() == -1) { Base::Console().Log("Couldn't connect to spacenav daemon. Please ignore if you don't have a spacemouse.\n"); --- -2.37.1 - diff --git a/srcpkgs/freecad/patches/fe02d63c8c9b1280978be841d04e68a0a55cceb9.patch b/srcpkgs/freecad/patches/fe02d63c8c9b1280978be841d04e68a0a55cceb9.patch index 44b8d977def..d4acf370ca0 100644 --- a/srcpkgs/freecad/patches/fe02d63c8c9b1280978be841d04e68a0a55cceb9.patch +++ b/srcpkgs/freecad/patches/fe02d63c8c9b1280978be841d04e68a0a55cceb9.patch @@ -8,11 +8,9 @@ Subject: [PATCH] Draft: update inspect.getargspec to inspect.getfullargspec src/Mod/Draft/draftguitools/gui_snapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/src/Mod/Draft/draftguitools/gui_snapper.py b/src/Mod/Draft/draftguitools/gui_snapper.py -index de27eaa53482..ef9ba5284d3c 100644 --- a/src/Mod/Draft/draftguitools/gui_snapper.py +++ b/src/Mod/Draft/draftguitools/gui_snapper.py -@@ -1438,7 +1438,7 @@ def accept(): +@@ -1426,7 +1426,7 @@ class Snapper: Gui.Snapper.off() self.ui.offUi() if callback: @@ -21,7 +19,7 @@ index de27eaa53482..ef9ba5284d3c 100644 obj = None if self.snapInfo and ("Object" in self.snapInfo) and self.snapInfo["Object"]: obj = App.ActiveDocument.getObject(self.snapInfo["Object"]) -@@ -1457,7 +1457,7 @@ def cancel(): +@@ -1445,7 +1445,7 @@ class Snapper: Gui.Snapper.off() self.ui.offUi() if callback: