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