2021-03-19 17:17:44 +00:00
|
|
|
{ lib
|
2023-10-09 19:29:22 +00:00
|
|
|
, fmt
|
2021-04-05 15:23:46 +00:00
|
|
|
, stdenv
|
2021-03-19 17:17:44 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2023-10-09 19:29:22 +00:00
|
|
|
, doxygen
|
2021-03-19 17:17:44 +00:00
|
|
|
, ninja
|
2022-12-17 10:02:37 +00:00
|
|
|
, gitpython
|
2021-03-19 17:17:44 +00:00
|
|
|
, boost
|
|
|
|
, coin3d
|
|
|
|
, eigen
|
|
|
|
, gfortran
|
|
|
|
, gts
|
|
|
|
, hdf5
|
|
|
|
, libGLU
|
|
|
|
, libXmu
|
|
|
|
, libf2c
|
2021-09-18 10:52:07 +00:00
|
|
|
, libredwg
|
2021-03-19 17:17:44 +00:00
|
|
|
, libspnav
|
|
|
|
, matplotlib
|
|
|
|
, medfile
|
|
|
|
, mpi
|
|
|
|
, ode
|
|
|
|
, opencascade-occt
|
|
|
|
, pivy
|
|
|
|
, pkg-config
|
2021-05-28 09:39:13 +00:00
|
|
|
, ply
|
2021-03-19 17:17:44 +00:00
|
|
|
, pycollada
|
|
|
|
, pyside2
|
|
|
|
, pyside2-tools
|
|
|
|
, python
|
|
|
|
, pyyaml
|
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, qtwebengine
|
|
|
|
, qtx11extras
|
|
|
|
, qtxmlpatterns
|
|
|
|
, scipy
|
|
|
|
, shiboken2
|
|
|
|
, soqt
|
2021-04-05 15:23:46 +00:00
|
|
|
, spaceNavSupport ? stdenv.isLinux
|
2021-03-19 17:17:44 +00:00
|
|
|
, swig
|
2023-04-29 16:46:19 +00:00
|
|
|
, vtk
|
2021-03-19 17:17:44 +00:00
|
|
|
, wrapQtAppsHook
|
2022-07-14 12:49:19 +00:00
|
|
|
, wrapGAppsHook
|
2021-03-19 17:17:44 +00:00
|
|
|
, xercesc
|
|
|
|
, zlib
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-03-19 17:17:44 +00:00
|
|
|
pname = "freecad";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.21.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FreeCAD";
|
|
|
|
repo = "FreeCAD";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = finalAttrs.version;
|
|
|
|
hash = "sha256-rwt81Z+Bp8uZlR4iuGQEDKBu/Dr9Rqg7d9SsCdofTUU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2021-03-19 17:17:44 +00:00
|
|
|
pyside2-tools
|
2021-09-26 12:46:18 +00:00
|
|
|
gfortran
|
2020-06-18 07:06:33 +00:00
|
|
|
wrapQtAppsHook
|
2022-07-14 12:49:19 +00:00
|
|
|
wrapGAppsHook
|
2020-06-18 07:06:33 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-12-17 10:02:37 +00:00
|
|
|
gitpython # for addon manager
|
2021-03-19 17:17:44 +00:00
|
|
|
boost
|
|
|
|
coin3d
|
2023-10-09 19:29:22 +00:00
|
|
|
doxygen
|
2021-03-19 17:17:44 +00:00
|
|
|
eigen
|
2023-10-09 19:29:22 +00:00
|
|
|
fmt
|
2021-03-19 17:17:44 +00:00
|
|
|
gts
|
|
|
|
hdf5
|
|
|
|
libGLU
|
|
|
|
libXmu
|
|
|
|
libf2c
|
|
|
|
matplotlib
|
|
|
|
medfile
|
|
|
|
mpi
|
|
|
|
ode
|
|
|
|
opencascade-occt
|
|
|
|
pivy
|
2021-05-28 09:39:13 +00:00
|
|
|
ply # for openSCAD file support
|
2021-03-19 17:17:44 +00:00
|
|
|
pycollada
|
|
|
|
pyside2
|
|
|
|
pyside2-tools
|
|
|
|
python
|
|
|
|
pyyaml # (at least for) PyrateWorkbench
|
|
|
|
qtbase
|
|
|
|
qttools
|
|
|
|
qtwebengine
|
|
|
|
qtxmlpatterns
|
|
|
|
scipy
|
|
|
|
shiboken2
|
|
|
|
soqt
|
|
|
|
swig
|
2023-04-29 16:46:19 +00:00
|
|
|
vtk
|
2021-03-19 17:17:44 +00:00
|
|
|
xercesc
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals spaceNavSupport [
|
|
|
|
libspnav
|
|
|
|
qtx11extras
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2021-05-20 23:08:51 +00:00
|
|
|
"-Wno-dev" # turns off warnings which otherwise makes it hard to see what is going on
|
2021-03-19 17:17:44 +00:00
|
|
|
"-DBUILD_FLAT_MESH:BOOL=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DBUILD_QT5=ON"
|
2021-03-19 17:17:44 +00:00
|
|
|
"-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
|
2021-03-19 17:17:44 +00:00
|
|
|
("-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
|
|
|
|
+ ";${pyside2}/include/PySide2/QtCore"
|
|
|
|
+ ";${pyside2}/include/PySide2/QtWidgets"
|
|
|
|
+ ";${pyside2}/include/PySide2/QtGui"
|
2021-05-20 23:08:51 +00:00
|
|
|
)
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DPYSIDE_LIBRARY=PySide2::pyside2"
|
|
|
|
];
|
|
|
|
|
|
|
|
# This should work on both x86_64, and i686 linux
|
|
|
|
preBuild = ''
|
|
|
|
export NIX_LDFLAGS="-L${gfortran.cc}/lib64 -L${gfortran.cc}/lib $NIX_LDFLAGS";
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Their main() removes PYTHONPATH=, and we rely on it.
|
|
|
|
preConfigure = ''
|
|
|
|
sed '/putenv("PYTHONPATH/d' -i src/Main/MainGui.cpp
|
|
|
|
|
|
|
|
qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
|
|
|
|
'';
|
|
|
|
|
|
|
|
qtWrapperArgs = [
|
|
|
|
"--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
|
2021-09-18 10:52:07 +00:00
|
|
|
"--prefix PATH : ${libredwg}/bin"
|
2023-04-12 12:48:02 +00:00
|
|
|
"--set QT_QPA_PLATFORM xcb"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
mv $out/share/doc $out
|
2021-03-19 17:17:44 +00:00
|
|
|
ln -s $out/bin/FreeCAD $out/bin/freecad
|
|
|
|
ln -s $out/bin/FreeCADCmd $out/bin/freecadcmd
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://www.freecad.org";
|
2021-03-19 17:17:44 +00:00
|
|
|
description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
|
|
|
|
longDescription = ''
|
|
|
|
FreeCAD is an open-source parametric 3D modeler made primarily to design
|
|
|
|
real-life objects of any size. Parametric modeling allows you to easily
|
|
|
|
modify your design by going back into your model history and changing its
|
|
|
|
parameters.
|
|
|
|
|
|
|
|
FreeCAD allows you to sketch geometry constrained 2D shapes and use them
|
|
|
|
as a base to build other objects. It contains many components to adjust
|
|
|
|
dimensions or extract design details from 3D models to create high quality
|
|
|
|
production ready drawings.
|
|
|
|
|
|
|
|
FreeCAD is designed to fit a wide range of uses including product design,
|
|
|
|
mechanical engineering and architecture. Whether you are a hobbyist, a
|
|
|
|
programmer, an experienced CAD user, a student or a teacher, you will feel
|
|
|
|
right at home with FreeCAD.
|
|
|
|
'';
|
2023-10-09 19:29:22 +00:00
|
|
|
license = lib.licenses.lgpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ viric gebner AndersonTorres ];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|