]> Git — Sourcephile - julm/julm-nix.git/blob - nixpkgs/pkgs/freecad.nix
bash: add riseup alias
[julm/julm-nix.git] / nixpkgs / pkgs / freecad.nix
1 { lib
2 , stdenv
3 , mkDerivation
4 , fetchFromGitHub
5 , fetchpatch
6 , cmake
7 , ninja
8 , GitPython
9 , boost
10 , coin3d
11 , eigen
12 , gfortran
13 , gts
14 , hdf5
15 , libGLU
16 , libXmu
17 , libf2c
18 , libspnav
19 , matplotlib
20 , medfile
21 , mpi
22 , ode
23 , opencascade-occt
24 , pivy
25 , pkg-config
26 , pycollada
27 , pyside2
28 , pyside2-tools
29 , python
30 , pyyaml
31 , qtbase
32 , qttools
33 , qtwebengine
34 , qtx11extras
35 , qtxmlpatterns
36 , scipy
37 , shiboken2
38 , soqt
39 , spaceNavSupport ? stdenv.isLinux
40 , swig
41 , vtk
42 , wrapQtAppsHook
43 , xercesc
44 , zlib
45 }:
46
47 mkDerivation rec {
48 pname = "freecad";
49 version = "0.19.1";
50
51 src = fetchFromGitHub {
52 owner = "FreeCAD";
53 repo = "FreeCAD";
54 rev = version;
55 hash = "sha256-itIrO+/mKXOPNs+2POKT8u4YZuqx/QAwVBWrHgKP1qQ=";
56 };
57
58 nativeBuildInputs = [
59 cmake
60 ninja
61 pkg-config
62 pyside2-tools
63 wrapQtAppsHook
64 ];
65
66 buildInputs = [
67 GitPython # for addon manager
68 boost
69 coin3d
70 eigen
71 gfortran
72 gts
73 hdf5
74 libGLU
75 libXmu
76 libf2c
77 matplotlib
78 medfile
79 mpi
80 ode
81 opencascade-occt
82 pivy
83 pycollada
84 pyside2
85 pyside2-tools
86 python
87 pyyaml # (at least for) PyrateWorkbench
88 qtbase
89 qttools
90 qtwebengine
91 qtxmlpatterns
92 scipy
93 shiboken2
94 soqt
95 swig
96 vtk
97 xercesc
98 zlib
99 ] ++ lib.optionals spaceNavSupport [
100 libspnav
101 qtx11extras
102 ];
103
104 cmakeFlags = [
105 "-DBUILD_FLAT_MESH:BOOL=ON"
106 "-DBUILD_QT5=ON"
107 "-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
108 "-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
109 ("-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
110 + ";${pyside2}/include/PySide2/QtCore"
111 + ";${pyside2}/include/PySide2/QtWidgets"
112 + ";${pyside2}/include/PySide2/QtGui"
113 )
114 "-DPYSIDE_LIBRARY=PySide2::pyside2"
115 ];
116
117 # This should work on both x86_64, and i686 linux
118 preBuild = ''
119 export NIX_LDFLAGS="-L${gfortran.cc}/lib64 -L${gfortran.cc}/lib $NIX_LDFLAGS";
120 '';
121
122 # Their main() removes PYTHONPATH=, and we rely on it.
123 preConfigure = ''
124 sed '/putenv("PYTHONPATH/d' -i src/Main/MainGui.cpp
125
126 qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
127 '';
128
129 qtWrapperArgs = [
130 "--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
131 ];
132
133 postFixup = ''
134 mv $out/share/doc $out
135 ln -s $out/bin/FreeCAD $out/bin/freecad
136 ln -s $out/bin/FreeCADCmd $out/bin/freecadcmd
137 '';
138
139 meta = with lib; {
140 homepage = "https://www.freecadweb.org/";
141 description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
142 longDescription = ''
143 FreeCAD is an open-source parametric 3D modeler made primarily to design
144 real-life objects of any size. Parametric modeling allows you to easily
145 modify your design by going back into your model history and changing its
146 parameters.
147
148 FreeCAD allows you to sketch geometry constrained 2D shapes and use them
149 as a base to build other objects. It contains many components to adjust
150 dimensions or extract design details from 3D models to create high quality
151 production ready drawings.
152
153 FreeCAD is designed to fit a wide range of uses including product design,
154 mechanical engineering and architecture. Whether you are a hobbyist, a
155 programmer, an experienced CAD user, a student or a teacher, you will feel
156 right at home with FreeCAD.
157 '';
158 license = licenses.lgpl2Plus;
159 maintainers = with maintainers; [ viric gebner AndersonTorres ];
160 platforms = platforms.linux;
161 };
162 }