Subject: FreeCAD fails to compile

From: Ekaitz Zarraga <[email-masked]>
Date: Sat, 05 Dec 2020 15:17:57 +0000

Hi,

I solved most of the compilation issue with freecad.

Now my package version compiles but install phase fails with this error:

```                                                                                                                                                                                             CMake Error at src/3rdParty/salomesmesh/cmake_install.cmake:41 (if):                                                                                                                             if given arguments:                                                                                                                                                                                                                                                                                                                                                                             "EXISTS" "/tmp/guix-build-freecad-mine-0.18.5.drv-0/build/" "/gnu/store/injf0n8qja607qswa5cyxz1dpzqia21p-freecad-mine-0.18.5/lib\"/libSMDS.so\"" "AND" "NOT" "IS_SYMLINK" "/tmp/guix-build-freecad-mine-0.18.5.drv-0/build/" "/gnu/store/injf0n8qja607qswa5cyxz1dpzqia21p-freecad-mine-0.18.5/lib\"/libSMDS.so\""                                                                                                                                                                                                                                                                          Unknown arguments specified                                                                                                                                                                  Call Stack (most recent call first):                                                                                                                                                             src/3rdParty/cmake_install.cmake:42 (include)                                                                                                                                                  src/cmake_install.cmake:43 (include)                                                                                                                                                           cmake_install.cmake:46 (include)
```

Did anyone see something like this before?

Right now I have no idea how to tackle this but I'll keep researching.

If anyone wants to be able to reach this point, the only changes I applied to the project are configure-flags suggested in this bug report with some extra more because the header files were not found in subdirectories. These are the configure flags I added (mostly copied from Nix package[^nix]):

```
(list
         "-DBUILD_QT5=ON"
         (string-append "-DCMAKE_INSTALL_LIBDIR=\"" (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")

         "-DPYSIDE_LIBRARY=PySide2::pyside2"
         (string-append "-DPYSIDE_INCLUDE_DIR="
                        (assoc-ref %build-inputs "python-pyside-2") "/include;"
                        (assoc-ref %build-inputs "python-pyside-2") "/include/PySide2;"
                        (assoc-ref %build-inputs "python-pyside-2") "/include/PySide2/QtCore;"
                        (assoc-ref %build-inputs "python-pyside-2") "/include/PySide2/QtWidgets;"
                        (assoc-ref %build-inputs "python-pyside-2") "/include/PySide2/QtGui;")

         "-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
         (string-append "-DSHIBOKEN_INCLUDE_DIR="
                        (assoc-ref %build-inputs "python-shiboken-2")
                        "/include/shiboken2"))
```

I hope we can have something working soon!

Cheers,
Ekaitz

[^nix]: https://github.com/NixOS/nixpkgs/blob/7caa81d8a23f0278e868adf9054ec5409cd81f93/pkgs/applications/graphics/freecad/default.nix