about summary refs log tree commit diff
path: root/pkgs/development/python-modules/tilequant/default.nix
blob: a72802e2c7b3b4b98a5d7e6daafaf388aec36514 (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
58
59
60
61
{ lib
, buildPythonPackage
, fetchFromGitHub
, gitpython
, click
, ordered-set
, pythonOlder
, pillow
, sortedcollections
}:

let
  aikku93-tilequant = fetchFromGitHub {
    owner = "SkyTemple";
    repo = "aikku93-tilequant";
    rev = "6604e0906edff384b6c8d4cde03e6601731f66fd";
    sha256 = "0w19h3n2i0xriqsy0b0rifjgbv4hqd7gl78fw0cappkrdykij5r1";
  };
in
buildPythonPackage rec {
  pname = "tilequant";
  version = "0.4.0.post0";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "SkyTemple";
    repo = pname;
    rev = version;
    sha256 = "189af203iay3inj1bbgm3hh1fshn879bcm28ypbvfp27fy7j5b25";
  };

  postPatch = ''
    cp -R --no-preserve=mode ${aikku93-tilequant} __aikku93_tilequant
  '';

  buildInputs = [
    gitpython
  ];

  propagatedBuildInputs = [
    click
    ordered-set
    pillow
    sortedcollections
  ];

  doCheck = false; # there are no tests

  pythonImportsCheck = [
    "skytemple_tilequant"
  ];

  meta = with lib; {
    description = "Tool for quantizing image colors using tile-based palette restrictions";
    homepage = "https://github.com/SkyTemple/tilequant";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ xfix ];
  };
}