summary refs log tree commit diff
path: root/pkgs/applications/misc/printrun/default.nix
blob: 27a55f4464f2a8e361529785d9916fb65ae3f9b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv, python27Packages, fetchFromGitHub }:

python27Packages.buildPythonApplication rec {
  name = "printrun-20150310";

  src = fetchFromGitHub {
    owner = "kliment";
    repo = "Printrun";
    rev = name;
    sha256 = "09ijv8h4k5h15swg64s7igamvynawz7gdi7hiymzrzywdvr0zwsa";
  };

  propagatedBuildInputs = with python27Packages; [
    wxPython30 pyserial dbus psutil numpy pyopengl pyglet cython
  ];

  doCheck = false;

  setupPyBuildFlags = ["-i"];

  postPatch = ''
    sed -i -r "s|/usr(/local)?/share/|$out/share/|g" printrun/utils.py
  '';

  postInstall = ''
    for f in $out/share/applications/*.desktop; do
      sed -i -e "s|/usr/|$out/|g" "$f"
    done
  '';

  meta = with stdenv.lib; {
    description = "Pronterface, Pronsole, and Printcore - Pure Python 3d printing host software";
    homepage = https://github.com/kliment/Printrun;
    license = licenses.gpl3;
    platforms = platforms.linux;
  };
}