1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitLab,
5 nose,
6 pillow,
7 isPy3k,
8 isPyPy,
9}:
10buildPythonPackage rec {
11 pname = "pypillowfight";
12 version = "0.3.0";
13 format = "setuptools";
14
15 src = fetchFromGitLab {
16 domain = "gitlab.gnome.org";
17 group = "World";
18 owner = "OpenPaperwork";
19 repo = "libpillowfight";
20 rev = version;
21 sha256 = "096242v425mlqqj5g1giy59p7grxp05g78w6bk37vzph98jrgv3w";
22 };
23
24 prePatch = ''
25 echo '#define INTERNAL_PILLOWFIGHT_VERSION "${version}"' > src/pillowfight/_version.h
26 '';
27
28 # Disable tests because they're designed to only work on Debian:
29 # https://github.com/jflesch/libpillowfight/issues/2#issuecomment-268259174
30 doCheck = false;
31
32 # Python 2.x is not supported, see:
33 # https://github.com/jflesch/libpillowfight/issues/1
34 disabled = !isPy3k && !isPyPy;
35
36 # This is needed by setup.py regardless of whether tests are enabled.
37 buildInputs = [ nose ];
38 propagatedBuildInputs = [ pillow ];
39
40 meta = with lib; {
41 description = "Library containing various image processing algorithms";
42 inherit (src.meta) homepage;
43 license = licenses.gpl3Plus;
44 };
45}