summary refs log tree commit diff
path: root/pkgs/applications/misc/cura/stable.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2017-02-26 01:05:04 +0300
committerNikolay Amiantov <ab@fmap.me>2017-03-01 02:23:18 +0300
commit2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7 (patch)
tree76953900e87aa9ff7e21e6644bf5cb0163661c65 /pkgs/applications/misc/cura/stable.nix
parent868794010fb1d8295d6b83561f3c6d489d5ed818 (diff)
downloadnixpkgs-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar
nixpkgs-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.gz
nixpkgs-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.bz2
nixpkgs-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.lz
nixpkgs-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.xz
nixpkgs-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.zst
nixpkgs-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.zip
cura, curaengine: 14.04 -> 2.4.0
Move old Cura to {cura,curaengine}_stable
Diffstat (limited to 'pkgs/applications/misc/cura/stable.nix')
-rw-r--r--pkgs/applications/misc/cura/stable.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/pkgs/applications/misc/cura/stable.nix b/pkgs/applications/misc/cura/stable.nix
new file mode 100644
index 00000000000..a53b001b0e9
--- /dev/null
+++ b/pkgs/applications/misc/cura/stable.nix
@@ -0,0 +1,73 @@
+{ stdenv, python27Packages, curaengine, makeDesktopItem, fetchurl }:
+let
+  py = python27Packages;
+  version = "15.04";
+in
+stdenv.mkDerivation rec {
+  name = "cura-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/daid/Cura/archive/${version}.tar.gz";
+    sha256 = "0xbjvzhp8wzq9lnpmcg1fjf7j5h39bj5463sd5c8jzdjl96izizl";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "Cura";
+    exec = "cura";
+    icon = "cura";
+    comment = "Cura";
+    desktopName = "Cura";
+    genericName = "3D printing host software";
+    categories = "GNOME;GTK;Utility;";
+  };
+
+  python_deps = with py; [ pyopengl pyserial numpy wxPython30 power setuptools ];
+
+  pythonPath = python_deps;
+
+  propagatedBuildInputs = python_deps;
+
+  buildInputs = [ curaengine py.wrapPython ];
+
+  configurePhase = "";
+  buildPhase = "";
+  
+  patches = [ ./numpy-cast.patch ];
+
+  installPhase = ''
+    # Install Python code.
+    site_packages=$out/lib/python2.7/site-packages
+    mkdir -p $site_packages
+    cp -r Cura $site_packages/
+
+    # Install resources.
+    resources=$out/share/cura
+    mkdir -p $resources
+    cp -r resources/* $resources/
+    sed -i 's|os.path.join(os.path.dirname(__file__), "../../resources")|"'$resources'"|g' $site_packages/Cura/util/resources.py
+
+    # Install executable.
+    mkdir -p $out/bin
+    cp Cura/cura.py $out/bin/cura
+    chmod +x $out/bin/cura
+    sed -i 's|#!/usr/bin/python|#!/usr/bin/env python|' $out/bin/cura
+    wrapPythonPrograms
+
+    # Make it find CuraEngine.
+    echo "def getEngineFilename(): return '${curaengine}/bin/CuraEngine'" >> $site_packages/Cura/util/sliceEngine.py
+
+    # Install desktop item.
+    mkdir -p "$out"/share/applications
+    cp "$desktopItem"/share/applications/* "$out"/share/applications/
+    mkdir -p "$out"/share/icons
+    ln -s "$resources/images/c.png" "$out"/share/icons/cura.png
+  '';
+
+  meta = with stdenv.lib; {
+    description = "3D printing host software";
+    homepage = https://github.com/daid/Cura;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+  };
+}