Subject: bug#43448: FreeCAD fails to compile

From: Malte Frank Gerdes <[email-masked]>
Date: Tue, 20 Oct 2020 22:31:17 +0200

This patch defines the include paths for shiboken2, pyside2 and includes
the locations of the pyside2-tools binaries.

There's now another error:

--8<---------------cut here---------------start------------->8---
[ 69%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/WidgetFactory.cpp.o
/tmp/guix-build-freecad-0.18.4.drv-0/freecad-0.18.4-checkout/src/Gui/WidgetFactory.cpp:79:11: fatal error: basewrapper.h: No such file or directory
 # include <basewrapper.h>
           ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/build.make:4659: src/Gui/CMakeFiles/FreeCADGui.dir/WidgetFactory.cpp.o] Error 1
make -f src/Mod/Inspection/App/CMakeFiles/Inspection.dir/build.make src/Mod/Inspection/App/CMakeFiles/Inspection.dir/depend
make[2]: *** Waiting for unfinished jobs....
make[2]: Entering directory '/tmp/guix-build-freecad-0.18.4.drv-0/build'
--8<---------------cut here---------------end--------------->8---

This is what needs to be looked into next.

Malte

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 2a7dfe470f..3c1f6a98f3 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2481,7 +2481,19 @@ full programmatic control over your models.")
        (list
         "-DBUILD_QT5=ON"
         (string-append "-DCMAKE_INSTALL_LIBDIR="
-                       (assoc-ref %outputs "out") "/lib"))
+                       (assoc-ref %outputs "out") "/lib")
+        (string-append "-DPYSIDE2UICBINARY="
+                       (assoc-ref %build-inputs "python-pyside-2-tools")
+                       "/bin/uic")
+        (string-append "-DPYSIDE2RCCBINARY="
+                       (assoc-ref %build-inputs "python-pyside-2-tools")
+                       "/bin/rcc")
+        (string-append "-DPYSIDE_INCLUDE_DIR="
+                       (assoc-ref %build-inputs "python-pyside-2")
+                       "/include")
+        (string-append "-DSHIBOKEN_INCLUDE_DIR="
+                       (assoc-ref %build-inputs "python-shiboken-2")
+                       "/include"))
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'restore-pythonpath