1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-05 12:02:47 +00:00
nixpkgs/pkgs/development/python-modules/thumbor/default.nix

84 lines
2.2 KiB
Nix
Raw Normal View History

2018-10-27 14:17:52 +01:00
{ buildPythonPackage, python, tornado, pycrypto, pycurl, pytz
, pillow, derpconf, python_magic, libthumbor, webcolors
, piexif, futures, statsd, thumborPexif, fetchFromGitHub, isPy3k, lib
, mock, raven, nose, yanc, remotecv, pyssim, cairosvg1, preggy, opencv3
, pkgs, coreutils
}:
buildPythonPackage rec {
pname = "thumbor";
version = "6.5.2";
disabled = isPy3k; # see https://github.com/thumbor/thumbor/issues/1004
2018-10-27 14:17:52 +01:00
# Tests aren't included in PyPI tarball so use GitHub instead
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "1ys5ymwbvgh2ir85g9nyrzzf8vgi16j6pzzi53b0rgjx0kwlmnxg";
};
postPatch = ''
substituteInPlace "setup.py" \
--replace '"argparse",' "" ${lib.optionalString isPy3k ''--replace '"futures",' ""''}
2018-10-29 08:41:53 +00:00
substituteInPlace "setup.py" \
--replace "piexif>=1.0.13,<1.1.0" "piexif>=1.0.13"
2018-10-27 14:17:52 +01:00
substituteInPlace "tests/test_utils.py" \
--replace "/bin/ls" "${coreutils}/bin/ls"
substituteInPlace "tests/detectors/test_face_detector.py" \
--replace "./thumbor" "$out/lib/${python.libPrefix}/site-packages/thumbor"
substituteInPlace "tests/detectors/test_glasses_detector.py" \
--replace "./thumbor" "$out/lib/${python.libPrefix}/site-packages/thumbor"
'';
2018-10-27 14:17:52 +01:00
checkInputs = [
nose
pyssim
preggy
mock
yanc
remotecv
cairosvg1
raven
pkgs.redis
pkgs.glibcLocales
];
propagatedBuildInputs = [
tornado
pycrypto
pycurl
pytz
pillow
derpconf
python_magic
libthumbor
2018-10-27 14:17:52 +01:00
opencv3
webcolors
piexif
statsd
2018-10-27 14:17:52 +01:00
pkgs.exiftool
pkgs.libjpeg
pkgs.ffmpeg
pkgs.gifsicle
] ++ lib.optionals (!isPy3k) [ futures thumborPexif ];
2018-10-27 14:17:52 +01:00
# Remove the source tree before running nosetests because otherwise nosetests
# uses that instead of the installed package. Is there some other way to
# achieve this?
checkPhase = ''
redis-server --port 6668 --requirepass hey_you &
rm -r thumbor
export LC_ALL="en_US.UTF-8"
nosetests -v --with-yanc -s tests/
'';
meta = with lib; {
description = "A smart imaging service";
homepage = https://github.com/thumbor/thumbor/wiki;
license = licenses.mit;
maintainers = with maintainers; [ ma27 ];
};
}