Subject: Re: [bug#36440] [PATCH] Add FreeCAD

From: John Soo <[email-masked]>
Date: Wed, 10 Jul 2019 14:02:38 +0000

Updated patches with rebase on master.

- John

On Mon, Jul 8, 2019 at 1:17 AM John Soo <[email-masked]> wrote:

> Hi Bjorn,
>
> Thanks for taking a look. Here are the patches with one package in each.
>
> - John
>
>
From 543ee528f0e2c0aa056c16e7c5aeea24ab1d8881 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Thu, 4 Jul 2019 16:29:24 -0700
Subject: [PATCH 02/11] gnu: Add soqt.

---
 gnu/packages/graphics.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index b2689129ee..7f0b99476b 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -52,6 +52,7 @@
   #:use-module (gnu packages image)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages jemalloc)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
@@ -1005,3 +1006,38 @@ standard graphics library for 3D visualization and visual simulation
 software in the scientific and engineering community.")
       (license license:bsd-3))))
 
+(define-public soqt
+  (let ((changeset "58b495aa6bed9e58542e60df28843f58e2ab8db4")
+        (revision "1"))
+    (package
+      (name "soqt")
+      (version
+       (string-append "1.6.0-" revision "." (string-take changeset 7)))
+      (source
+       (origin
+         (method hg-fetch)
+         (uri (hg-reference (url "https://bitbucket.org/Coin3d/soqt")
+                            (changeset changeset)))
+         (sha256
+          (base32
+           "023rhf8piwcmgi08d3xyqj1cj83v30z6l3zbd5qs1y1mkw9lqfpz"))
+         (file-name (git-file-name "soqt" version))))
+      (build-system cmake-build-system)
+      (native-inputs
+       `(("doxygen" ,doxygen)
+         ("graphviz" ,graphviz)))
+      (inputs
+       `(("coin3D" ,coin3D)
+         ("glew" ,glew)
+         ("libcxx" ,libcxx)
+         ("qtbase" ,qtbase)))
+      (arguments `(#:tests? #f))
+      (home-page "https://bitbucket.org/Coin3D/soqt")
+      (synopsis
+       "GUI component toolkit library for Coin")
+      (description
+       "SoQt is a Qt GUI component toolkit library for Coin.  It is also
+compatible with SGI and TGS Open Inventor, and the API is based on the API of
+the InventorXt GUI component toolkit.")
+      (license license:bsd-3))))
+
-- 
2.22.0

From 121b8bbf68b06c4b18fef6ca87cbcaff7d4696d7 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sat, 6 Jul 2019 10:20:22 -0700
Subject: [PATCH 05/11] gnu: Add python-pyside-2-libcxx-headers.

---
 gnu/packages/llvm.scm | 55 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index a3f797b59c..5806fb9ec7 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -701,3 +701,58 @@ using @code{clang-rename}.")))
          #t)))
     (license license:ncsa)))
 
+;; See https://bugreports.qt.io/browse/PYSIDE-787
+;; STL headers are not parsed correctly, so only send in some headers
+(define-public python-pyside-2-libcxx-headers
+  (package
+    (inherit libcxx)
+    (name "python-pyside-2-libcxx-headers")
+    (version (package-version llvm-6))
+    (source
+     (origin
+       (inherit (package-source libcxx))
+       (uri (string-append "http://llvm.org/releases/"
+                           version "/libcxx-" version ".src.tar.xz"))
+       (sha256
+        (base32
+         "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n"))))
+    (native-inputs
+     `(("clang" ,clang-6)
+       ("llvm" ,llvm-6)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'use-only-required-headers
+           (lambda* (#:key outputs #:allow-other-keys)
+             (use-modules ((srfi srfi-1)))
+             (let ((out (assoc-ref outputs "out"))
+                   (required-headers
+                    '("type_traits"
+                      "__config"
+                      "cstddef"
+                      "__nullptr"
+                      "utility"
+                      "__tuple"
+                      "initializer_list"
+                      "cstring"
+                      "cstdint"
+                      "__debug")))
+               (for-each
+                delete-file
+                (filter
+                 (lambda (file)
+                   (not
+                    (fold
+                     (lambda (acc header)
+                       (or acc (string-contains file header)))
+                     #f
+                     required-headers)))
+                 (find-files (string-append out "/include/c++/v1"))))
+               (delete-file-recursively (string-append out "/include/c++/v1/ext"))
+               (delete-file-recursively (string-append out "/include/c++/v1/support"))
+               (delete-file-recursively (string-append out "/lib")))
+             #t)))))
+    (synopsis
+     "Libcxx files specifically used by PySide2")
+    (description
+     "Libcxx files specifically used by PySide2.")))
-- 
2.22.0

From ffc90110fc85e5a781f158398bd6f59b42457034 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Wed, 3 Jul 2019 09:40:31 -0700
Subject: [PATCH 01/11] gnu: Add coin3D.

---
 gnu/packages/graphics.scm | 44 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index f9baf49fe9..b2689129ee 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -73,6 +73,7 @@
   #:use-module (guix build-system python)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix hg-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils))
@@ -961,3 +962,46 @@ your terminal.  It comes bundled with predefined styles:
 look.  The result can be uploaded on any web server without additional
 requirements.")
     (license license:gpl2+)))
+
+(define-public coin3D
+  (let ((changeset  "8d860d7ba112b22c4e9b289268fd8b3625ab81d3")
+        (revision "1"))
+    (package
+      (name "coin3D")
+      (version
+       (string-append "4.0.0a-" revision "." (string-take changeset 7)))
+      (source
+       (origin
+         (method hg-fetch)
+         (uri (hg-reference (url "https://bitbucket.org/Coin3D/coin")
+                            (changeset changeset)))
+         (sha256
+          (base32
+           "0kgg782j8lkd4bicd8x207mj66vali6kxh6idczjszcxq2iifsr0"))
+         (file-name (git-file-name "coin3D" version))))
+      (build-system cmake-build-system)
+      (native-inputs
+       `(("doxygen" ,doxygen)
+         ("graphviz" ,graphviz)))
+      (inputs
+       `(("boost" ,boost)
+         ("freeglut" ,freeglut)
+         ("glew" ,glew)))
+      (arguments
+       `(#:configure-flags
+         (list
+          "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
+          (string-append "-DBOOST_ROOT="
+                         (assoc-ref %build-inputs "boost")))))
+      (home-page "https://bitbucket.org/Coin3D/coin/wiki/Home")
+      (synopsis
+       "High-level 3D visualization library with Open Inventor 2.1 API")
+      (description
+       "Coin is a 3D graphics library with an Application Programming Interface
+based on the Open Inventor 2.1 API.  For those who are not familiar with
+Open Inventor, it is a scene-graph based retain-mode rendering and model
+interaction library, written in C++, which has become the de facto
+standard graphics library for 3D visualization and visual simulation
+software in the scientific and engineering community.")
+      (license license:bsd-3))))
+
-- 
2.22.0

From 85a7db97f1c7b944d05cb8e27496be021736ed78 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sat, 6 Jul 2019 09:13:50 -0700
Subject: [PATCH 04/11] gnu: Add python-shiboken-2.

---
 gnu/packages/python-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 49d5126e02..33689ced89 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -15923,3 +15923,49 @@ Complete support for Berkeley DB Base Replication.  Support for RPC.")
 types for further processing.  It is primarily intended for batch jobs and
 one-off scripts.")
     (license license:expat)))
+
+(define-public python-shiboken-2
+  (let ((revision "1")
+        (commit "4018787a3cc01d632fdca7891ac8aa9487110c26"))
+    (package
+      (name "python-shiboken-2")
+      (version (git-version "v5.11.3" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://code.qt.io/pyside/pyside-setup")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0g8jacm2iqd7lw2m7f1dp1nnrsk38bl3m8pihm8zz9gxs8d31sf5"))))
+      (build-system cmake-build-system)
+      (inputs
+       `(("llvm-toolchain-6" ,llvm-toolchain-6)
+         ("libxml2" ,libxml2)
+         ("libxslt" ,libxslt)
+         ("python-wrapper" ,python-wrapper)
+         ("qtbase" ,qtbase)
+         ("qtxmlpatterns" ,qtxmlpatterns)))
+      (arguments
+       `(#:tests? #f
+         #:configure-flags '("-DBUILD_TESTS=off")
+         #:phases
+         (modify-phases
+             %standard-phases
+           (add-after 'unpack 'use-shiboken-dir-only
+             (lambda _ (chdir "sources/shiboken2") #t))
+           (add-before 'configure 'set-build-env
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((llvm-toolchain-dir (assoc-ref inputs "llvm-toolchain-6")))
+                 (setenv "CLANG_INSTALL_DIR" llvm-toolchain-dir)
+                 #t))))))
+      (home-page "https://wiki.qt.io/Qt_for_Python")
+      (synopsis
+       "Shiboken generates bindings for C++ libraries using CPython source code")
+      (description
+       "Shiboken generates bindings for C++ libraries using CPython source code")
+      ;; Help!
+      (license `(,license:gpl2+
+                 ,license:llgpl)))))
-- 
2.22.0

From ff5c74d00016519e4017b68c2f9f07f6dbde5f96 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sat, 6 Jul 2019 08:34:24 -0700
Subject: [PATCH 03/11] gnu: Add llvm-toolchain-6.

---
 gnu/packages/llvm.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 1fe9af38e0..a3f797b59c 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -37,6 +37,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system emacs)
   #:use-module (guix build-system python)
+  #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages bootstrap)           ;glibc-dynamic-linker
@@ -667,3 +668,36 @@ C/C++/Obj-C code according to a set of style options, see
     (synopsis "Rename every occurrence of a symbol using clang-rename")
     (description "This package renames every occurrence of a symbol at point
 using @code{clang-rename}.")))
+
+;; PySide2 docs recommend using a bundled version of libclang
+;; See https://wiki.qt.io/Qt_for_Python/GettingStarted
+;; The source they recommend: https://download.qt.io/development_releases/prebuilt/libclang/
+(define-public llvm-toolchain-6
+  (package
+    (inherit llvm-6)
+    (name "llvm-toolchain")
+    (build-system trivial-build-system)
+    (inputs
+     `(("clang-6" ,clang-6)
+       ("llvm-6" ,llvm-6)))
+    (arguments
+     `(#:modules ((guix build union)
+                  (guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build union)
+                      (ice-9 match)
+                      (srfi srfi-1))
+         (union-build
+          (assoc-ref %outputs "out")
+          (filter-map
+           (match-lambda
+             ((name . dir)
+              (if (or (string=? name "clang-6")
+                      (string=? name "llvm-6"))
+                  dir
+                  #f)))
+           %build-inputs))
+         #t)))
+    (license license:ncsa)))
+
-- 
2.22.0

From f873b469295ebf107eee6ecc599db04f12cb7d48 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sat, 6 Jul 2019 11:21:14 -0700
Subject: [PATCH 06/11] gnu: Add python-pyside-2.

---
 gnu/packages/python-xyz.scm | 77 +++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 33689ced89..b3a92ccf1e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -88,6 +88,7 @@
   #:use-module (gnu packages backup)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages databases)
@@ -15924,6 +15925,82 @@ types for further processing.  It is primarily intended for batch jobs and
 one-off scripts.")
     (license license:expat)))
 
+(define-public python-pyside-2
+  (let ((revision "1")
+        (commit "4018787a3cc01d632fdca7891ac8aa9487110c26"))
+    (package
+      (name "python-pyside-2")
+      (version (git-version "v5.11.3" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://code.qt.io/pyside/pyside-setup")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0g8jacm2iqd7lw2m7f1dp1nnrsk38bl3m8pihm8zz9gxs8d31sf5"))))
+      (build-system cmake-build-system)
+      (inputs
+       `(("python-pyside-2-libcxx-headers" ,python-pyside-2-libcxx-headers)
+         ("libxml2" ,libxml2)
+         ("libxslt" ,libxslt)
+         ("llvm-toolchain-6" ,llvm-toolchain-6)
+         ("qtbase" ,qtbase)
+         ("qtdatavis3d" ,qtdatavis3d)
+         ("qtmultimedia" ,qtmultimedia)
+         ("qtquickcontrols" ,qtquickcontrols) ;; ??
+         ("qtscript" ,qtscript)
+         ("qtscxml" ,qtscxml)
+         ("qtsensors" ,qtsensors)
+         ("qtspeech" ,qtspeech)
+         ("qtsvg" ,qtsvg)
+         ("qtwebchannel" ,qtwebchannel)
+         ("qtwebsockets" ,qtwebsockets)
+         ("qtx11extras" ,qtx11extras)))
+      (native-inputs
+       `(("cmake" ,cmake)
+         ("git" ,git)
+         ("python-shiboken-2" ,python-shiboken-2)
+         ("python-wrapper" ,python-wrapper)
+         ("qttools" ,qttools)
+         ("which" ,which)))
+      (arguments
+       `(#:tests? #f
+         #:configure-flags '("-DBUILD_TESTS=off")
+         #:phases
+         (modify-phases
+             %standard-phases
+           (add-after 'unpack 'go-to-source-dir
+             (lambda _ (chdir "sources/pyside2") #t))
+           (add-before 'configure 'set-clang-dir
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((clang-dir (assoc-ref inputs "llvm-toolchain-6"))
+                     (libcxx-dir (assoc-ref inputs "python-pyside-2-libcxx-headers")))
+                 (setenv "CLANG_INSTALL_DIR" clang-dir)
+                 (substitute* "cmake/Macros/PySideModules.cmake"
+                   (("--include-paths=")
+                    (string-append "--include-paths=" libcxx-dir "/include/c++/v1:")))
+                 #t))))))
+      (home-page "https://wiki.qt.io/Qt_for_Python")
+      (synopsis
+       "The Qt for Python product enables the use of Qt5 APIs in Python applications")
+      (description
+       "The Qt for Python product enables the use of Qt5 APIs in Python applications.
+It lets Python developers utilize the full potential of Qt, using the PySide2 module.
+The PySide2 module provides access to the individual Qt modules such as QtCore, QtGui,
+and so on.  Qt for Python also comes with the Shiboken2 CPython binding code generator,
+which can be used to generate Python bindings for your C or C++ code.")
+      ;; Help!
+      (license
+       `(,license:fdl1.3+
+         ,license:gpl2+
+         ,license:gpl3+
+         ;; https://code.qt.io/cgit/pyside/pyside-setup.git/tree/LICENSE.GPLv3-EXCEPT
+         ;; https://code.qt.io/cgit/pyside/pyside-setup.git/tree/LICENSE.COMMERCIAL
+         ,license:lgpl3)))))
+
 (define-public python-shiboken-2
   (let ((revision "1")
         (commit "4018787a3cc01d632fdca7891ac8aa9487110c26"))
-- 
2.22.0

From eb021d7318e5a1f20dc7672f8b88729a08911005 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sat, 6 Jul 2019 19:05:37 -0700
Subject: [PATCH 08/11] gnu: Add libspnav

---
 gnu/packages/engineering.scm | 38 ++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 7d48414889..2c2f421fbc 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2062,3 +2062,41 @@ purpose circuit simulator and can perform DC and transient analyses, fourier
 analysis and AC analysis.  The engine is designed to do true mixed-mode
 simulation.")
     (license license:gpl3+)))
+
+(define-public libspnav
+  (let ((commit "20961617eecc845b23fcf9e06acd1a6bb340b88b")
+        (revision "1"))
+    (package
+      (name "libspnav")
+      (version (git-version "0.2.3" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/FreeSpacenav/libspnav")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1ib5jxcpz76lr90f69vb50yn2q9ss45axlgil29layh36dnyifac"))))
+      (build-system gnu-build-system)
+      (inputs
+       `(("libx11" ,libx11)))
+      (arguments `(#:tests? #f))
+      (home-page "http://spacenav.sourceforge.net/")
+      (synopsis
+       "Library for communicating with spacenavd or 3dxsrv")
+      (description
+       "The libspnav library is provided as a replacement of the magellan
+library.  It provides a cleaner, and more orthogonal interface.  libspnav
+supports both the original X11 protocol for communicating with the driver, and
+the new alternative non-X protocol.  Programs that choose to use the X11
+protocol, are automatically compatible with either the free spacenavd driver
+or the official 3dxserv, as if they were using the magellan SDK.
+
+Also, libspnav provides a magellan API wrapper on top of the new API.  So, any
+applications that were using the magellan library, can switch to libspnav
+without any changes.  And programmers that are familliar with the magellan API
+can continue using it with a free library without the restrictions of the
+official SDK.")
+      (license license:bsd-3))))
-- 
2.22.0

From 0406471b59e3a9635d481403999edd76377a67b3 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sun, 7 Jul 2019 10:03:38 -0700
Subject: [PATCH 09/11] gnu: Add libarea.

---
 gnu/packages/engineering.scm | 46 ++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 2c2f421fbc..8e36354862 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -48,6 +48,7 @@
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages commencement)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
@@ -2063,6 +2064,51 @@ analysis and AC analysis.  The engine is designed to do true mixed-mode
 simulation.")
     (license license:gpl3+)))
 
+
+;; TODO: Try the google archive version with gplv3
+;; subversion url:
+;;   svn checkout http://libarea.googlecode.com/svn/trunk/ libarea
+(define-public libarea
+  (let ((revision "1")
+        (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
+    (package
+      (name "libarea")
+      (version (git-version "0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference (url "https://github.com/Heeks/libarea.git")
+                             (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
+      (build-system gnu-build-system)
+      (inputs `(("boost" ,boost)
+                ("python-wrapper" ,python-wrapper)))
+      (native-inputs
+       `(("cmake" ,cmake)))
+      (arguments
+       `(#:tests? #f
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'configure 'cmake-configure
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out"))
+                     (cmake (assoc-ref inputs "cmake")))
+                 (mkdir-p "build")
+                 (invoke "cmake"
+                         (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
+           (delete 'configure))))
+      (home-page "https://github.com/Heeks/libarea")
+      (synopsis
+       "Library and python module for pocketing and profiling operations")
+      (description
+       "Area is a CAM-related software for pocketing operation.
+
+This project provides library and associated python-module to compute pocket
+operations.")
+      (license license:bsd-3))))
+
 (define-public libspnav
   (let ((commit "20961617eecc845b23fcf9e06acd1a6bb340b88b")
         (revision "1"))
-- 
2.22.0

From bb35a51e5f482f8dee8863f3866afb596730fe78 Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sat, 6 Jul 2019 18:49:08 -0700
Subject: [PATCH 07/11] gnu: Add python-pyside-2-tools.

---
 gnu/packages/python-xyz.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b3a92ccf1e..f8838a5bc2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16046,3 +16046,35 @@ which can be used to generate Python bindings for your C or C++ code.")
       ;; Help!
       (license `(,license:gpl2+
                  ,license:llgpl)))))
+
+(define-public python-pyside-2-tools
+  (let ((revision "1")
+        (commit "f1b775537e7fbd718516749583b2abf1cb6adbce"))
+    (package
+      (name "python-pyside-2-tools")
+      (version (git-version "v5.11.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://code.qt.io/pyside/pyside-tools")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1w2g5afvww9r89wmdm9jx8sz67x4bzy9difkh72n4c73ya1n91ry"))))
+      (build-system cmake-build-system)
+      (inputs
+       `(("python-pyside-2" ,python-pyside-2)
+         ("python-shiboken-2" ,python-shiboken-2)
+         ("qtbase" ,qtbase)))
+      (arguments
+       `(#:tests? #f
+         #:configure-flags '("-DBUILD_TESTS=off")))
+      (home-page "https://wiki.qt.io/Qt_for_Python")
+      (synopsis
+       "Contains lupdate, rcc and uic tools for PySide2")
+      (description
+       "Contains lupdate, rcc and uic tools for PySide2")
+      ;; Help! (This is from arch)
+      (license license:lgpl2.1+))))
-- 
2.22.0

From c942ab65f16ae4207faebcc1b153c88166940d2c Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sun, 7 Jul 2019 10:13:17 -0700
Subject: [PATCH 10/11] gnu: Add libmedfile.

---
 gnu/packages/engineering.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 8e36354862..dd7f15abe1 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2065,6 +2065,35 @@ simulation.")
     (license license:gpl3+)))

+(define-public libmedfile
+  (package
+    (name "libmedfile")
+    (version "3.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://files.salome-platform.org/Salome/other/med-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "1215sal10xp6xirgggdszay2bmx0sxhn9pgh7x0wg2w32gw1wqyx"))))
+    (build-system cmake-build-system)
+    (inputs `(("hdf5" ,hdf5)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'remove-test-output
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (delete-file-recursively
+                (string-append out "/bin/testc"))
+               #t))))))
+    (home-page "https://www.salome-platform.org")
+    (synopsis "Library to read and write MED files")
+    (description "Library to read and write MED files")
+    (license license:lgpl2.1)))
+
 ;; TODO: Try the google archive version with gplv3
 ;; subversion url:
 ;;   svn checkout http://libarea.googlecode.com/svn/trunk/ libarea
-- 
2.22.0

From 2297370df3ccba58e3e0625af5835e730e04207d Mon Sep 17 00:00:00 2001
From: John Soo <[email-masked]>
Date: Sun, 7 Jul 2019 10:32:10 -0700
Subject: [PATCH 11/11] gnu: Add freecad.

---
 gnu/packages/engineering.scm | 85 ++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index dd7f15abe1..e2ee8ee40b 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -52,6 +52,7 @@
   #:use-module (gnu packages commencement)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages documentation)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages fpga)
@@ -64,10 +65,13 @@
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gperf)
+  #:use-module (gnu packages graphics)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages image-processing)
   #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages linux)               ;FIXME: for pcb
   #:use-module (gnu packages m4)
@@ -88,6 +92,7 @@
   #:use-module (gnu packages tex)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages wxwidgets)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg))
 
 (define-public librecad
@@ -2064,6 +2069,86 @@ analysis and AC analysis.  The engine is designed to do true mixed-mode
 simulation.")
     (license license:gpl3+)))
 
+(define-public freecad
+  (let ((commit "dbb4cc6415bac848a294f03b80f65e888d531742")
+        (revision "1"))
+    (package
+      (name "freecad")
+      (version (git-version "0.18.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/FreeCAD/FreeCAD.git")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "01ay9wdacm1hymnaw67y8sg63pv0ar1n72ap77q12dv3qibmwz75"))))
+      (build-system cmake-build-system)
+      (native-inputs
+       `(("doxygen" ,doxygen)
+         ("graphviz" ,graphviz)
+         ("qttools" ,qttools)
+         ("pkg-config" ,pkg-config)
+         ("swig" ,swig)))
+      (inputs
+       `(("boost" ,boost)
+         ("coin3D" ,coin3D)
+         ("eigen" ,eigen)
+         ("freetype" ,freetype)
+         ("glew" ,glew)
+         ("hdf5" ,hdf5)
+         ("libarea" ,libarea)
+         ("libspnav" ,libspnav)
+         ("libmedfile" ,libmedfile)
+         ("openmpi" ,openmpi)
+         ("opencascade-oce" ,opencascade-oce)
+         ("python-matplotlib" ,python-matplotlib)
+         ("python-pyside-2" ,python-pyside-2)
+         ("python-pyside-2-tools" ,python-pyside-2-tools)
+         ("python-shiboken-2" ,python-shiboken-2)
+         ("python-wrapper" ,python-wrapper)
+         ("qtbase" ,qtbase)
+         ("qtsvg" ,qtsvg)
+         ("qtx11extras" ,qtx11extras)
+         ("qtxmlpatterns" ,qtxmlpatterns)
+         ("qtwebkit" ,qtwebkit)
+         ("soqt" ,soqt)
+         ("vtk" ,vtk)
+         ("xerces-c" ,xerces-c)
+         ("zlib" ,zlib)))
+      (arguments
+       `(#:tests? #f
+         #:configure-flags
+         (list
+          "-DBUILD_QT5=ON"
+          (string-append "-DCMAKE_INSTALL_LIBDIR="
+                         (assoc-ref %outputs "out") "/lib"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'configure 'restore-pythonpath
+             (lambda _
+               (substitute* "src/Main/MainGui.cpp"
+                 (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))
+               #t))
+           (add-after 'install 'wrap-pythonpath
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (wrap-program (string-append out "/bin/FreeCAD")
+                   (list "PYTHONPATH"
+                         'prefix (list (getenv "PYTHONPATH")))))
+               #t)))))
+      (home-page "https://www.freecadweb.org/")
+      (synopsis "Your Own 3D Parametric Modeler")
+      (description
+       "FreeCAD is a general purpose feature-based, parametric 3D modeler for
+CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering and
+product design but also fits a wider range of uses in engineering, such as
+architecture or other engineering specialties.  It is 100% Open Source (LGPL2+
+license) and extremely modular, allowing for very advanced extension and
+customization.")
+      ;; Help!
+      (license license:lgpl2.1+))))
 
 (define-public libmedfile
   (package
-- 
2.22.0