about summary refs log tree commit diff
path: root/pkgs/development/python-modules/powerline/default.nix
blob: 6e1f724a35ddc6f25b0e0450655369cf36e4e383 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,
  socat,
  psutil,
  python-hglib,
  pygit2,
  pyuv,
  i3ipc,
  stdenv,
}:

# TODO: bzr support is missing because nixpkgs switched to `breezy`

buildPythonPackage rec {
  version = "2.8.4";
  pname = "powerline";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = pname;
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-snJrfUvP11lBIy6F0WtqJt9fiYm5jxMwm9u3u5XFO84=";
  };

  propagatedBuildInputs = [
    socat
    psutil
    python-hglib
    pygit2
    pyuv
  ] ++ lib.optionals (!stdenv.isDarwin) [ i3ipc ];

  # tests are travis-specific
  doCheck = false;

  postInstall = ''
    install -dm755 "$out/share/fonts/OTF/"
    install -dm755 "$out/etc/fonts/conf.d"
    install -m644 "font/PowerlineSymbols.otf" "$out/share/fonts/OTF/PowerlineSymbols.otf"
    install -m644 "font/10-powerline-symbols.conf" "$out/etc/fonts/conf.d/10-powerline-symbols.conf"

    install -dm755 "$out/share/fish/vendor_functions.d"
    install -m644 "powerline/bindings/fish/powerline-setup.fish" "$out/share/fish/vendor_functions.d/powerline-setup.fish"

    cp -ra powerline/bindings/{bash,shell,tcsh,tmux,vim,zsh} $out/share/
    rm $out/share/*/*.py
  '';

  meta = {
    homepage = "https://github.com/powerline/powerline";
    description = "Ultimate statusline/prompt utility";
    license = lib.licenses.mit;
  };
}