Bug 212251 - Resurrect cad/FreeCAD: a parametric 3D modeler.
Summary: Resurrect cad/FreeCAD: a parametric 3D modeler.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mathieu Arnold
URL:
Keywords: patch
: 212428 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-30 02:50 UTC by Pedro F. Giffuni
Modified: 2016-09-08 15:38 UTC (History)
3 users (show)

See Also:


Attachments
FreeCAD port as a "svn diff". (43.13 KB, patch)
2016-08-30 02:50 UTC, Pedro F. Giffuni
no flags Details | Diff
freecad port in "svn diff --patch-compatible" format (41.11 KB, patch)
2016-09-07 05:01 UTC, Pedro F. Giffuni
no flags Details | Diff
updated as of today's snapshot (41.15 KB, patch)
2016-09-07 16:06 UTC, Pedro F. Giffuni
no flags Details | Diff
cad/freecad poudriere testport log on 10.3-RELEASE amd64 (105.29 KB, application/x-xz)
2016-09-07 20:27 UTC, Thibault Jouan
no flags Details
freecad 0.17.20160907 Makefile space to tab (826 bytes, patch)
2016-09-08 11:09 UTC, Thibault Jouan
no flags Details | Diff
freecad 0.17.20160907 Refactor QT components (760 bytes, patch)
2016-09-08 11:15 UTC, Thibault Jouan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni freebsd_committer 2016-08-30 02:50:01 UTC
Created attachment 174208 [details]
FreeCAD port as a "svn diff".

Directly from the "wanted ports" wiki, FreeCAD is a parametric 3D modeler directed to mechanical CAD type of designs but it can be used to design real-life objects of any size.

FreeCAD is under heavy development so I am attaching today's version.
I had to do an ugly hack to have the linker find libraries in the /usr/local path but it seems to work. I am hoping upstream finds a cleaner solution.

