curaLulzbot: move dependencies into sequestered corner of source tree

This commit is contained in:
Charles Duffy
2019-08-04 15:51:53 -05:00
parent 0ca75bc294
commit 784c69adfa
8 changed files with 27 additions and 19 deletions
@@ -0,0 +1,26 @@
{ stdenv, callPackage, fetchgit, fetchpatch, cmake, libarcusLulzbot, stb, protobuf }:
stdenv.mkDerivation rec {
name = "curaengine-lulzBot-${version}";
version = "3.6.18";
src = fetchgit {
url = https://code.alephobjects.com/source/curaengine-lulzbot.git;
rev = "ec6a1a0f0aa387ef97e5c106633cf8d7fb9cd00d";
sha256 = "0wdkvg1hmqp1gaym804lw09x4ngf5ffasd861jhflpy7djbmkfn8";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ libarcusLulzbot stb protobuf ];
cmakeFlags = [ "-DCURA_ENGINE_VERSION=${version}" ];
meta = with stdenv.lib; {
description = "A powerful, fast and robust engine for processing 3D models into 3D printing instruction";
homepage = https://code.alephobjects.com/source/curaengine-lulzbot/;
license = licenses.agpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ chaduffy ];
};
}
@@ -1,4 +1,4 @@
{ lib, fetchgit, curaengineLulzbot, cmake, jq, python3Packages, qtbase, qtquickcontrols2 }:
{ lib, callPackage, fetchgit, cmake, jq, python3Packages, qtbase, qtquickcontrols2 }:
let
# admittedly, we're using (printer firmware) blobs when we could compile them ourselves.
@@ -8,10 +8,22 @@ let
rev = "cdc046494bbfe1f65bfb34659a257eef9a0100a0";
sha256 = "0v0s036gxdjiglas2yzw95alv60sw3pq5k1zrrhmw9mxr4irrblb";
};
curaengine = curaengineLulzbot;
libarcus = python3Packages.libarcusLulzbot;
uranium = python3Packages.uraniumLulzbot;
libsavitar = python3Packages.libsavitarLulzbot;
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;
};
in
python3Packages.buildPythonApplication rec {
name = "cura-lulzbot-${version}";
@@ -26,11 +38,11 @@ python3Packages.buildPythonApplication rec {
format = "other"; # using cmake to build
buildInputs = [ qtbase qtquickcontrols2 ];
# numpy-stl temporarily disabled due to https://code.alephobjects.com/T8415
propagatedBuildInputs = with python3Packages; [ pyserial requests zeroconf ] ++ [ libsavitar uranium libarcus ]; # numpy-stl
propagatedBuildInputs = with python3Packages; [ pyserial requests zeroconf ] ++ [ libsavitarLulzbot uraniumLulzbot libarcusLulzbot ]; # numpy-stl
nativeBuildInputs = [ cmake python3Packages.wrapPython ];
cmakeFlags = [
"-DURANIUM_DIR=${uranium.src}"
"-DURANIUM_DIR=${uraniumLulzbot.src}"
"-DCURA_VERSION=${version}"
];
@@ -42,16 +54,16 @@ python3Packages.buildPythonApplication rec {
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"
ln -sT "${uranium}/share/uranium" "$out/share/uranium"
ln -sT "${uraniumLulzbot}/share/uranium" "$out/share/uranium"
${jq}/bin/jq --arg out "$out" '.build=$out' >"$out/version.json" <<'EOF'
${builtins.toJSON {
cura = version;
cura_version = version;
binarydata = curaBinaryDataVersion;
engine = curaengine.version;
libarcus = libarcus.version;
libsavitar = libsavitar.version;
uranium = uranium.version;
libarcus = libarcusLulzbot.version;
libsavitar = libsavitarLulzbot.version;
uranium = uraniumLulzbot.version;
}}
EOF
'';
@@ -0,0 +1,33 @@
{ stdenv, buildPythonPackage, fetchgit, fetchurl, cmake, sip, protobuf, pythonOlder }:
buildPythonPackage rec {
pname = "libarcus";
version = "3.6.18";
format = "other";
src = fetchgit {
url = https://code.alephobjects.com/source/arcus.git;
rev = "c795c0644591703ce04e1fd799fc97b1539031aa";
sha256 = "1yap9wbqxbjx3kqyqcsldny4mlcm33ywiwpdjlfgs0wjahfg4ip0";
};
disabled = pythonOlder "3.4.0";
propagatedBuildInputs = [ sip ];
nativeBuildInputs = [ cmake ];
buildInputs = [ protobuf ];
postPatch = ''
# To workaround buggy SIP detection which overrides PYTHONPATH
sed -i '/SET(ENV{PYTHONPATH}/d' cmake/FindSIP.cmake
'';
meta = with stdenv.lib; {
description = "Communication library between internal components for Ultimaker software";
homepage = https://code.alephobjects.com/source/arcus/;
license = licenses.lgpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ chaduffy ];
};
}
@@ -0,0 +1,33 @@
{ stdenv, buildPythonPackage, pythonOlder, fetchgit, cmake, sip }:
buildPythonPackage rec {
pname = "libsavitar-lulzbot";
name = "libsavitar-lulzbot";
version = "3.6.18";
format = "other";
src = fetchgit {
url = https://code.alephobjects.com/source/savitar.git;
rev = "988a26d35b2a1d042f8c38938ccda77ab146af7d";
sha256 = "146agw3a92azkgs5ahmn2rrck4an78m2r3pcss6ihmb60lx165k7";
};
postPatch = ''
# To workaround buggy SIP detection which overrides PYTHONPATH
sed -i '/SET(ENV{PYTHONPATH}/d' cmake/FindSIP.cmake
'';
nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ sip ];
disabled = pythonOlder "3.4.0";
meta = with stdenv.lib; {
description = "C++ implementation of 3mf loading with SIP python bindings";
homepage = https://github.com/Ultimaker/libSavitar;
license = licenses.lgpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ chaduffy ];
};
}
@@ -0,0 +1,16 @@
diff --git a/UM/Qt/Bindings/i18nCatalogProxy.py b/UM/Qt/Bindings/i18nCatalogProxy.py
index 7e2bb16c..cec70dd6 100644
--- a/UM/Qt/Bindings/i18nCatalogProxy.py
+++ b/UM/Qt/Bindings/i18nCatalogProxy.py
@@ -86,9 +86,9 @@ class i18nCatalogProxy(QObject): # [CodeStyle: Ultimaker code style requires cla
# \todo Move this to a more generic place so more things can use it.
def _wrapFunction(self, engine, this_object, function):
# JavaScript code that wraps the Python method call in a closure
- wrap_js = """function(this_object) {{
+ wrap_js = """(function(this_object) {{
return function({args}) {{ return this_object.{function}({args}) }}
- }}"""
+ }})"""
# Get the function name and argument list.
function_name = function.__name__
@@ -0,0 +1,41 @@
{ stdenv, callPackage, fetchurl, fetchgit, buildPythonPackage, fetchFromGitHub, python, cmake
, pyqt5, numpy, scipy, shapely, libarcusLulzbot, doxygen, gettext, pythonOlder }:
buildPythonPackage rec {
version = "3.6.18";
pname = "uranium";
name = "uraniumLulzbot";
format = "other";
src = fetchgit {
url = https://code.alephobjects.com/diffusion/U/uranium.git;
rev = "33df88a7414375ac924ac761113baa48d2ced2b4";
sha256 = "109cbv7y105crbrzfp70lmcr9n20ap5c97i5qd46fmxbx86yj7f8";
};
disabled = pythonOlder "3.5.0";
buildInputs = [ python gettext ];
propagatedBuildInputs = [ pyqt5 numpy scipy shapely libarcusLulzbot ];
nativeBuildInputs = [ cmake doxygen ];
# Qt 5.12+ support; see https://code.alephobjects.com/rU70b73ba0a270799b9eacf78e400aa8b8ab3fb2ee
patches = [ ./uranium-qt512-support.patch ];
postPatch = ''
sed -i 's,/python''${PYTHON_VERSION_MAJOR}/dist-packages,/python''${PYTHON_VERSION_MAJOR}.''${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
sed -i \
-e "s,Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,Resources.addSearchPath(\"$out/share/uranium/resources\")," \
-e "s,self._plugin_registry.addPluginLocation(os.path.join(os.path.abspath(os.path.dirname(__file__)).*,self._plugin_registry.addPluginLocation(\"$out/lib/uranium/plugins\")," \
UM/Application.py
'';
meta = with stdenv.lib; {
description = "A Python framework for building Desktop applications";
homepage = https://code.alephobjects.com/diffusion/U/;
license = licenses.lgpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ chaduffy ];
};
}