1{ lib, buildPythonPackage, fetchPypi, imagemagick, feh, isPy3k }:
2
3buildPythonPackage rec {
4 pname = "pywal";
5 version = "3.3.0";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "1drha9kshidw908k7h3gd9ws2bl64ms7bjcsa83pwb3hqa9bkspg";
10 };
11
12 patches = [
13 ./convert.patch
14 ./feh.patch
15 ];
16
17 postPatch = ''
18 substituteInPlace pywal/backends/wal.py --subst-var-by convert "${imagemagick}/bin/convert"
19 substituteInPlace pywal/wallpaper.py --subst-var-by feh "${feh}/bin/feh"
20 '';
21
22 # Invalid syntax
23 disabled = !isPy3k;
24
25 preCheck = ''
26 mkdir tmp
27 HOME=$PWD/tmp
28
29 for f in tests/test_export.py tests/test_util.py ; do
30 substituteInPlace "$f" \
31 --replace '/tmp/' "$TMPDIR/"
32 done
33 '';
34
35 meta = with lib; {
36 description = "Generate and change colorschemes on the fly. A 'wal' rewrite in Python 3";
37 homepage = "https://github.com/dylanaraps/pywal";
38 license = licenses.mit;
39 maintainers = with maintainers; [ Fresheyeball ];
40 };
41}