1{ buildPythonPackage, stdenv, tornado, pycrypto, pycurl, pytz
2, pillow, derpconf, python_magic, pexif, libthumbor, opencv, webcolors
3, piexif, futures, statsd, thumborPexif, fetchPypi, fetchpatch, isPy3k, lib
4}:
5
6buildPythonPackage rec {
7 pname = "thumbor";
8 version = "6.4.2";
9
10 disabled = isPy3k; # see https://github.com/thumbor/thumbor/issues/1004
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "0y9mf78j80vjh4y0xvgnybc1wqfcwm5s19xhsfgkn12hh8pmh14d";
15 };
16
17 patches = [
18 (fetchpatch {
19 url = "https://github.com/thumbor/thumbor/commit/4f2bc99451409e404f7fa0f3e4a3bdaea7b49869.patch";
20 sha256 = "0qqw1n1pfd8f8cn168718gzwf4b35j2j9ajyw643xpf92s0iq2cc";
21 })
22 ];
23
24 postPatch = ''
25 substituteInPlace "setup.py" \
26 --replace '"argparse",' "" ${lib.optionalString isPy3k ''--replace '"futures",' ""''}
27 '';
28
29 propagatedBuildInputs = [
30 tornado
31 pycrypto
32 pycurl
33 pytz
34 pillow
35 derpconf
36 python_magic
37 pexif
38 libthumbor
39 opencv
40 webcolors
41 piexif
42 statsd
43 ] ++ lib.optionals (!isPy3k) [ futures thumborPexif ];
44
45 # disabled due to too many impure tests and issues with native modules in
46 # the pure testing environment. See https://github.com/NixOS/nixpkgs/pull/37147
47 # for further reference.
48 doCheck = false;
49
50 meta = with stdenv.lib; {
51 description = "A smart imaging service";
52 homepage = https://github.com/thumbor/thumbor/wiki;
53 license = licenses.mit;
54 maintainers = with maintainers; [ ma27 ];
55 };
56}