diff mbox series

[bug#36440] Add FreeCAD

Message ID CAKf5CqWH6EEu+SehmkapURMDc7p4JEz1E2OkBuY2A-zV3oMWxw@mail.gmail.com
State Accepted
Headers show
Series [bug#36440] Add FreeCAD | expand

Commit Message

John Soo July 23, 2019, 4:25 p.m. UTC
Hi Bjorn, Jonathon, and everyone,

FreeCAD was certainly not easy to package. I spent actually several months
just working on the pyside2 dependencies and I still do not have a working
build of Pivy from coin.  It is only thanks to the help of the upstream
maintainers that this package is even close to working.  I have attached
updated patches and my responses to Bjorn's notes below. Thanks for your
review!

As to QTWebKit - I do not know why it is a dependency. It may not be a hard
requirement. If you comment it out, I think the configure phase may
succeed. I included it for completion only.

* FreeCAD Notes

** DONE Add commit message details and copyright lines

** Coin3D

*** DONE Delete blobs

*** hg-fetch deletes .hg dirs (and all submodules' .hg dirs)

** SoQT vs. Quarter

*** Not interchangeable as far as I know.

*** FreeCAD requires SoQT specifically during configure.

** Pyside2

*** Does all of pyside2 belong in qt.scm? - there are three packages:
Shiboken2, Pyside2, and Pyside2-Tools

*** QT version compatibility

**** The pyside2 project has branches for the newest version with
compatibility with older QT versions (I am using the 5.11.3 compat branch)

 - That is also why I am using a git commit for the Pyside2 packages
 - https://code.qt.io/cgit/pyside/pyside-setup.git/
 - Pyside dependencies were by far the most challenging, and I had to track
some issues (of which, some are not resolved)

** libmedfile

*** Reason for old version is that what was released when I started

*** 4.0.0 requires hdf5 >= 1.10.2

**** HDF5 has some dependents:

guix refresh --list-dependent hdf5 Building the following 11 packages would
ensure 23 dependent packages are rebuilt:
r-ioniser@2.8.0 r-scone@1.8.0 r-lumi@2.36.0 r-yarn@1.10.0
r-illuminahumanmethylationepicmanifest@0.3.0 r-scdd@1.8.0 pigx@0.0.3
r-pore@0.24 r-yamss@1.10.0 r-xcms@3.6.1 r-msnid@1.18.0

**** HDF5 patches need updates when HDF5 updated to 1.10.5

*** DONE Change license to gpl3+

** libarea License questions and source locations:

**** I am using the source from github: https://github.com/Heeks/libarea

 - Should I use some other source? The google archive is unavailable.
 - I cannot find any license information in the github repository.

**** DONE Change to gpl3+

** Using releases over hg/git downloads (please advise)

1. Pyside2 packages - Done for compatibility reasons
2. Coin3D and SoQt - I don't think there are releases of these aside from
the bitbucket repository.
3. LLVM propagated packages (llvm-toolchain and pyside-libcxx-headers)
 - I am not sure these are the best way to accomplish the goal anyways.
 - Not sure where to find the right sources for llvm-toolchain-6 and the
pyside-libcxx-headers.
4. libarea - Seems like libarea is actually close to not even having source
available anymore, let alone a release
5. libspnav - Confused as to the best source to use here. If there is a
release or better version, I can update.
6. FreeCAD
 - I can use the releases if they exist. I do not think they have source
tarballs available.
 - I was packaging during a lot of active development of FreeCAD

Thank you for your review and advice.

- John

On Mon, Jul 22, 2019 at 5:57 PM Jonathan Brielmaier <
jonathan.brielmaier@web.de> wrote:

> Thanks Björn for having a look here :)
>
> On 7/22/19 4:11 PM, Björn Höfling wrote:> I wanted to give it a try for
> myself but failed: I could not build
> > qtwebkit locally, and no substitutes are available. I don't want to
> > hold back my comments any longer, so I postponed trying it out.
>
> qtwebkit seems to fail on master as well and it needs long to build, so
> I can't do it locally on my laptop:
> http://ci.guix.gnu.org/build/1488065/details
>
> > I wonder if we need the dependency on qtwebkit or if we can get rid of
> this, but I haven't investigated yet.
>
> I think we need it as openSUSE and Debian have a build require on
> qtwebkit-devel and it's noted at their wiki:
> https://www.freecadweb.org/wiki/CompileOnUnix#Getting_the_dependencies
>

Comments

Jonathan Brielmaier July 24, 2019, 7:52 a.m. UTC | #1
I didn't build all the packages, because it failed to apply them on top
of current master. Did you rebased it on current master?

I only comment where I "know" something...

On 7/23/19 6:25 PM, John Soo wrote:
> ** Coin3D
>
> *** DONE Delete blobs
>
> *** hg-fetch deletes .hg dirs (and all submodules' .hg dirs)

- Usually the (arguments) section is right after the (build-system...)
but this is more optical :P
- Wikipedia uses https://bitbucket.org/Coin3D/coin/src but I think the
link to their wiki https://bitbucket.org/Coin3D/coin/wiki/Home is even
better :)

> ** SoQT vs. Quarter
>
> *** Not interchangeable as far as I know.
>
> *** FreeCAD requires SoQT specifically during configure.

Do we really need SoQT? Neither openSUSE
https://build.opensuse.org/package/show/science/FreeCAD nor ArchLinux
https://aur.archlinux.org/packages/freecad/ depending on SoQT

> ** Pyside2
>
> *** Does all of pyside2 belong in qt.scm? - there are three packages:
> Shiboken2, Pyside2, and Pyside2-Tools

qt.scm does already include python and python-xyz, so from this side
it's not a problem. If pyside* would be used by non QT projects, which
also doesn't depend on QT it would be good to have it in python-xyz
module, but I don't think that is the case. So leave them in qt.scm :)

python-shiboken-2
Maybe leave a comment that it's a source inside of pyside-setup, because
the first repo I found was this :)
https://code.qt.io/cgit/pyside/shiboken.git/

pyside-2-tools:
- Maybe elaborate a bit more in the description, I have no idead what
"lupdate, rcc and uic" is :P
- Is there a reason why we don't run the tests?

python-pyside-2:
- No newlines in the description after a sentence, just two whitespaces :)

