Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yopito/3ac7d4c8fee646171ca900ff17452567 to your computer and use it in GitHub Desktop.
Save yopito/3ac7d4c8fee646171ca900ff17452567 to your computer and use it in GitHub Desktop.
From 203ab064eb9107f3271d93ea14a4091336ac5b4c Mon Sep 17 00:00:00 2001
From: yopito <pierre.bourgin@free.fr>
Date: Tue, 28 Jun 2022 23:53:46 +0200
Subject: [PATCH] freecad: fix build (stderr resource is readonly)
---
.../154-revert-gui-tmp-redirect-stderr.patch | 73 +++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch
diff --git a/srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch b/srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch
new file mode 100644
index 0000000000..287179a23c
--- /dev/null
+++ b/srcpkgs/freecad/patches/154-revert-gui-tmp-redirect-stderr.patch
@@ -0,0 +1,73 @@
+see https://github.com/FreeCAD/FreeCAD/commit/cfe94b00d3434f3e2c8b5114d2909f628c330fa8#commitcomment-71413407
+
+upstream: yes
+
+From 7b377a216b9185960e4cee980a6504dc1a755f50 Mon Sep 17 00:00:00 2001
+From: wmayer <wmayer@users.sourceforge.net>
+Date: Wed, 29 Jun 2022 15:19:18 +0200
+Subject: [PATCH] Gui: remove workaround for spnav 0.23 due to build failure
+ with musl libc
+
+---
+ 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 @@
+ ***************************************************************************/
+
+ #include <FCConfig.h>
+-#include <cstdio>
+
+ #include "GuiNativeEventLinux.h"
+
+ #include "GuiApplicationNativeEventAware.h"
+ #include <Base/Console.h>
+-#include <Base/FileInfo.h>
+ #include <QMainWindow>
+
+ #include <QSocketNotifier>
+
+ #include <spnav.h>
+
+-namespace {
+-class RedirectStdErr
+-{
+-public:
+- RedirectStdErr()
+- : fi(Base::FileInfo::getTempFileName())
+- , file(stderr)
+- {
+- stderr = fopen(fi.filePath().c_str(), "w");
+- }
+- ~RedirectStdErr()
+- {
+- fclose(stderr);
+- fi.deleteFile();
+- stderr = file;
+- }
+-
+-private:
+- Base::FileInfo fi;
+- FILE* file;
+-};
+-}
+-
+ Gui::GuiNativeEvent::GuiNativeEvent(Gui::GUIApplicationNativeEventAware *app)
+ : GuiAbstractNativeEvent(app)
+ {
+@@ -72,8 +47,6 @@ Gui::GuiNativeEvent::~GuiNativeEvent()
+
+ void Gui::GuiNativeEvent::initSpaceball(QMainWindow *window)
+ {
+- // tmp. redirect stderr to a file to suppress an error message from spnav_open()
+- RedirectStdErr err;
+ 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
+
--
2.37.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment