about summary refs log tree commit diff
path: root/pkgs/applications
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
parent868794010fb1d8295d6b83561f3c6d489d5ed818 (diff)
downloadnixlib-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar
nixlib-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.gz
nixlib-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.bz2
nixlib-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.lz
nixlib-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.xz
nixlib-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.tar.zst
nixlib-2e80b50a7eb7db481ff00b6ae4ab76ece6d245b7.zip
cura, curaengine: 14.04 -> 2.4.0
Move old Cura to {cura,curaengine}_stable
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/cura/default.nix79
-rw-r--r--pkgs/applications/misc/cura/stable.nix73
-rw-r--r--pkgs/applications/misc/curaengine/default.nix33
-rw-r--r--pkgs/applications/misc/curaengine/stable.nix29
4 files changed, 139 insertions, 75 deletions
diff --git a/pkgs/applications/misc/cura/default.nix b/pkgs/applications/misc/cura/default.nix
index a53b001b0e98..ff18796e39d6 100644
--- a/pkgs/applications/misc/cura/default.nix
+++ b/pkgs/applications/misc/cura/default.nix
@@ -1,73 +1,38 @@
-{ stdenv, python27Packages, curaengine, makeDesktopItem, fetchurl }:
-let
-  py = python27Packages;
-  version = "15.04";
-in
+{ stdenv, lib, fetchFromGitHub, cmake, python3, qtbase, makeQtWrapper, curaengine }:
+
 stdenv.mkDerivation rec {
   name = "cura-${version}";
+  version = "2.4.0";
 
-  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;";
+  src = fetchFromGitHub {
+    owner = "Ultimaker";
+    repo = "Cura";
+    rev = version;
+    sha256 = "04iglmjg9rzmlfrll6g7bcckkla327938xh8qmbdfrh215aivdlp";
   };
 
-  python_deps = with py; [ pyopengl pyserial numpy wxPython30 power setuptools ];
-
-  pythonPath = python_deps;
-
-  propagatedBuildInputs = python_deps;
+  buildInputs = [ qtbase ];
+  propagatedBuildInputs = with python3.pkgs; [ uranium zeroconf pyserial ];
+  nativeBuildInputs = [ cmake python3.pkgs.wrapPython makeQtWrapper ];
 
-  buildInputs = [ curaengine py.wrapPython ];
+  cmakeFlags = [ "-DCMAKE_MODULE_PATH=${python3.pkgs.uranium}/share/cmake-${cmake.majorVersion}/Modules" ];
 
-  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
+  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
+  '';
 
-    # 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
+  postFixup = ''
     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
+    mv $out/bin/cura $out/bin/.cura-noqtpath
+    makeQtWrapper $out/bin/.cura-noqtpath $out/bin/cura
   '';
 
   meta = with stdenv.lib; {
-    description = "3D printing host software";
-    homepage = https://github.com/daid/Cura;
+    description = "3D printer / slicing GUI built on top of the Uranium framework";
+    homepage = "https://github.com/Ultimaker/Cura";
     license = licenses.agpl3;
     platforms = platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+    maintainers = with maintainers; [ abbradar ];
   };
 }
diff --git a/pkgs/applications/misc/cura/stable.nix b/pkgs/applications/misc/cura/stable.nix
new file mode 100644
index 000000000000..a53b001b0e98
--- /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 ];
+  };
+}
diff --git a/pkgs/applications/misc/curaengine/default.nix b/pkgs/applications/misc/curaengine/default.nix
index ce743a008798..08df0cc3e903 100644
--- a/pkgs/applications/misc/curaengine/default.nix
+++ b/pkgs/applications/misc/curaengine/default.nix
@@ -1,29 +1,26 @@
-{ stdenv, fetchurl }:
-let
-  version = "15.04.6";
-in
-stdenv.mkDerivation {
+{ stdenv, fetchFromGitHub, cmake, libarcus }:
+
+stdenv.mkDerivation rec {
   name = "curaengine-${version}";
+  version = "2.4.0";
 
-  src = fetchurl {
-    url = "https://github.com/Ultimaker/CuraEngine/archive/${version}.tar.gz";
-    sha256 = "1cd4dikzvqyj5g80rqwymvh4nwm76vsf78clb37kj6q0fig3qbjg";
+  src = fetchFromGitHub {
+    owner = "Ultimaker";
+    repo = "CuraEngine";
+    rev = version;
+    sha256 = "1n587cqm310kzb2zbc31199x7ybgxzjq91hslb1zcb8qg8qqmixm";
   };
 
-  postPatch = ''
-    sed -i 's,--static,,g' Makefile
-  '';
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libarcus ];
 
-  installPhase = ''
-    mkdir -p $out/bin
-    cp build/CuraEngine $out/bin/
-  '';
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    description = "Engine for processing 3D models into 3D printing instructions";
-    homepage = https://github.com/Ultimaker/CuraEngine;
+    description = "A powerful, fast and robust engine for processing 3D models into 3D printing instruction";
+    homepage = "https://github.com/Ultimaker/CuraEngine";
     license = licenses.agpl3;
     platforms = platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+    maintainers = with maintainers; [ abbradar ];
   };
 }
diff --git a/pkgs/applications/misc/curaengine/stable.nix b/pkgs/applications/misc/curaengine/stable.nix
new file mode 100644
index 000000000000..ce743a008798
--- /dev/null
+++ b/pkgs/applications/misc/curaengine/stable.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl }:
+let
+  version = "15.04.6";
+in
+stdenv.mkDerivation {
+  name = "curaengine-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/Ultimaker/CuraEngine/archive/${version}.tar.gz";
+    sha256 = "1cd4dikzvqyj5g80rqwymvh4nwm76vsf78clb37kj6q0fig3qbjg";
+  };
+
+  postPatch = ''
+    sed -i 's,--static,,g' Makefile
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp build/CuraEngine $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Engine for processing 3D models into 3D printing instructions";
+    homepage = https://github.com/Ultimaker/CuraEngine;
+    license = licenses.agpl3;
+    platforms = platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+  };
+}