> ** libmedfile

- description: What is a MED file?

> *** Reason for old version is that what was released when I started
>
> *** 4.0.0 requires hdf5 >= 1.10.2
>
> **** HDF5 has some dependents:
>
> guix refresh --list-dependent hdf5 Building the following 11 packages would
> ensure 23 dependent packages are rebuilt:
> r-ioniser@2.8.0 r-scone@1.8.0 r-lumi@2.36.0 r-yarn@1.10.0
> r-illuminahumanmethylationepicmanifest@0.3.0 r-scdd@1.8.0 pigx@0.0.3
> r-pore@0.24 r-yamss@1.10.0 r-xcms@3.6.1 r-msnid@1.18.0

20 rebuilds is not a problem.

> **** HDF5 patches need updates when HDF5 updated to 1.10.5

So they don't apply anymore at the moment?

> ** Using releases over hg/git downloads (please advise)
>
> 1. Pyside2 packages - Done for compatibility reasons
> 2. Coin3D and SoQt - I don't think there are releases of these aside from
> the bitbucket repository.

https://bitbucket.org/Coin3D/coin/downloads/

> 3. LLVM propagated packages (llvm-toolchain and pyside-libcxx-headers)
>  - I am not sure these are the best way to accomplish the goal anyways.
>  - Not sure where to find the right sources for llvm-toolchain-6 and the
> pyside-libcxx-headers.
> 4. libarea - Seems like libarea is actually close to not even having source
> available anymore, let alone a release
> 5. libspnav - Confused as to the best source to use here. If there is a
> release or better version, I can update.

This one:
https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/libspnav#n13

> 6. FreeCAD
>  - I can use the releases if they exist. I do not think they have source
> tarballs available.
>  - I was packaging during a lot of active development of FreeCAD
>
> Thank you for your review and advice.

That's it from me at the moment. Strong work! Keep it up :)
~Jonathan
John Soo July 24, 2019, 7:46 p.m. UTC | #2
Hi Jonathon,

Thanks for your comments. I was able to apply the patches over current master this morning after a fetch. There are some dependencies between the patches. The only thing I can think of is to make sure you apply them in order. I’ll take a look and adjust to the rest of your comments in the next day or so.

Thanks again.

- John

> On Jul 24, 2019, at 12:52 AM, Jonathan Brielmaier <jonathan.brielmaier@web.de> wrote:
> 
> I didn't build all the packages, because it failed to apply them on top
> of current master. Did you rebased it on current master?
> 
> I only comment where I "know" something...
> 
>> On 7/23/19 6:25 PM, John Soo wrote:
>> ** Coin3D
>> 
>> *** DONE Delete blobs
>> 
>> *** hg-fetch deletes .hg dirs (and all submodules' .hg dirs)
> 
> - Usually the (arguments) section is right after the (build-system...)
> but this is more optical :P
> - Wikipedia uses https://bitbucket.org/Coin3D/coin/src but I think the
> link to their wiki https://bitbucket.org/Coin3D/coin/wiki/Home is even
> better :)
> 
>> ** SoQT vs. Quarter
>> 
>> *** Not interchangeable as far as I know.
>> 
>> *** FreeCAD requires SoQT specifically during configure.
> 
> Do we really need SoQT? Neither openSUSE
> https://build.opensuse.org/package/show/science/FreeCAD nor ArchLinux
> https://aur.archlinux.org/packages/freecad/ depending on SoQT
> 
>> ** Pyside2
>> 
>> *** Does all of pyside2 belong in qt.scm? - there are three packages:
>> Shiboken2, Pyside2, and Pyside2-Tools
> 
> qt.scm does already include python and python-xyz, so from this side
> it's not a problem. If pyside* would be used by non QT projects, which
> also doesn't depend on QT it would be good to have it in python-xyz
> module, but I don't think that is the case. So leave them in qt.scm :)
> 
> python-shiboken-2
> Maybe leave a comment that it's a source inside of pyside-setup, because
> the first repo I found was this :)
> https://code.qt.io/cgit/pyside/shiboken.git/
> 
> pyside-2-tools:
> - Maybe elaborate a bit more in the description, I have no idead what
> "lupdate, rcc and uic" is :P
> - Is there a reason why we don't run the tests?
> 
> python-pyside-2:
> - No newlines in the description after a sentence, just two whitespaces :)
> 
>> ** libmedfile
> 
> - description: What is a MED file?
> 
>> *** Reason for old version is that what was released when I started
>> 
>> *** 4.0.0 requires hdf5 >= 1.10.2
>> 
>> **** HDF5 has some dependents:
>> 
>> guix refresh --list-dependent hdf5 Building the following 11 packages would
>> ensure 23 dependent packages are rebuilt:
>> r-ioniser@2.8.0 r-scone@1.8.0 r-lumi@2.36.0 r-yarn@1.10.0
>> r-illuminahumanmethylationepicmanifest@0.3.0 r-scdd@1.8.0 pigx@0.0.3
>> r-pore@0.24 r-yamss@1.10.0 r-xcms@3.6.1 r-msnid@1.18.0
> 
> 20 rebuilds is not a problem.
> 
>> **** HDF5 patches need updates when HDF5 updated to 1.10.5
> 
> So they don't apply anymore at the moment?
> 
>> ** Using releases over hg/git downloads (please advise)
>> 
>> 1. Pyside2 packages - Done for compatibility reasons
>> 2. Coin3D and SoQt - I don't think there are releases of these aside from
>> the bitbucket repository.
> 
> https://bitbucket.org/Coin3D/coin/downloads/
> 
>> 3. LLVM propagated packages (llvm-toolchain and pyside-libcxx-headers)
>> - I am not sure these are the best way to accomplish the goal anyways.
>> - Not sure where to find the right sources for llvm-toolchain-6 and the
>> pyside-libcxx-headers.
>> 4. libarea - Seems like libarea is actually close to not even having source
>> available anymore, let alone a release
>> 5. libspnav - Confused as to the best source to use here. If there is a
>> release or better version, I can update.
> 
> This one:
> https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/libspnav#n13
> 
>> 6. FreeCAD
>> - I can use the releases if they exist. I do not think they have source
>> tarballs available.
>> - I was packaging during a lot of active development of FreeCAD
>> 
>> Thank you for your review and advice.
> 
> That's it from me at the moment. Strong work! Keep it up :)
> ~Jonathan
Ricardo Wurmus July 24, 2019, 9:51 p.m. UTC | #3
John Soo <jsoo1@asu.edu> writes:

> *** 4.0.0 requires hdf5 >= 1.10.2
>
> **** HDF5 has some dependents:
>
> guix refresh --list-dependent hdf5 Building the following 11 packages would
> ensure 23 dependent packages are rebuilt:
> r-ioniser@2.8.0 r-scone@1.8.0 r-lumi@2.36.0 r-yarn@1.10.0
> r-illuminahumanmethylationepicmanifest@0.3.0 r-scdd@1.8.0 pigx@0.0.3
> r-pore@0.24 r-yamss@1.10.0 r-xcms@3.6.1 r-msnid@1.18.0
>
> **** HDF5 patches need updates when HDF5 updated to 1.10.5

We do have a later version of HDF5: hdf5-1.10, that’s version 1.10.4.
Is this enough?
diff mbox series

Patch

From 93c7a987e98e04ab0eb099a5cc8a6d53313f84a1 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo@panosoft.com>
Date: Sun, 7 Jul 2019 10:32:10 -0700
Subject: [PATCH 11/11] gnu: Add freecad.

* gnu/packages/engineering.scm (freecad): New variable.
---
 gnu/packages/engineering.scm | 86 ++++++++++++++++++++++++++++++++++++
 1 file changed, 86 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index f10b6dff98..16e98b1dff 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -53,6 +53,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)
@@ -65,10 +66,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)
@@ -89,6 +93,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
@@ -2065,6 +2070,87 @@  analysis and AC analysis.  The engine is designed to do true mixed-mode
 simulation.")
     (license license:gpl3+)))
 
+(define-public freecad
+  (let ((commit "3129ae4296e40ed20e7b3d460b86e6969acbe1c3")
+        (revision "1"))
+    (package
+      (name "freecad")
+      (version (git-version "0.18.3" 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
+           "1ny29y0h8smg1bwi5yn4kcnyfprqh3v7v2z8837cmmhcwp8dr95m"))))
+      (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