nixpkgs/pkgs/applications/misc/cura/default.nix

52 lines
1.5 KiB
Nix
Raw Normal View History

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