1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, socat
5, psutil
6, python-hglib
7, pygit2
8, pyuv
9, i3ipc
10, stdenv
11}:
12
13# TODO: bzr support is missing because nixpkgs switched to `breezy`
14
15buildPythonPackage rec {
16 version = "2.8.3";
17 pname = "powerline";
18
19 src = fetchFromGitHub {
20 owner = pname;
21 repo = pname;
22 rev = "refs/tags/${version}";
23 hash = "sha256-UIx9/IZg6Wv596wHzQb0CO6zwmQXUaFEPKBojo2LXmA=";
24 };
25
26 propagatedBuildInputs = [
27 socat
28 psutil
29 python-hglib
30 pygit2
31 pyuv
32 ] ++ lib.optionals (!stdenv.isDarwin) [ i3ipc ];
33
34 # tests are travis-specific
35 doCheck = false;
36
37 postInstall = ''
38 install -dm755 "$out/share/fonts/OTF/"
39 install -dm755 "$out/etc/fonts/conf.d"
40 install -m644 "font/PowerlineSymbols.otf" "$out/share/fonts/OTF/PowerlineSymbols.otf"
41 install -m644 "font/10-powerline-symbols.conf" "$out/etc/fonts/conf.d/10-powerline-symbols.conf"
42
43 install -dm755 "$out/share/fish/vendor_functions.d"
44 install -m644 "powerline/bindings/fish/powerline-setup.fish" "$out/share/fish/vendor_functions.d/powerline-setup.fish"
45
46 cp -ra powerline/bindings/{bash,shell,tcsh,tmux,vim,zsh} $out/share/
47 rm $out/share/*/*.py
48 '';
49
50 meta = {
51 homepage = "https://github.com/powerline/powerline";
52 description = "The ultimate statusline/prompt utility";
53 license = lib.licenses.mit;
54 };
55}