2021-12-13 14:41:17 +00:00
|
|
|
{ lib, stdenv, python27Packages, curaengine, makeDesktopItem, fetchFromGitHub }:
|
|
|
|
|
2017-02-25 22:05:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "cura";
|
2021-12-13 14:41:17 +00:00
|
|
|
version = "15.06.03";
|
2017-02-25 22:05:04 +00:00
|
|
|
|
2021-12-13 14:41:17 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "daid";
|
|
|
|
repo = "Cura";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-o1cAi4Wi19WOijlRB9iYwNEpSNnmywUj5Bth8rRhqFA=";
|
2017-02-25 22:05:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "Cura";
|
|
|
|
exec = "cura";
|
|
|
|
icon = "cura";
|
|
|
|
comment = "Cura";
|
|
|
|
desktopName = "Cura";
|
|
|
|
genericName = "3D printing host software";
|
|
|
|
categories = "GNOME;GTK;Utility;";
|
|
|
|
};
|
|
|
|
|
2021-12-13 14:41:17 +00:00
|
|
|
python_deps = with python27Packages; [ pyopengl pyserial numpy wxPython30 power setuptools ];
|
2017-02-25 22:05:04 +00:00
|
|
|
|
|
|
|
pythonPath = python_deps;
|
|
|
|
|
|
|
|
propagatedBuildInputs = python_deps;
|
|
|
|
|
2021-12-13 14:41:17 +00:00
|
|
|
buildInputs = [ curaengine python27Packages.wrapPython ];
|
2017-02-25 22:05:04 +00:00
|
|
|
|
|
|
|
configurePhase = "";
|
|
|
|
buildPhase = "";
|
2020-05-09 10:25:07 +01:00
|
|
|
|
2017-02-25 22:05:04 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-02-25 22:05:04 +00:00
|
|
|
description = "3D printing host software";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/daid/Cura";
|
2017-02-25 22:05:04 +00:00
|
|
|
license = licenses.agpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|