curaLulzbot: move dependencies into sequestered corner of source tree

This commit is contained in:
Charles Duffy 2019-08-04 15:43:32 -05:00
parent 0ca75bc294
commit 784c69adfa
No known key found for this signature in database
GPG Key ID: BB397BA4CAA75978
8 changed files with 27 additions and 19 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchgit, fetchpatch, cmake, libarcusLulzbot, stb, protobuf }:
{ stdenv, callPackage, fetchgit, fetchpatch, cmake, libarcusLulzbot, stb, protobuf }:
stdenv.mkDerivation rec {
name = "curaengine-lulzBot-${version}";

View File

@ -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
'';

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, fetchgit, buildPythonPackage, fetchFromGitHub, python, cmake
{ stdenv, callPackage, fetchurl, fetchgit, buildPythonPackage, fetchFromGitHub, python, cmake
, pyqt5, numpy, scipy, shapely, libarcusLulzbot, doxygen, gettext, pythonOlder }:
buildPythonPackage rec {
@ -20,7 +20,7 @@ buildPythonPackage rec {
nativeBuildInputs = [ cmake doxygen ];
# Qt 5.12+ support; see https://code.alephobjects.com/rU70b73ba0a270799b9eacf78e400aa8b8ab3fb2ee
patches = [ ./qt512-support.patch ];
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

View File

@ -20204,13 +20204,12 @@ in
};
curaengine = callPackage ../applications/misc/curaengine { inherit (python3.pkgs) libarcus; };
curaengineLulzbot = callPackage ../applications/misc/curaengine/lulzbot.nix { inherit (python3.pkgs) libarcusLulzbot; };
cura = qt5.callPackage ../applications/misc/cura { };
curaPlugins = callPackage ../applications/misc/cura/plugins.nix { };
curaLulzbot = qt5.callPackage ../applications/misc/cura/lulzbot.nix { };
curaLulzbot = qt5.callPackage ../applications/misc/cura/lulzbot/default.nix { };
curaByDagoma = callPackage ../applications/misc/curabydagoma { };

View File

@ -3238,7 +3238,6 @@ in {
fs-s3fs = callPackage ../development/python-modules/fs-s3fs { };
libarcus = callPackage ../development/python-modules/libarcus { inherit (pkgs) protobuf; };
libarcusLulzbot = callPackage ../development/python-modules/libarcus/lulzbot.nix { inherit (pkgs) protobuf; };
libcloud = callPackage ../development/python-modules/libcloud { };
@ -3259,7 +3258,6 @@ in {
};
libsavitar = callPackage ../development/python-modules/libsavitar { };
libsavitarLulzbot = callPackage ../development/python-modules/libsavitar/lulzbot.nix { };
libplist = disabledIf isPy3k
(toPythonModule (pkgs.libplist.override{python2Packages=self; })).py;
@ -5539,7 +5537,6 @@ in {
twilio = callPackage ../development/python-modules/twilio { };
uranium = callPackage ../development/python-modules/uranium { };
uraniumLulzbot = callPackage ../development/python-modules/uranium/lulzbot.nix { };
uuid = callPackage ../development/python-modules/uuid { };