git.iko.soy/typeable/nixpkgs
on master help sign in
curaLulzbot: 15.02.1-1.03-5064 -> 3.6.18

Move Cura Lulzbot Edition to be based on the same generation of the codebase as the upstream (Ultimaker) branch, away from a many-year-old legacy tree. Since prior Lulzbot Edition packaging simply wrapped binaries unpacked from Debian binary packages, doing this right requires forking the same dependencies that Lulzbot has branched themselves as well.

commit0ca75bc294d38a420f67307b6de6ac1fd5d93620 authorCharles Duffy <charles@dyfis.net> dateSun 5 May 2019, 18:31 (8 years ago) parent86c1103
8 files changed+208−48
pkgs/applications/misc/cura/lulzbot.nix+52−44 pkgs/applications/misc/curaengine/lulzbot.nix+26 pkgs/development/python-modules/libarcus/lulzbot.nix+33 pkgs/development/python-modules/libsavitar/lulzbot.nix+33 pkgs/development/python-modules/uranium/lulzbot.nix+41 pkgs/development/python-modules/uranium/qt512-support.patch+16 pkgs/top-level/all-packages.nix+4−4 pkgs/top-level/python-packages.nix+3
pkgs/applications/misc/cura/lulzbot.nix+52−44
@@ -1,58 +1,66 @@
1−{ stdenv, fetchurl, dpkg, bash, python27Packages }:
1+{ lib, fetchgit, curaengineLulzbot, cmake, jq, python3Packages, qtbase, qtquickcontrols2 }:
22
33let
4− py = python27Packages;
4+ # admittedly, we're using (printer firmware) blobs when we could compile them ourselves.
5+ curaBinaryDataVersion = "3.6.18"; # Marlin v2.0.0.144. Keep this accurate wrt. the below.
6+ curaBinaryData = fetchgit {
7+ url = https://code.alephobjects.com/diffusion/CBD/cura-binary-data.git;
8+ rev = "cdc046494bbfe1f65bfb34659a257eef9a0100a0";
9+ sha256 = "0v0s036gxdjiglas2yzw95alv60sw3pq5k1zrrhmw9mxr4irrblb";
10+ };
11+ curaengine = curaengineLulzbot;
12+ libarcus = python3Packages.libarcusLulzbot;
13+ uranium = python3Packages.uraniumLulzbot;
14+ libsavitar = python3Packages.libsavitarLulzbot;
515in
6−stdenv.mkDerivation rec {
16+python3Packages.buildPythonApplication rec {
717 name = "cura-lulzbot-${version}";
8− version = "15.02.1-1.03-5064";
9−
10− src =
11− if stdenv.hostPlatform.system == "x86_64-linux" then
12− fetchurl {
13− url = "https://download.alephobjects.com/ao/aodeb/dists/jessie/main/binary-amd64/cura_${version}_amd64.deb";
14− sha256 = "1gsfidg3gim5pjbl82vkh0cw4ya253m4p7nirm8nr6yjrsirkzxg";
15− }
16− else if stdenv.hostPlatform.system == "i686-linux" then
17− fetchurl {
18− url = "http://download.alephobjects.com/ao/aodeb/dists/jessie/main/binary-i386/cura_${version}_i386.deb";
19− sha256 = "0xd3df6bxq4rijgvsqvps454jkc1nzhxbdzzj6j2w317ppsbhyc1";
20− }
21− else throw "${name} is not supported on ${stdenv.hostPlatform.system}";
22−
23− python_deps = with py; [ pyopengl pyserial numpy wxPython30 power setuptools ];
24− pythonPath = python_deps;
25− propagatedBuildInputs = python_deps;
26− buildInputs = [ dpkg bash py.wrapPython ];
18+ version = "3.6.18";
2719
28− phases = [ "unpackPhase" "installPhase" ];
29− unpackPhase = "dpkg-deb -x ${src} ./";
20+ src = fetchgit {
21+ url = https://code.alephobjects.com/source/cura-lulzbot.git;
22+ rev = "71f1ac5a2b9f535175a3858a565930348358a9ca";
23+ sha256 = "0by06fpxvdgy858lwhsccbmvkdq67j2s1cz8v6jnrnjrsxk7vzka";
24+ };
3025
31− installPhase = ''
32− mkdir -p $out/bin
33− cp -r usr/share $out/share
34− find $out/share -type f -exec sed -i 's|/usr/share/cura|$out/share/cura|g' "{}" \;
26+ format = "other"; # using cmake to build
27+ buildInputs = [ qtbase qtquickcontrols2 ];
28+ # numpy-stl temporarily disabled due to https://code.alephobjects.com/T8415
29+ propagatedBuildInputs = with python3Packages; [ pyserial requests zeroconf ] ++ [ libsavitar uranium libarcus ]; # numpy-stl
30+ nativeBuildInputs = [ cmake python3Packages.wrapPython ];
3531
36− cat <<EOT > $out/bin/cura
37− #!${bash}/bin/bash
38− PYTHONPATH=$PYTHONPATH:$out/share/cura ${py.python}/bin/python $out/share/cura/cura.py "\$@"
39− EOT
32+ cmakeFlags = [
33+ "-DURANIUM_DIR=${uranium.src}"
34+ "-DCURA_VERSION=${version}"
35+ ];
4036
41− chmod 555 $out/bin/cura
37+ postPatch = ''
38+ sed -i 's,/python''${PYTHON_VERSION_MAJOR}/dist-packages,/python''${PYTHON_VERSION_MAJOR}.''${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
39+ sed -i 's, executable_name = .*, executable_name = "${curaengine}/bin/CuraEngine",' plugins/CuraEngineBackend/CuraEngineBackend.py
4240 '';
4341
44− meta = with stdenv.lib; {
45− description = "3D printing host software for the Lulzbot";
46−
47− longDescription = ''
48− Cura LulzBot Edition is a fork of the 3D printing/slicing
49− software from Ultimaker, with changes to support 3D printers
50− from Aleph Objects.
51− '';
42+ preFixup = ''
43+ substituteInPlace "$out/bin/cura-lulzbot" --replace 'import cura.CuraApplication' 'import Savitar; import cura.CuraApplication'
44+ ln -sT "${curaBinaryData}/cura/resources/firmware" "$out/share/cura/resources/firmware"
45+ ln -sT "${uranium}/share/uranium" "$out/share/uranium"
46+ ${jq}/bin/jq --arg out "$out" '.build=$out' >"$out/version.json" <<'EOF'
47+ ${builtins.toJSON {
48+ cura = version;
49+ cura_version = version;
50+ binarydata = curaBinaryDataVersion;
51+ engine = curaengine.version;
52+ libarcus = libarcus.version;
53+ libsavitar = libsavitar.version;
54+ uranium = uranium.version;
55+ }}
56+ EOF
57+ '';
5258
53− homepage = https://www.lulzbot.com/cura/;
54− license = licenses.agpl3;
59+ meta = with lib; {
60+ description = "3D printer / slicing GUI built on top of the Uranium framework";
61+ homepage = https://code.alephobjects.com/diffusion/CURA/;
62+ license = licenses.agpl3; # a partial relicense to LGPL has happened, but not certain that all AGPL bits are expunged
5563 platforms = platforms.linux;
56− maintainers = with maintainers; [ pjones ];
64+ maintainers = with maintainers; [ chaduffy ];
5765 };
5866}
pkgs/applications/misc/curaengine/lulzbot.nixnew file+26
@@ -0,0 +1,26 @@
1+{ stdenv, fetchgit, fetchpatch, cmake, libarcusLulzbot, stb, protobuf }:
2+
3+stdenv.mkDerivation rec {
4+ name = "curaengine-lulzBot-${version}";
5+ version = "3.6.18";
6+
7+ src = fetchgit {
8+ url = https://code.alephobjects.com/source/curaengine-lulzbot.git;
9+ rev = "ec6a1a0f0aa387ef97e5c106633cf8d7fb9cd00d";
10+ sha256 = "0wdkvg1hmqp1gaym804lw09x4ngf5ffasd861jhflpy7djbmkfn8";
11+ };
12+
13+ nativeBuildInputs = [ cmake ];
14+ buildInputs = [ libarcusLulzbot stb protobuf ];
15+
16+ cmakeFlags = [ "-DCURA_ENGINE_VERSION=${version}" ];
17+
18+ meta = with stdenv.lib; {
19+ description = "A powerful, fast and robust engine for processing 3D models into 3D printing instruction";
20+ homepage = https://code.alephobjects.com/source/curaengine-lulzbot/;
21+ license = licenses.agpl3;
22+ platforms = platforms.linux;
23+ maintainers = with maintainers; [ chaduffy ];
24+ };
25+}
26+
pkgs/development/python-modules/libarcus/lulzbot.nixnew file+33
@@ -0,0 +1,33 @@
1+{ stdenv, buildPythonPackage, fetchgit, fetchurl, cmake, sip, protobuf, pythonOlder }:
2+
3+buildPythonPackage rec {
4+ pname = "libarcus";
5+ version = "3.6.18";
6+ format = "other";
7+
8+ src = fetchgit {
9+ url = https://code.alephobjects.com/source/arcus.git;
10+ rev = "c795c0644591703ce04e1fd799fc97b1539031aa";
11+ sha256 = "1yap9wbqxbjx3kqyqcsldny4mlcm33ywiwpdjlfgs0wjahfg4ip0";
12+ };
13+
14+ disabled = pythonOlder "3.4.0";
15+
16+ propagatedBuildInputs = [ sip ];
17+ nativeBuildInputs = [ cmake ];
18+ buildInputs = [ protobuf ];
19+
20+ postPatch = ''
21+ # To workaround buggy SIP detection which overrides PYTHONPATH
22+ sed -i '/SET(ENV{PYTHONPATH}/d' cmake/FindSIP.cmake
23+ '';
24+
25+ meta = with stdenv.lib; {
26+ description = "Communication library between internal components for Ultimaker software";
27+ homepage = https://code.alephobjects.com/source/arcus/;
28+ license = licenses.lgpl3Plus;
29+ platforms = platforms.linux;
30+ maintainers = with maintainers; [ chaduffy ];
31+ };
32+}
33+
pkgs/development/python-modules/libsavitar/lulzbot.nixnew file+33
@@ -0,0 +1,33 @@
1+{ stdenv, buildPythonPackage, pythonOlder, fetchgit, cmake, sip }:
2+
3+buildPythonPackage rec {
4+ pname = "libsavitar-lulzbot";
5+ name = "libsavitar-lulzbot";
6+ version = "3.6.18";
7+ format = "other";
8+
9+ src = fetchgit {
10+ url = https://code.alephobjects.com/source/savitar.git;
11+ rev = "988a26d35b2a1d042f8c38938ccda77ab146af7d";
12+ sha256 = "146agw3a92azkgs5ahmn2rrck4an78m2r3pcss6ihmb60lx165k7";
13+ };
14+
15+ postPatch = ''
16+ # To workaround buggy SIP detection which overrides PYTHONPATH
17+ sed -i '/SET(ENV{PYTHONPATH}/d' cmake/FindSIP.cmake
18+ '';
19+
20+ nativeBuildInputs = [ cmake ];
21+
22+ propagatedBuildInputs = [ sip ];
23+
24+ disabled = pythonOlder "3.4.0";
25+
26+ meta = with stdenv.lib; {
27+ description = "C++ implementation of 3mf loading with SIP python bindings";
28+ homepage = https://github.com/Ultimaker/libSavitar;
29+ license = licenses.lgpl3Plus;
30+ platforms = platforms.unix;
31+ maintainers = with maintainers; [ chaduffy ];
32+ };
33+}
pkgs/development/python-modules/uranium/lulzbot.nixnew file+41
@@ -0,0 +1,41 @@
1+{ stdenv, fetchurl, fetchgit, buildPythonPackage, fetchFromGitHub, python, cmake
2+, pyqt5, numpy, scipy, shapely, libarcusLulzbot, doxygen, gettext, pythonOlder }:
3+
4+buildPythonPackage rec {
5+ version = "3.6.18";
6+ pname = "uranium";
7+ name = "uraniumLulzbot";
8+ format = "other";
9+
10+ src = fetchgit {
11+ url = https://code.alephobjects.com/diffusion/U/uranium.git;
12+ rev = "33df88a7414375ac924ac761113baa48d2ced2b4";
13+ sha256 = "109cbv7y105crbrzfp70lmcr9n20ap5c97i5qd46fmxbx86yj7f8";
14+ };
15+
16+ disabled = pythonOlder "3.5.0";
17+
18+ buildInputs = [ python gettext ];
19+ propagatedBuildInputs = [ pyqt5 numpy scipy shapely libarcusLulzbot ];
20+ nativeBuildInputs = [ cmake doxygen ];
21+
22+ # Qt 5.12+ support; see https://code.alephobjects.com/rU70b73ba0a270799b9eacf78e400aa8b8ab3fb2ee
23+ patches = [ ./qt512-support.patch ];
24+
25+ postPatch = ''
26+ sed -i 's,/python''${PYTHON_VERSION_MAJOR}/dist-packages,/python''${PYTHON_VERSION_MAJOR}.''${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
27+ sed -i \
28+ -e "s,Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,Resources.addSearchPath(\"$out/share/uranium/resources\")," \
29+ -e "s,self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,self._plugin_registry.addPluginLocation(\"$out/lib/uranium/plugins\")," \
30+ UM/Application.py
31+ '';
32+
33+ meta = with stdenv.lib; {
34+ description = "A Python framework for building Desktop applications";
35+ homepage = https://code.alephobjects.com/diffusion/U/;
36+ license = licenses.lgpl3Plus;
37+ platforms = platforms.linux;
38+ maintainers = with maintainers; [ chaduffy ];
39+ };
40+}
41+
pkgs/development/python-modules/uranium/qt512-support.patchnew file+16
@@ -0,0 +1,16 @@
1+diff --git a/UM/Qt/Bindings/i18nCatalogProxy.py b/UM/Qt/Bindings/i18nCatalogProxy.py
2+index 7e2bb16c..cec70dd6 100644
3+--- a/UM/Qt/Bindings/i18nCatalogProxy.py
4++++ b/UM/Qt/Bindings/i18nCatalogProxy.py
5+@@ -86,9 +86,9 @@ class i18nCatalogProxy(QObject): # [CodeStyle: Ultimaker code style requires cla
6+ # \todo Move this to a more generic place so more things can use it.
7+ def _wrapFunction(self, engine, this_object, function):
8+ # JavaScript code that wraps the Python method call in a closure
9+- wrap_js = """function(this_object) {{
10++ wrap_js = """(function(this_object) {{
11+ return function({args}) {{ return this_object.{function}({args}) }}
12+- }}"""
13++ }})"""
14+
15+ # Get the function name and argument list.
16+ function_name = function.__name__
pkgs/top-level/all-packages.nix+4−4
@@ -20203,14 +20203,14 @@ in
2020320203 curaengine = curaengine_stable;
2020420204 };
2020520205
20206− curaengine = callPackage ../applications/misc/curaengine {
20207− inherit (python3.pkgs) libarcus;
20208− };
20206+ curaengine = callPackage ../applications/misc/curaengine { inherit (python3.pkgs) libarcus; };
20207+ curaengineLulzbot = callPackage ../applications/misc/curaengine/lulzbot.nix { inherit (python3.pkgs) libarcusLulzbot; };
20208+
2020920209 cura = qt5.callPackage ../applications/misc/cura { };
2021020210
2021120211 curaPlugins = callPackage ../applications/misc/cura/plugins.nix { };
2021220212
20213− curaLulzbot = callPackage ../applications/misc/cura/lulzbot.nix { };
20213+ curaLulzbot = qt5.callPackage ../applications/misc/cura/lulzbot.nix { };
2021420214
2021520215 curaByDagoma = callPackage ../applications/misc/curabydagoma { };
2021620216
pkgs/top-level/python-packages.nix+3
@@ -3238,6 +3238,7 @@ in {
32383238 fs-s3fs = callPackage ../development/python-modules/fs-s3fs { };
32393239
32403240 libarcus = callPackage ../development/python-modules/libarcus { inherit (pkgs) protobuf; };
3241+ libarcusLulzbot = callPackage ../development/python-modules/libarcus/lulzbot.nix { inherit (pkgs) protobuf; };
32413242
32423243 libcloud = callPackage ../development/python-modules/libcloud { };
32433244
@@ -3258,6 +3259,7 @@ in {
32583259 };
32593260
32603261 libsavitar = callPackage ../development/python-modules/libsavitar { };
3262+ libsavitarLulzbot = callPackage ../development/python-modules/libsavitar/lulzbot.nix { };
32613263
32623264 libplist = disabledIf isPy3k
32633265 (toPythonModule (pkgs.libplist.override{python2Packages=self; })).py;
@@ -5537,6 +5539,7 @@ in {
55375539 twilio = callPackage ../development/python-modules/twilio { };
55385540
55395541 uranium = callPackage ../development/python-modules/uranium { };
5542+ uraniumLulzbot = callPackage ../development/python-modules/uranium/lulzbot.nix { };
55405543
55415544 uuid = callPackage ../development/python-modules/uuid { };
55425545