2019-04-08 12:31:47 +03:00
|
|
|
{ mkDerivation, lib, fetchFromGitHub, cmake, python3, qtbase, qtquickcontrols2, qtgraphicaleffects, curaengine, plugins ? [] }:
|
2017-02-26 01:05:04 +03:00
|
|
|
|
2017-05-17 22:26:11 +03:00
|
|
|
mkDerivation rec {
|
2019-08-08 10:00:41 +03:00
|
|
|
pname = "cura";
|
2020-09-06 14:32:19 +03:00
|
|
|
version = "4.7.1";
|
2014-03-26 02:17:17 +04:00
|
|
|
|
2017-02-26 01:05:04 +03:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Ultimaker";
|
|
|
|
repo = "Cura";
|
2020-03-10 01:45:37 +03:00
|
|
|
rev = version;
|
2020-09-06 14:32:19 +03:00
|
|
|
sha256 = "19an168iad3cb5w8i71c0wbr79qnz5qnpxqx1j6dgh64qz6ffn2r";
|
2014-03-26 02:17:17 +04:00
|
|
|
};
|
|
|
|
|
2018-05-15 11:48:56 +03:00
|
|
|
materials = fetchFromGitHub {
|
|
|
|
owner = "Ultimaker";
|
|
|
|
repo = "fdm_materials";
|
2019-09-25 23:52:03 +03:00
|
|
|
rev = version;
|
2020-09-06 14:32:19 +03:00
|
|
|
sha256 = "1w6i0dlff8b30q987x3y0zv8847fc8ppfcr9vi982msmv284c89z";
|
2018-05-15 11:48:56 +03:00
|
|
|
};
|
|
|
|
|
2019-04-04 10:52:38 +03:00
|
|
|
buildInputs = [ qtbase qtquickcontrols2 qtgraphicaleffects ];
|
2018-12-27 05:20:25 +03:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
libsavitar numpy-stl pyserial requests uranium zeroconf
|
2020-05-10 20:03:40 +03:00
|
|
|
sentry-sdk trimesh
|
2019-04-08 12:31:47 +03:00
|
|
|
] ++ plugins;
|
2017-05-17 22:26:11 +03:00
|
|
|
nativeBuildInputs = [ cmake python3.pkgs.wrapPython ];
|
2014-03-26 02:17:17 +04:00
|
|
|
|
2018-06-07 12:56:12 +03:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DURANIUM_DIR=${python3.pkgs.uranium.src}"
|
|
|
|
"-DCURA_VERSION=${version}"
|
|
|
|
];
|
2014-03-26 02:17:17 +04:00
|
|
|
|
2019-08-08 10:01:10 +03:00
|
|
|
makeWrapperArgs = [
|
|
|
|
# hacky workaround for https://github.com/NixOS/nixpkgs/issues/59901
|
|
|
|
"--set OMP_NUM_THREADS 1"
|
|
|
|
];
|
|
|
|
|
2017-02-26 01:05:04 +03:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's,/python''${PYTHON_VERSION_MAJOR}/dist-packages,/python''${PYTHON_VERSION_MAJOR}.''${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
|
|
|
|
sed -i 's, executable_name = .*, executable_name = "${curaengine}/bin/CuraEngine",' plugins/CuraEngineBackend/CuraEngineBackend.py
|
|
|
|
'';
|
2014-03-26 02:17:17 +04:00
|
|
|
|
2018-05-15 11:48:56 +03:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/cura/resources/materials
|
|
|
|
cp ${materials}/*.fdm_material $out/share/cura/resources/materials/
|
2019-04-08 12:31:47 +03:00
|
|
|
mkdir -p $out/lib/cura/plugins
|
|
|
|
for plugin in ${toString plugins}; do
|
|
|
|
ln -s $plugin/lib/cura/plugins/* $out/lib/cura/plugins
|
|
|
|
done
|
2018-05-15 11:48:56 +03:00
|
|
|
'';
|
|
|
|
|
2017-02-26 01:05:04 +03:00
|
|
|
postFixup = ''
|
2014-03-26 02:17:17 +04:00
|
|
|
wrapPythonPrograms
|
2019-08-09 13:11:58 +03:00
|
|
|
wrapQtApp $out/bin/cura
|
2014-03-26 02:17:17 +04:00
|
|
|
'';
|
|
|
|
|
2017-05-17 22:26:11 +03:00
|
|
|
meta = with lib; {
|
2017-02-26 01:05:04 +03:00
|
|
|
description = "3D printer / slicing GUI built on top of the Uranium framework";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://github.com/Ultimaker/Cura";
|
2018-12-27 05:20:25 +03:00
|
|
|
license = licenses.lgpl3Plus;
|
2014-03-26 02:17:17 +04:00
|
|
|
platforms = platforms.linux;
|
2019-08-08 10:09:25 +03:00
|
|
|
maintainers = with maintainers; [ abbradar gebner ];
|
2014-03-26 02:17:17 +04:00
|
|
|
};
|
|
|
|
}
|