2019-09-26 06:13:19 +02:00
|
|
|
{ lib, mkDerivation, wrapQtAppsHook, callPackage, fetchgit, cmake, jq, python3, 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.
|
2019-10-13 22:32:33 +02:00
|
|
|
curaBinaryDataVersion = "3.6.21"; # Marlin v2.0.0.174 for Bio, v2.0.0.144 for others.
|
2019-05-06 01:31:51 +02:00
|
|
|
curaBinaryData = fetchgit {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "https://code.alephobjects.com/diffusion/CBD/cura-binary-data.git";
|
2019-10-13 22:32:33 +02:00
|
|
|
rev = "5c75d0f6c10d8b7a903e2072a48cd1f08059509e";
|
|
|
|
sha256 = "1qdsj6rczwzdwzyr7nz7fnypbphckjrnwl8c9dr6izsxyzs465c4";
|
2019-05-06 01:31:51 +02:00
|
|
|
};
|
2019-08-04 22:43:32 +02:00
|
|
|
|
|
|
|
libarcusLulzbot = callPackage ./libarcus.nix {
|
2021-05-03 13:43:20 +02:00
|
|
|
inherit (python3.pkgs) buildPythonPackage sip_4 pythonOlder;
|
2019-08-04 22:43:32 +02:00
|
|
|
};
|
|
|
|
libsavitarLulzbot = callPackage ./libsavitar.nix {
|
2021-05-03 13:43:20 +02:00
|
|
|
inherit (python3.pkgs) buildPythonPackage sip_4 pythonOlder;
|
2019-08-04 22:43:32 +02:00
|
|
|
};
|
|
|
|
|
2019-09-26 06:13:19 +02:00
|
|
|
inherit (python3.pkgs) buildPythonPackage pyqt5 numpy scipy shapely pythonOlder;
|
2019-08-04 22:43:32 +02:00
|
|
|
curaengine = callPackage ./curaengine.nix {
|
|
|
|
inherit libarcusLulzbot;
|
|
|
|
};
|
|
|
|
uraniumLulzbot = callPackage ./uranium.nix {
|
|
|
|
inherit callPackage libarcusLulzbot;
|
2019-09-26 06:13:19 +02:00
|
|
|
inherit (python3.pkgs) buildPythonPackage pyqt5 numpy scipy shapely pythonOlder;
|
2019-08-04 22:43:32 +02:00
|
|
|
};
|
2015-08-31 22:42:05 +02:00
|
|
|
in
|
2019-09-26 06:13:19 +02:00
|
|
|
mkDerivation rec {
|
|
|
|
pname = "cura-lulzbot";
|
2019-10-13 22:32:33 +02:00
|
|
|
version = "3.6.21";
|
2015-08-31 22:42:05 +02:00
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
src = fetchgit {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "https://code.alephobjects.com/source/cura-lulzbot.git";
|
2019-10-13 22:32:33 +02:00
|
|
|
rev = "7faeb18604c83004846a02c60cb240708db0034f";
|
|
|
|
sha256 = "10q38s8c8x6xkh1vns4p3iqa5y267vrjh5vq8h55mg1q5001scyq";
|
2019-05-06 01:31:51 +02:00
|
|
|
};
|
2015-08-31 22:42:05 +02:00
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
buildInputs = [ qtbase qtquickcontrols2 ];
|
|
|
|
# numpy-stl temporarily disabled due to https://code.alephobjects.com/T8415
|
2019-09-26 06:13:19 +02:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [ pyserial requests zeroconf ] ++ [ libsavitarLulzbot uraniumLulzbot libarcusLulzbot ]; # numpy-stl
|
|
|
|
nativeBuildInputs = [ cmake python3.pkgs.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-09-26 06:13:19 +02:00
|
|
|
postFixup = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
wrapQtApp "$out/bin/cura-lulzbot"
|
|
|
|
'';
|
|
|
|
|
2019-05-06 01:31:51 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "3D printer / slicing GUI built on top of the Uranium framework";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://code.alephobjects.com/diffusion/CURA/";
|
2019-05-06 01:31:51 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|