UPDATE: I’m happy to announce that FreeCAD has been imported to the OpenBSD ports tree, and will be available for OpenBSD-stable users with the upcoming 7.8 release. There are a couple of bugs that I haven’t had the time to debug, but overall, the port is usable. Now the fun of maintaining the port begins. For this too, any help and/or testing is welcome and appreciated. Special thanks to wmayer for all the help
Hi everyone,
I’ve decided to take on the challenge of porting FreeCAD to OpenBSD. Some efforts have been made in the past already, but there’s little documentation about it and it’s scattered all over the place in abandoned repos and mailing lists. In order to avoid the same result, I decided to start this thread. I’d like this to be a place to centralize all efforts to port FreeCAD to OpenBSD, track progress and discuss issues that may arise.
Although I maintain a number of ports in OpenBSD, none of them are on the scale of FreeCAD. I’m also fairly new to the world of compiling software, so I hope to get some questions answered here. For anyone interested, the work in progress of the port and its dependencies can be found on my personal repo.
All help is welcome
Dependencies:*
X: Already ported/Imported
W: Work in progress
?: Unknown
Let’s kick off this thread with my first question.
When I run CMake, the OpenGL header library GL/gl.h is not found. I believe this is because on OpenBSD these header files are installed in the non-standard path /usr/X11R6/include.
I’ve had this problem with other ports, and the solution was to add something along the following lines to CMakeLists.txt
if (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
find_package(X11 REQUIRED)
include_directories(${X11_INCLUDE_DIR})
endif()
However, as I’m fairly new to CMake and the FreeCAD codebase, I’m not sure where this should be placed. src/Gui/CMakeLists.txt seems like the appropriate place. Is this assumption correct? I think this could be added upstream and I will make a pull request once this is resolved.
UPDATE: The snippet suggested above doesn’t seem to be necessary as the OpenGL library libGL.so.18.0 is actually found. I just hadn’t gotten that far into the configuration because opencascade was missing and was aborting the configuration early. However I’m still getting:
Looking for GL/gl.h - not found
Can this be ignored? Or am I just completely wrong and this is not related to OpenGL?
Good news, the opencascade port is now more or less complete. Soon I’ll submit it for inclusion in the official repositories.
I’m thinking to go for VTK or Pyside and Shiboken next. Regarding the latter, can FreeCAD already be compiled with QT6? If yes, I think I would just skip Pyside2 completely and go for Pyside6. Is this already supported? I read a little about some partially successful attempts here but the last post is in November of 2022 so I’m not sure if how the situation developed. Any feedback on this would be appreciated.
wmayer. is SoQt still necessary to compile Pivy even though it’s been replaced by Quarter in FreeCAD? Based on the CMakeLists.txt from pivy, SoQt seems to be optional, but I’m not sure if compiling pivy without it will break the Draft/Arch/BIM Workbenches.
Another question wmayer: Based on this, FreeCAD’s source includes the source code of libarea, zipios++, zlib and quarter. An external Zipios++ provided by the OS can be used with FREECAD_USE_EXTERNAL_ZIPIOS=ON. Can this be done for the other included libraries as well? Usually OpenBSD ports try to use shared libraries as much as possible, but I’m not sure if this is a good idea with the included libraries in FreeCAD. Have they been specifically modified for FreeCAD?
zlib code is not part of the FreeCAD code base. A CMake switch only exists for zipios++ but neither for Quarter and libarea. Furthermore, the Quarter code has changes compared to the original code to better fulfil our needs.
sliptonic, mlampert: Would it be an issue to use an external libarea instead of the one included in the FreeCAD sources? The FreeBSD port appears to be doing so, but with the Heeksa/libarea and not with danielfalck/libarea which is referenced here.
Well this module is not used in FreeCAD itself, it’s made to be used by other modules, addons, platforms… That viewer was actually just an example, I think it should be reformed to use a quarter widget anyway… So yes, I think we can safely remove it
Only for information on Arch Linux soqt is requested as dependency by python-pivy.
I’ve found it when I’ve updated my Artix Linux distribution deleting all the dependencies on Arch Linux packages, so I’ve had to install all the packages that Artix Linux has not repackaged (Artix Linux is an Arch derivative without SystemD), in the process I’ve found that on Arch Linux these packages are needed to run FreeCAD but are not (yet, hopefully) packaged for Artix Linux: