2019-08-04 22:43:32 +02:00
|
|
|
{ lib, callPackage, fetchgit, cmake, jq, python3Packages, qtbase, qtquickcontrols2 }:
|
2015-08-31 22:42:05 +02:00
|
|
|
|
|
|
|
let
|
2019-05-06 01:31:51 +02:00
|
|
|
# admittedly, we're using (printer firmware) blobs when we could compile them ourselves.
|
|
|
|
curaBinaryDataVersion = "3.6.18"; # Marlin v2.0.0.144. Keep this accurate wrt. the below.
|
|
|
|
curaBinaryData = fetchgit {
|
|
|
|
url = https://code.alephobjects.com/diffusion/CBD/cura-binary-data.git;
|
|
|
|
rev = "cdc046494bbfe1f65bfb34659a257eef9a0100a0";
|
|
|
|
sha256 = "0v0s036gxdjiglas2yzw95alv60sw3pq5k1zrrhmw9mxr4irrblb";
|
|
|
|
};
|
2019-08-04 22:43:32 +02:00
|
|
|
|
|
|
|
libarcusLulzbot = callPackage ./libarcus.nix {
|
|
|
|
inherit (python3Packages) buildPythonPackage sip pythonOlder;
|
|
|
|
};
|
|
|
|
libsavitarLulzbot = callPackage ./libsavitar.nix {
|
|
|
|
inherit (python3Packages) buildPythonPackage sip pythonOlder;
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit (python3Packages) buildPythonPackage pyqt5 numpy scipy shapely pythonOlder;
|
|
|
|
curaengine = callPackage ./curaengine.nix {
|
|
|
|
inherit libarcusLulzbot;
|
|
|
|
};
|
|
|
|
uraniumLulzbot = callPackage ./uranium.nix {
|
|
|
|
inherit callPackage libarcusLulzbot;
|
|
|
|
inherit (python3Packages) buildPythonPackage pyqt5 numpy scipy shapely pythonOlder;
|
|
|
|
};
|
2015-08-31 22:42:05 +02:00
|
|
|
in
|
2019-05-06 01:31:51 +02:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2018-05-28 14:59:57 +02:00
|
|
|
name = "cura-lulzbot-${version}";
|
2019-05-06 01:31:51 +02:00
|
|
|
version = "3.6.18";
|
2015-08-31 22:42:05 +02:00
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
src = fetchgit {
|
|
|
|
url = https://code.alephobjects.com/source/cura-lulzbot.git;
|
|
|
|
rev = "71f1ac5a2b9f535175a3858a565930348358a9ca";
|
|
|
|
sha256 = "0by06fpxvdgy858lwhsccbmvkdq67j2s1cz8v6jnrnjrsxk7vzka";
|
|
|
|
};
|
2015-08-31 22:42:05 +02:00
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
format = "other"; # using cmake to build
|
|
|
|
buildInputs = [ qtbase qtquickcontrols2 ];
|
|
|
|
# numpy-stl temporarily disabled due to https://code.alephobjects.com/T8415
|
2019-08-04 22:43:32 +02:00
|
|
|
propagatedBuildInputs = with python3Packages; [ pyserial requests zeroconf ] ++ [ libsavitarLulzbot uraniumLulzbot libarcusLulzbot ]; # numpy-stl
|
2019-05-06 01:31:51 +02:00
|
|
|
nativeBuildInputs = [ cmake python3Packages.wrapPython ];
|
2015-08-31 22:42:05 +02:00
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
cmakeFlags = [
|
2019-08-04 22:43:32 +02:00
|
|
|
"-DURANIUM_DIR=${uraniumLulzbot.src}"
|
2019-05-06 01:31:51 +02:00
|
|
|
"-DCURA_VERSION=${version}"
|
|
|
|
];
|
2015-08-31 22:42:05 +02:00
|
|
|
|
2019-05-06 01:31:51 +02: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
|
2015-08-31 22:42:05 +02:00
|
|
|
'';
|
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
preFixup = ''
|
|
|
|
substituteInPlace "$out/bin/cura-lulzbot" --replace 'import cura.CuraApplication' 'import Savitar; import cura.CuraApplication'
|
|
|
|
ln -sT "${curaBinaryData}/cura/resources/firmware" "$out/share/cura/resources/firmware"
|
2019-08-04 22:43:32 +02:00
|
|
|
ln -sT "${uraniumLulzbot}/share/uranium" "$out/share/uranium"
|
2019-05-06 01:31:51 +02:00
|
|
|
${jq}/bin/jq --arg out "$out" '.build=$out' >"$out/version.json" <<'EOF'
|
|
|
|
${builtins.toJSON {
|
|
|
|
cura = version;
|
|
|
|
cura_version = version;
|
|
|
|
binarydata = curaBinaryDataVersion;
|
|
|
|
engine = curaengine.version;
|
2019-08-04 22:43:32 +02:00
|
|
|
libarcus = libarcusLulzbot.version;
|
|
|
|
libsavitar = libsavitarLulzbot.version;
|
|
|
|
uranium = uraniumLulzbot.version;
|
2019-05-06 01:31:51 +02:00
|
|
|
}}
|
|
|
|
EOF
|
|
|
|
'';
|
2015-08-31 22:42:05 +02:00
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "3D printer / slicing GUI built on top of the Uranium framework";
|
|
|
|
homepage = https://code.alephobjects.com/diffusion/CURA/;
|
|
|
|
license = licenses.agpl3; # a partial relicense to LGPL has happened, but not certain that all AGPL bits are expunged
|
2015-08-31 22:42:05 +02:00
|
|
|
platforms = platforms.linux;
|
2019-05-06 01:31:51 +02:00
|
|
|
maintainers = with maintainers; [ chaduffy ];
|
2015-08-31 22:42:05 +02:00
|
|
|
};
|
|
|
|
}
|