about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pywal/default.nix
blob: 2a5ff3bd8e69ffe5762247435d17012ac7221845 (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
{
  lib,
  buildPythonPackage,
  fetchPypi,
  imagemagick,
  feh,
  isPy3k,
}:

buildPythonPackage rec {
  pname = "pywal";
  version = "3.3.0";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1drha9kshidw908k7h3gd9ws2bl64ms7bjcsa83pwb3hqa9bkspg";
  };

  patches = [
    ./convert.patch
    ./feh.patch
  ];

  postPatch = ''
    substituteInPlace pywal/backends/wal.py --subst-var-by convert "${imagemagick}/bin/convert"
    substituteInPlace pywal/wallpaper.py --subst-var-by feh "${feh}/bin/feh"
  '';

  # Invalid syntax
  disabled = !isPy3k;

  preCheck = ''
    mkdir tmp
    HOME=$PWD/tmp

    for f in tests/test_export.py tests/test_util.py ; do
      substituteInPlace "$f" \
        --replace '/tmp/' "$TMPDIR/"
    done
  '';

  meta = with lib; {
    description = "Generate and change colorschemes on the fly. A 'wal' rewrite in Python 3";
    mainProgram = "wal";
    homepage = "https://github.com/dylanaraps/pywal";
    license = licenses.mit;
    maintainers = with maintainers; [ Fresheyeball ];
  };
}