3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/cura/default.nix

58 lines
1.8 KiB
Nix
Raw Normal View History

{ mkDerivation, lib, fetchFromGitHub, cmake, python3, qtbase, qtquickcontrols2, qtgraphicaleffects, curaengine, plugins ? [] }:
2017-05-17 20:26:11 +01:00
mkDerivation rec {
2014-09-26 11:12:14 +01:00
name = "cura-${version}";
2019-06-01 10:20:09 +01:00
version = "4.1.0";
2014-03-25 22:17:17 +00:00
src = fetchFromGitHub {
owner = "Ultimaker";
repo = "Cura";
rev = version;
2019-06-01 10:20:09 +01:00
sha256 = "1mfpnjrh3splpkadgml3v71k939g56zb9hbmzghwfjwlrf8valmz";
2014-03-25 22:17:17 +00:00
};
2018-05-15 09:48:56 +01:00
materials = fetchFromGitHub {
owner = "Ultimaker";
repo = "fdm_materials";
2018-12-27 02:20:25 +00:00
rev = version;
2019-06-01 10:20:09 +01:00
sha256 = "0yp2162msxfwpixzvassn23p7r3swjpwk4nhsjka5w6fm8pv0wpl";
2018-05-15 09:48:56 +01:00
};
2019-04-04 08:52:38 +01:00
buildInputs = [ qtbase qtquickcontrols2 qtgraphicaleffects ];
2018-12-27 02:20:25 +00:00
propagatedBuildInputs = with python3.pkgs; [
libsavitar numpy-stl pyserial requests uranium zeroconf
] ++ plugins;
2017-05-17 20:26:11 +01:00
nativeBuildInputs = [ cmake python3.pkgs.wrapPython ];
2014-03-25 22:17:17 +00:00
2018-06-07 10:56:12 +01:00
cmakeFlags = [
"-DURANIUM_DIR=${python3.pkgs.uranium.src}"
"-DCURA_VERSION=${version}"
];
2014-03-25 22:17:17 +00: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-25 22:17:17 +00:00
2018-05-15 09:48:56 +01:00
postInstall = ''
mkdir -p $out/share/cura/resources/materials
cp ${materials}/*.fdm_material $out/share/cura/resources/materials/
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 09:48:56 +01:00
'';
postFixup = ''
2014-03-25 22:17:17 +00:00
wrapPythonPrograms
'';
2017-05-17 20:26:11 +01:00
meta = with lib; {
description = "3D printer / slicing GUI built on top of the Uranium framework";
homepage = https://github.com/Ultimaker/Cura;
2018-12-27 02:20:25 +00:00
license = licenses.lgpl3Plus;
2014-03-25 22:17:17 +00:00
platforms = platforms.linux;
maintainers = with maintainers; [ abbradar ];
2014-03-25 22:17:17 +00:00
};
}