2021-03-16 13:45:22 +01:00
|
|
|
{ lib
|
2021-04-02 16:07:34 +02:00
|
|
|
, stdenv
|
2021-03-16 13:45:22 +01:00
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, GitPython
|
|
|
|
, boost
|
|
|
|
, coin3d
|
|
|
|
, eigen
|
|
|
|
, gfortran
|
|
|
|
, gts
|
|
|
|
, hdf5
|
|
|
|
, libGLU
|
|
|
|
, libXmu
|
|
|
|
, libf2c
|
|
|
|
, libspnav
|
|
|
|
, matplotlib
|
|
|
|
, medfile
|
|
|
|
, mpi
|
|
|
|
, ode
|
|
|
|
, opencascade-occt
|
|
|
|
, pivy
|
|
|
|
, pkg-config
|
|
|
|
, pycollada
|
|
|
|
, pyside2
|
|
|
|
, pyside2-tools
|
|
|
|
, python
|
|
|
|
, pyyaml
|
|
|
|
, qtbase
|
|
|
|
, qttools
|
|
|
|
, qtwebengine
|
|
|
|
, qtx11extras
|
|
|
|
, qtxmlpatterns
|
|
|
|
, scipy
|
|
|
|
, shiboken2
|
|
|
|
, soqt
|
2021-04-02 16:07:34 +02:00
|
|
|
, spaceNavSupport ? stdenv.isLinux
|
2021-03-16 13:45:22 +01:00
|
|
|
, swig
|
|
|
|
, vtk
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, xercesc
|
|
|
|
, zlib
|
|
|
|
}:
|
2011-03-02 18:18:30 +01:00
|
|
|
|
2021-03-16 13:45:22 +01:00
|
|
|
mkDerivation rec {
|
|
|
|
pname = "freecad";
|
|
|
|
version = "0.19.1";
|
2011-03-02 18:18:30 +01:00
|
|
|
|
2019-11-03 14:14:35 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FreeCAD";
|
|
|
|
repo = "FreeCAD";
|
2021-03-16 13:45:22 +01:00
|
|
|
rev = version;
|
|
|
|
hash = "sha256-itIrO+/mKXOPNs+2POKT8u4YZuqx/QAwVBWrHgKP1qQ=";
|
2011-03-02 18:18:30 +01:00
|
|
|
};
|
|
|
|
|
2020-06-05 06:16:52 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
2021-01-19 07:50:56 +01:00
|
|
|
pkg-config
|
2021-03-16 13:45:22 +01:00
|
|
|
pyside2-tools
|
2020-06-05 06:16:52 +02:00
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-10-18 14:08:28 +02:00
|
|
|
GitPython # for addon manager
|
2021-03-16 13:45:22 +01:00
|
|
|
boost
|
|
|
|
coin3d
|
|
|
|
eigen
|
|
|
|
gfortran
|
|
|
|
gts
|
|
|
|
hdf5
|
|
|
|
libGLU
|
|
|
|
libXmu
|
|
|
|
libf2c
|
|
|
|
matplotlib
|
|
|
|
medfile
|
|
|
|
mpi
|
|
|
|
ode
|
|
|
|
opencascade-occt
|
|
|
|
pivy
|
|
|
|
pycollada
|
|
|
|
pyside2
|
|
|
|
pyside2-tools
|
|
|
|
python
|
|
|
|
pyyaml # (at least for) PyrateWorkbench
|
|
|
|
qtbase
|
|
|
|
qttools
|
|
|
|
qtwebengine
|
|
|
|
qtxmlpatterns
|
|
|
|
scipy
|
|
|
|
shiboken2
|
|
|
|
soqt
|
|
|
|
swig
|
|
|
|
vtk
|
|
|
|
xercesc
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals spaceNavSupport [
|
|
|
|
libspnav
|
|
|
|
qtx11extras
|
|
|
|
];
|
2018-06-23 11:02:23 +02:00
|
|
|
|
2019-06-15 18:44:59 +02:00
|
|
|
cmakeFlags = [
|
2021-03-18 22:04:13 +01:00
|
|
|
"-DBUILD_FLAT_MESH:BOOL=ON"
|
2019-06-15 18:44:59 +02:00
|
|
|
"-DBUILD_QT5=ON"
|
2021-03-16 13:45:22 +01:00
|
|
|
"-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
|
2019-06-15 18:44:59 +02:00
|
|
|
"-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
|
2021-03-16 13:45:22 +01:00
|
|
|
("-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
|
|
|
|
+ ";${pyside2}/include/PySide2/QtCore"
|
|
|
|
+ ";${pyside2}/include/PySide2/QtWidgets"
|
|
|
|
+ ";${pyside2}/include/PySide2/QtGui"
|
2019-06-15 18:44:59 +02:00
|
|
|
)
|
|
|
|
"-DPYSIDE_LIBRARY=PySide2::pyside2"
|
|
|
|
];
|
2011-03-02 18:18:30 +01:00
|
|
|
|
2011-03-05 23:27:55 +01:00
|
|
|
# This should work on both x86_64, and i686 linux
|
2011-03-04 10:48:33 +01:00
|
|
|
preBuild = ''
|
2015-01-15 05:59:10 +01:00
|
|
|
export NIX_LDFLAGS="-L${gfortran.cc}/lib64 -L${gfortran.cc}/lib $NIX_LDFLAGS";
|
2011-03-04 10:48:33 +01:00
|
|
|
'';
|
|
|
|
|
2015-11-18 14:58:54 +01:00
|
|
|
# Their main() removes PYTHONPATH=, and we rely on it.
|
|
|
|
preConfigure = ''
|
|
|
|
sed '/putenv("PYTHONPATH/d' -i src/Main/MainGui.cpp
|
|
|
|
|
2019-08-09 13:39:10 +02:00
|
|
|
qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
|
2011-03-05 23:27:51 +01:00
|
|
|
'';
|
2019-06-02 01:00:48 +02:00
|
|
|
|
2019-08-09 13:39:10 +02:00
|
|
|
qtWrapperArgs = [
|
|
|
|
"--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
|
|
|
|
];
|
|
|
|
|
2019-06-02 01:00:48 +02:00
|
|
|
postFixup = ''
|
|
|
|
mv $out/share/doc $out
|
2021-03-18 21:54:35 +01:00
|
|
|
ln -s $out/bin/FreeCAD $out/bin/freecad
|
|
|
|
ln -s $out/bin/FreeCADCmd $out/bin/freecadcmd
|
2019-06-02 01:00:48 +02:00
|
|
|
'';
|
2019-06-15 18:44:59 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-08-09 13:39:10 +02:00
|
|
|
homepage = "https://www.freecadweb.org/";
|
2021-03-16 13:45:22 +01: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.
|
|
|
|
'';
|
2014-08-03 12:02:27 +02:00
|
|
|
license = licenses.lgpl2Plus;
|
2021-03-16 13:45:22 +01:00
|
|
|
maintainers = with maintainers; [ viric gebner AndersonTorres ];
|
2014-08-03 12:02:27 +02:00
|
|
|
platforms = platforms.linux;
|
2011-03-03 14:41:10 +01:00
|
|
|
};
|
2011-03-02 18:18:30 +01:00
|
|
|
}
|