2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, pythonOlder
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# build-system
|
|
|
|
, flit-core
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
# dependencies
|
|
|
|
, filetype
|
2023-11-16 04:20:00 +00:00
|
|
|
, defusedxml
|
|
|
|
|
|
|
|
# optional-dependencies
|
|
|
|
, pillow-heif
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, numpy
|
|
|
|
, opencv4
|
|
|
|
, pillow
|
|
|
|
, pytestCheckHook
|
|
|
|
, wand
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "willow";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.7.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "pyproject";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = pythonOlder "2.7";
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wagtail";
|
|
|
|
repo = "Willow";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-+ubylc/Zuw3DSSgtTg2dO3Zj0gpTJcLbb1J++caxS7w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
filetype
|
|
|
|
defusedxml
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
heif = [
|
|
|
|
pillow-heif
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
numpy
|
|
|
|
opencv4
|
|
|
|
pytestCheckHook
|
|
|
|
pillow
|
|
|
|
wand
|
|
|
|
] ++ passthru.optional-dependencies.heif;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Python image library that sits on top of Pillow, Wand and OpenCV";
|
|
|
|
homepage = "https://github.com/torchbox/Willow/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ desiderius ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|