I did all the regular checks (check-plist stage-qa) but I'll be glad if someone else goes through the regular checks (Pöudriere, etc).
If the port takes a while to commit, you may find an updated version on this link:
https://people.freebsd.org/~pfg/ports/freecad.tgz
Comment 2 Pedro F. Giffuni freebsd_committer 2016-08-30 23:00:54 UTC
(In reply to Thierry Thomas from comment #1)
Oh yes ... I even started from the old Makefile.
Thanks for the initial port!
Comment 3 Pedro F. Giffuni freebsd_committer 2016-09-07 05:01:25 UTC
Created attachment 174465 [details]
freecad port in "svn diff --patch-compatible" format

After reverting r235719 locally to check the old port, I redid my port on top of it and update the port to the very latest version.

Normally svn doesn't rescue the original attributes too well I used the --patch compatible option so it's easier to review/test. In essence, the extensive changes in files/ are now gone replaced by just two patches.

Unlike the original port I didn't try to make the structure match hier(7), it just looked easier to give the port it's own directory.
Comment 4 Thibault Jouan 2016-09-07 12:08:29 UTC
*** Bug 212428 has been marked as a duplicate of this bug. ***
Comment 5 Mathieu Arnold freebsd_committer 2016-09-07 12:25:07 UTC
For new ports, it is better to *not* provide diff but a shar.  It is because one could be tempted to just svn commit it instead of using addport to add the port, which would loose the history in this case.
Comment 6 Mathieu Arnold freebsd_committer 2016-09-07 12:34:57 UTC
USE_LDCONFIG=yes is for ports that install .so in /usr/local/lib.  If the libraries are installed somewhere else, the correct location should be set.
Should I change this to ${PORTNAME}/lib, or should I remove it ?
Comment 7 Pedro F. Giffuni freebsd_committer 2016-09-07 14:39:15 UTC
(In reply to Mathieu Arnold from comment #5)

This is a resurrect. For the record:
svn status cad
M       cad/Makefile
A  +    cad/freecad
M  +    cad/freecad/Makefile
M  +    cad/freecad/distinfo
D  +    cad/freecad/files/patch-configure
A       cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh.cpp
D  +    cad/freecad/files/patch-src_App_Application.cpp
D  +    cad/freecad/files/patch-src_App_FreeCADInit.py
D  +    cad/freecad/files/patch-src_Base_Documentation.cpp
D  +    cad/freecad/files/patch-src_Base_EnvMacros.h
D  +    cad/freecad/files/patch-src_Base_FileInfo.cpp
D  +    cad/freecad/files/patch-src_Base_Parameter.cpp
D  +    cad/freecad/files/patch-src_Base_Parameter.h
D  +    cad/freecad/files/patch-src_Base_ParameterPy.cpp
D  +    cad/freecad/files/patch-src_Base_PyExport.h
D  +    cad/freecad/files/patch-src_Base_PyExportImp.h
D  +    cad/freecad/files/patch-src_Base_PyTools.c
D  +    cad/freecad/files/patch-src_Base_TimeInfo.h
D  +    cad/freecad/files/patch-src_FCConfig.h
D  +    cad/freecad/files/patch-src_Gui_Application.cpp
A       cad/freecad/files/patch-src_Gui_CMakeLists.txt
D  +    cad/freecad/files/patch-src_Gui_FreeCADGuiInit.py
D  +    cad/freecad/files/patch-src_Gui_Makefile.in
D  +    cad/freecad/files/patch-src_Gui_NetworkRetriever.cpp
D  +    cad/freecad/files/patch-src_Gui_Process.cpp
D  +    cad/freecad/files/patch-src_Gui_PythonConsole.cpp
D  +    cad/freecad/files/patch-src_Gui_ReportView.cpp
D  +    cad/freecad/files/patch-src_Gui_View3DInventorViewer.cpp
D  +    cad/freecad/files/patch-src_Main_MainCmd.cpp
D  +    cad/freecad/files/patch-src_Main_MainGui.cpp
D  +    cad/freecad/files/patch-src_Main_MainPy.cpp
D  +    cad/freecad/files/patch-src_Main_Makefile.in
D  +    cad/freecad/files/patch-src_Mod_Image_App_ImageBase.cpp
D  +    cad/freecad/files/patch-src_Mod_Mesh_App_Core_MeshIO.cpp
D  +    cad/freecad/files/patch-src_Mod_Mesh_App_CurveProjector.cpp
D  +    cad/freecad/files/patch-src_Mod_Mesh_App_MeshAlgos.cpp
D  +    cad/freecad/files/patch-src_Mod_Part_App_PartAlgos.cpp
D  +    cad/freecad/files/patch-src_Mod_Part_Gui_ViewProviderBox.cpp
D  +    cad/freecad/files/patch-src_Mod_Points_App_PointsAlgos.cpp
M  +    cad/freecad/pkg-descr
M  +    cad/freecad/pkg-plist
Comment 8 Pedro F. Giffuni freebsd_committer 2016-09-07 14:49:09 UTC
Hi Mathieu;

(In reply to Mathieu Arnold from comment #6)
We are installing the shared libraries in ${PREFIX}/FreeCAD/lib

Using ${PREFIX}/${PORTNAME} is not the best but it is common for other packages like BRLCad and OpenOffice. As in other ports we use symlinks so things just work(TM).

The thing is .. the port doesn't follow hier(7), and while we could hack it to install the data in ${PREFIX}/share it does make maintaining the port somewhat more difficult. The hack would involve both the installation and the configuration to find the modules. There may be a way to do it with CMake but I don't know it.

We are also slowly working on resurrecting Salome and having this in the general path would cause conflicts.

So, we do need USE_LDCONFIG=yes here.
Comment 9 Mathieu Arnold freebsd_committer 2016-09-07 14:51:24 UTC
Like I said, the resurrect part is taken care of by the addport script, that we use to add new ports.  If a port already existed, it will resurrect it.

For new ports, sending a shar is preferred over sending a diff, even if they are being resurrected.

Also, to have the port build, I needed to add "moc rcc uic" to the USE_QT line, do you know if those are needed only at build time, or also at runtime ?
Comment 10 Mathieu Arnold freebsd_committer 2016-09-07 14:52:35 UTC
Let me be a bit clearer about USE_LDCONFIG.

When you write:
USE_LDCONFIG=yes
What it does is:
USE_LDCONFIG=${PREFIX}/lib

The port does not install anything in ${PREFIX}/lib, so using USE_LDCONFIG=yes makes no sense.  So, do I remove the USE_LDCONFIG=yes, or do I change it to USE_LDCONFIG=${PREFIX}/FreeCAD/lib ?
Comment 11 Pedro F. Giffuni freebsd_committer 2016-09-07 15:02:30 UTC
(In reply to Mathieu Arnold from comment #10)

I just don't like shar (why not just send a tarball like the one I linked?), but New port |= resurrected port so I thought a svn diff was technically correct.
 
I will add USE_QT, stage-qa didn't seem to need them but it doesn't hurt to have them.
I will fix the LD_CONFIG, as well. (I think the one in elmerfem may be worng as well.)

Thanks!
Comment 12 Pedro F. Giffuni freebsd_committer 2016-09-07 16:06:14 UTC
Created attachment 174476 [details]
updated as of today's snapshot

Updated the patch for today's upstream (as I said it's a moving target) and
latest feedback. The tarball was updated too. (Currently rebuilding ...)
Comment 13 vladimir.chukharev 2016-09-07 19:59:08 UTC
FWIW, I have successfully built the port from the second patch. There have been few times repeated warnings:
make: "/usr/ports/Mk/bsd.port.subdir.mk" line 313: warning: duplicate script for target "package-name" ignored
make: "/usr/ports/Mk/bsd.port.mk" line 3919: warning: using previous script for "package-name" defined here

No other problems. The built FreeCAD app starts and shows some help. I need to learn more before I can try something real.

 $ uname -a
FreeBSD vovaasus 10.3-STABLE FreeBSD 10.3-STABLE #20 r305026: Sat Sep  3 01:18:47 EEST 2016     root@vovaasus:/usr/obj/usr/src/sys/GENERIC  amd64

PS. Thanks for porting! Hope for the soonest commit.
Comment 14 Thibault Jouan 2016-09-07 20:27:07 UTC
Created attachment 174489 [details]
cad/freecad poudriere testport log on 10.3-RELEASE amd64
Comment 15 Thibault Jouan 2016-09-07 20:27:57 UTC
Comment on attachment 174489 [details]
cad/freecad poudriere testport log on 10.3-RELEASE amd64

made with this port:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=174476
Comment 16 vladimir.chukharev 2016-09-07 20:34:44 UTC
The port from https://bugs.freebsd.org/bugzilla/attachment.cgi?id=174476 failed on build with portmaster:

...
[  4%] Generating ../../../Mod/Arch/importSH3D.py
[  4%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/Builder3D.cpp.o
[  4%] Generating ../../../Mod/Arch/ArchPipe.py
[  4%] Generating ../../../Mod/Arch/Dice3DS/Dice3DS/__init__.py
[  4%] Generating ../../../Mod/Arch/Dice3DS/Dice3DS/util.py
[  4%] Generating ../../../Mod/Arch/Dice3DS/Dice3DS/dom3ds.py
[  4%] Generating ../../../data/Mod/Arch/Presets/profiles.csv
[  4%] Generating ../../../Mod/Arch/Arch_rc.py
/usr/ports/cad/freecad/work/FreeCAD-1ed3562/src/3rdParty/salomesmesh/src/SMDS/SMDS_Mesh.cpp:61:10: fatal error: 'sys/sysinfo.h' file not found
#include <sys/sysinfo.h>
         ^
[  4%] Generating ../../../data/Mod/Arch/Resources/icons/ArchWorkbench.svg
[  4%] Built target Arch
[  4%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/Console.cpp.o
Scanning dependencies of target Ship
[  4%] Generating ../../../Mod/Ship/InitGui.py
[  4%] Generating ../../../Mod/Ship/ShipGui.py
[  4%] Generating ../../../Mod/Ship/Instance.py
[  4%] Generating ../../../Mod/Ship/TankInstance.py
[  4%] Generating ../../../Mod/Ship/WeightInstance.py
[  4%] Generating ../../../Mod/Ship/resources/examples/s60.fcstd
[  4%] Generating ../../../Mod/Ship/resources/examples/s60_katamaran.fcstd
[  4%] Generating ../../../Mod/Ship/resources/examples/wigley.fcstd
[  4%] Generating ../../../Mod/Ship/resources/examples/wigley_katamaran.fcstd
[  4%] Generating ../../../Mod/Ship/shipLoadExample/__init__.py
[  4%] Generating ../../../Mod/Ship/shipLoadExample/TaskPanel.py
[  4%] Generating ../../../Mod/Ship/shipLoadExample/TaskPanel.ui
[  4%] Generating ../../../Mod/Ship/shipCreateShip/__init__.py
[  4%] Generating ../../../Mod/Ship/shipCreateShip/Preview.py
[  4%] Generating ../../../Mod/Ship/shipCreateShip/TaskPanel.py
1 error generated.
--- src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh.cpp.o ---
*** [src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh.cpp.o] Error code 1

make[3]: stopped in /usr/ports/cad/freecad/work/.build
1 error

make[3]: stopped in /usr/ports/cad/freecad/work/.build
--- src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/all ---
*** [src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/all] Error code 2

make[2]: stopped in /usr/ports/cad/freecad/work/.build
[  4%] Generating ../../../Mod/Ship/shipCreateShip/TaskPanel.ui
A failure has been detected in another branch of the parallel make

make[3]: stopped in /usr/ports/cad/freecad/work/.build
--- src/Mod/Ship/CMakeFiles/Ship.dir/all ---
*** [src/Mod/Ship/CMakeFiles/Ship.dir/all] Error code 2

make[2]: stopped in /usr/ports/cad/freecad/work/.build
A failure has been detected in another branch of the parallel make

make[3]: stopped in /usr/ports/cad/freecad/work/.build
--- src/Base/CMakeFiles/FreeCADBase.dir/all ---
*** [src/Base/CMakeFiles/FreeCADBase.dir/all] Error code 2

make[2]: stopped in /usr/ports/cad/freecad/work/.build
3 errors

make[2]: stopped in /usr/ports/cad/freecad/work/.build
*** [all] Error code 2

make[1]: stopped in /usr/ports/cad/freecad/work/.build
1 error

make[1]: stopped in /usr/ports/cad/freecad/work/.build
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/cad/freecad

 $ uname -a
FreeBSD vovaasus 10.3-STABLE FreeBSD 10.3-STABLE #20 r305026: Sat Sep  3 01:18:47 EEST 2016     root@vovaasus:/usr/obj/usr/src/sys/GENERIC  amd64
Comment 17 Thibault Jouan 2016-09-07 21:16:10 UTC
I was able to build the last port
(https://bugs.freebsd.org/bugzilla/attachment.cgi?id=174476) with my
usual make options.

I could do the few things I was able to make with 0.16 release, but
after some usage it crashed and I got this on standard output:

$ FreeCAD
FreeCAD 0.17, Libs: 0.17RUnknown
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2015
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Gui::DocumentItem::slotChangedObject(): Group references unknown object.
Gui::DocumentItem::slotChangedObject(): Group references unknown object.
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGBUS 'bus error' detected.
zsh: exit 1     FreeCAD


I will do more testing and maybe work on a new diff and shar.
Comment 18 Pedro F. Giffuni freebsd_committer 2016-09-07 21:19:59 UTC
(In reply to Thibault Jouan from comment #17)
...
[  4%] Generating ../../../Mod/Ship/shipCreateShip/TaskPanel.py
1 error generated.
--- src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh.cpp.o ---
*** [src/3rdParty/salomesmesh/CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh.cpp.o] Error code 1

make[3]: stopped in /usr/ports/cad/freecad/work/.build
____

This looks exactly like the issue addressed by this patch:
files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh.cpp

Can you please check if the patch is applied correctly?
Comment 19 Pedro F. Giffuni freebsd_committer 2016-09-07 21:25:02 UTC
(In reply to Thibault Jouan from comment #17)
Gui::DocumentItem::slotChangedObject(): Group references unknown object.
Gui::DocumentItem::slotChangedObject(): Group references unknown object.
*** Abort *** an exception was raised, but no catch was found.
	... The exception is:SIGBUS 'bus error' detected.
zsh: exit 1     FreeCAD
...

Bummer.. this needs to be reported upstream.
It's the sad risk of running the development version.
Comment 20 vladimir.chukharev 2016-09-08 07:19:41 UTC
(In reply to Pedro F. Giffuni from comment #18)
Yes, you are right. I re-created the port from the patch, and everything builds alright.

A minor thing. portlint complains about spaces were tabs should be used. I used
DEVELOPER=yes portlint -abcmt
Comment 21 Thibault Jouan 2016-09-08 11:09:02 UTC
Created attachment 174523 [details]
freecad 0.17.20160907 Makefile space to tab

This is a patch for version 0.17.20160907, will stop the complaining about spaces before CMAKE_INSTALL_PREFIX value.
Comment 22 Thibault Jouan 2016-09-08 11:15:45 UTC
Created attachment 174524 [details]
freecad 0.17.20160907 Refactor QT components

Based on what I read here:

https://www.freebsd.org/doc/en/books/porters-handbook/using-qt.html#qt4-components-example

I think we need only to specify webkit, other are implicit. Seem
simpler for me to specify only top-level dependencies, but maybe there
are drawbacks?
Comment 23 Mathieu Arnold freebsd_committer 2016-09-08 11:29:30 UTC
(In reply to Thibault Jouan from comment #14)
> Created attachment 174489 [details]
> cad/freecad poudriere testport log on 10.3-RELEASE amd64

Please, no not attach poudriere logs to PRs, it just bloats the bugzilla database.

If the build is successful, just say "test built on xx" if it fails, quote the error :-)
Comment 24 commit-hook freebsd_committer 2016-09-08 12:17:44 UTC
A commit references this bug:

Author: mat
Date: Thu Sep  8 12:17:39 UTC 2016
New revision: 421541
URL: https://svnweb.freebsd.org/changeset/ports/421541

Log:
  (Readdition of cad/freecad which was removed on 235718)

  Add freecad 0.17.g20160907, general purpose 3D CAD modeller.

  PR:		212251
  Submitted by:	pfg

Changes:
  head/MOVED
  head/cad/Makefile
  head/cad/freecad/
  head/cad/freecad/Makefile
  head/cad/freecad/distinfo
  head/cad/freecad/files/patch-configure
  head/cad/freecad/files/patch-src_3rdParty_salomesmesh_src_SMDS_SMDS__Mesh.cpp
  head/cad/freecad/files/patch-src_App_Application.cpp
  head/cad/freecad/files/patch-src_App_FreeCADInit.py
  head/cad/freecad/files/patch-src_Base_Documentation.cpp
  head/cad/freecad/files/patch-src_Base_EnvMacros.h
  head/cad/freecad/files/patch-src_Base_FileInfo.cpp
  head/cad/freecad/files/patch-src_Base_Parameter.cpp
  head/cad/freecad/files/patch-src_Base_Parameter.h
  head/cad/freecad/files/patch-src_Base_ParameterPy.cpp
  head/cad/freecad/files/patch-src_Base_PyExport.h
  head/cad/freecad/files/patch-src_Base_PyExportImp.h
  head/cad/freecad/files/patch-src_Base_PyTools.c
  head/cad/freecad/files/patch-src_Base_TimeInfo.h
  head/cad/freecad/files/patch-src_FCConfig.h
  head/cad/freecad/files/patch-src_Gui_Application.cpp
  head/cad/freecad/files/patch-src_Gui_CMakeLists.txt
  head/cad/freecad/files/patch-src_Gui_FreeCADGuiInit.py
  head/cad/freecad/files/patch-src_Gui_Makefile.in
  head/cad/freecad/files/patch-src_Gui_NetworkRetriever.cpp
  head/cad/freecad/files/patch-src_Gui_Process.cpp
  head/cad/freecad/files/patch-src_Gui_PythonConsole.cpp
  head/cad/freecad/files/patch-src_Gui_ReportView.cpp
  head/cad/freecad/files/patch-src_Gui_View3DInventorViewer.cpp
  head/cad/freecad/files/patch-src_Main_MainCmd.cpp
  head/cad/freecad/files/patch-src_Main_MainGui.cpp
  head/cad/freecad/files/patch-src_Main_MainPy.cpp
  head/cad/freecad/files/patch-src_Main_Makefile.in
  head/cad/freecad/files/patch-src_Mod_Image_App_ImageBase.cpp
  head/cad/freecad/files/patch-src_Mod_Mesh_App_Core_MeshIO.cpp
  head/cad/freecad/files/patch-src_Mod_Mesh_App_CurveProjector.cpp
  head/cad/freecad/files/patch-src_Mod_Mesh_App_MeshAlgos.cpp
  head/cad/freecad/files/patch-src_Mod_Part_App_PartAlgos.cpp
  head/cad/freecad/files/patch-src_Mod_Part_Gui_ViewProviderBox.cpp
  head/cad/freecad/files/patch-src_Mod_Points_App_PointsAlgos.cpp
  head/cad/freecad/pkg-descr
  head/cad/freecad/pkg-plist
Comment 25 Mathieu Arnold freebsd_committer 2016-09-08 12:20:34 UTC
I changed the version to use a g as we do in the ports tree so that if 0.17 or 0.17.0 is ever released, PORTEPOCH will not be needed.  I cleaned up a few other things too.
Comment 26 Thibault Jouan 2016-09-08 12:31:49 UTC
(In reply to Mathieu Arnold from comment #23)
> Please, no not attach poudriere logs to PRs, it just bloats the bugzilla
> database.
> 
> If the build is successful, just say "test built on xx" if it fails, quote
> the error :-)

Understood, I did not realize about the database, I won't do it
again :-)


Thank you for the commit, and of course thanks Pedro for the port and
everyone who tested it!

I'll continue my testing on this new version of the port as soon as I
can and started documenting issues I have (I need to learn and test
more before reporting upstream).
Comment 27 Pedro F. Giffuni freebsd_committer 2016-09-08 14:47:32 UTC
(In reply to Thibault Jouan from comment #26)

And I am very glad to have someone else working on this port. I am a Mechanical Engineer so I have some natural interest in this but I just have too many things to do to take care of this appropriately.

The code is changing on a daily basis so take your time and when you have an update we can transfer the maintainership.

And thanks Mathieu for the review/fixes, I am somewhat rusty with ports.
Comment 28 Mathieu Arnold freebsd_committer 2016-09-08 15:38:10 UTC
As a side note, USE_LDCONFIG is *not* needed, don't take what portlint says as *must do*, cmake adds all the rpath needed