nixpkgs/pkgs/by-name/fr/freecad/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

198 lines
4.6 KiB
Nix
Raw Normal View History

2021-03-16 12:45:22 +00:00
{ lib
, cmake
, coin3d
, doxygen
2021-03-16 12:45:22 +00:00
, eigen
, fetchFromGitHub
, fmt
, freecad # for passthru.tests
2021-03-16 12:45:22 +00:00
, gfortran
, gts
, hdf5
, libGLU
, libXmu
, libf2c
, libredwg
, libsForQt5
2021-03-16 12:45:22 +00:00
, libspnav
, medfile
, mpi
, ninja
2021-03-16 12:45:22 +00:00
, ode
, opencascade-occt_7_6
2021-03-16 12:45:22 +00:00
, pkg-config
, python3Packages
, runCommand # for passthru.tests
2021-04-02 14:07:34 +00:00
, spaceNavSupport ? stdenv.isLinux
, stdenv
2021-03-16 12:45:22 +00:00
, swig
2023-04-26 05:08:48 +00:00
, vtk
, wrapGAppsHook3
2021-03-16 12:45:22 +00:00
, xercesc
, zlib
}:
let
opencascade-occt = opencascade-occt_7_6;
boost = python3Packages.boost;
inherit (libsForQt5)
qtbase
qttools
qtwebengine
qtx11extras
qtxmlpatterns
soqt
wrapQtAppsHook;
inherit (python3Packages)
gitpython
matplotlib
pivy
ply
pycollada
pyside2
pyside2-tools
python
pyyaml
scipy
shiboken2;
in
2023-09-01 03:11:09 +00:00
stdenv.mkDerivation (finalAttrs: {
2021-03-16 12:45:22 +00:00
pname = "freecad";
2023-11-14 08:58:28 +00:00
version = "0.21.2";
2019-11-03 13:14:35 +00:00
src = fetchFromGitHub {
owner = "FreeCAD";
repo = "FreeCAD";
2023-09-01 03:11:09 +00:00
rev = finalAttrs.version;
2023-11-14 08:58:28 +00:00
hash = "sha256-OX4s9rbGsAhH7tLJkUJYyq2A2vCdkq/73iqYo9adogs=";
};
2020-06-05 04:16:52 +00:00
nativeBuildInputs = [
cmake
ninja
pkg-config
2021-03-16 12:45:22 +00:00
pyside2-tools
gfortran
2020-06-05 04:16:52 +00:00
wrapQtAppsHook
wrapGAppsHook3
2020-06-05 04:16:52 +00:00
];
buildInputs = [
2022-12-05 19:48:36 +00:00
gitpython # for addon manager
2021-03-16 12:45:22 +00:00
boost
coin3d
2023-08-23 10:52:44 +00:00
doxygen
2021-03-16 12:45:22 +00:00
eigen
2023-08-23 10:52:44 +00:00
fmt
2021-03-16 12:45:22 +00:00
gts
hdf5
libGLU
libXmu
libf2c
matplotlib
medfile
mpi
ode
opencascade-occt
pivy
2021-05-22 03:07:55 +00:00
ply # for openSCAD file support
2021-03-16 12:45:22 +00:00
pycollada
pyside2
pyside2-tools
python
pyyaml # (at least for) PyrateWorkbench
qtbase
qttools
qtwebengine
qtxmlpatterns
scipy
shiboken2
soqt
swig
2023-04-26 05:08:48 +00:00
vtk
2021-03-16 12:45:22 +00:00
xercesc
zlib
] ++ lib.optionals spaceNavSupport [
libspnav
qtx11extras
];
2018-06-23 09:02:23 +00:00
patches = [
./0001-NIXOS-don-t-ignore-PYTHONPATH.patch
];
2019-06-15 16:44:59 +00:00
cmakeFlags = [
2021-05-10 06:46:37 +00:00
"-Wno-dev" # turns off warnings which otherwise makes it hard to see what is going on
"-DBUILD_FLAT_MESH:BOOL=ON"
2019-06-15 16:44:59 +00:00
"-DBUILD_QT5=ON"
2021-03-16 12:45:22 +00:00
"-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
2019-06-15 16:44:59 +00:00
"-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
2021-03-16 12:45:22 +00:00
("-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
+ ";${pyside2}/include/PySide2/QtCore"
+ ";${pyside2}/include/PySide2/QtWidgets"
+ ";${pyside2}/include/PySide2/QtGui"
2021-05-10 06:46:37 +00:00
)
2019-06-15 16:44:59 +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";
'';
preConfigure = ''
2019-08-09 11:39:10 +00:00
qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
'';
2019-08-09 11:39:10 +00:00
qtWrapperArgs = [
"--set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1"
"--prefix PATH : ${libredwg}/bin"
"--set QT_QPA_PLATFORM xcb"
2019-08-09 11:39:10 +00:00
];
postFixup = ''
mv $out/share/doc $out
ln -s $out/bin/FreeCAD $out/bin/freecad
ln -s $out/bin/FreeCADCmd $out/bin/freecadcmd
'';
2019-06-15 16:44:59 +00:00
passthru.tests = {
# Check that things such as argument parsing still work correctly with
# the above PYTHONPATH patch. Previously the patch used above changed
# the `PyConfig_InitIsolatedConfig` to `PyConfig_InitPythonConfig`,
# which caused the built-in interpreter to attempt (and fail) to doubly
# parse argv. This should catch if that ever regresses and also ensures
# that PYTHONPATH is still respected enough for the FreeCAD console to
# successfully run and check that it was included in `sys.path`.
python-path = runCommand "freecad-test-console" {
nativeBuildInputs = [ freecad ];
} ''
HOME="$(mktemp -d)" PYTHONPATH="$(pwd)/test" FreeCADCmd --log-file $out -c "if not '$(pwd)/test' in sys.path: sys.exit(1)" </dev/null
'';
};
2023-09-01 03:11:09 +00:00
meta = {
2023-08-23 10:52:44 +00:00
homepage = "https://www.freecad.org";
2021-03-16 12:45:22 +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-09-01 03:11:09 +00:00
license = lib.licenses.lgpl2Plus;
maintainers = with lib.maintainers; [ viric gebner AndersonTorres ];
platforms = lib.platforms.linux;
};
2023-09-01 03:11:09 +00:00
})