2023-09-25 00:39:08 +00:00
|
|
|
{ lib
|
2023-11-10 02:53:41 +00:00
|
|
|
, stdenv
|
2023-09-25 00:39:08 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2023-09-26 16:16:45 +00:00
|
|
|
|
|
|
|
# build-system
|
2023-09-25 00:39:08 +00:00
|
|
|
, cmake
|
|
|
|
, nasm
|
2023-09-26 16:16:45 +00:00
|
|
|
|
|
|
|
# native dependencies
|
2023-09-25 00:39:08 +00:00
|
|
|
, libheif
|
|
|
|
, libaom
|
|
|
|
, libde265
|
|
|
|
, x265
|
2023-09-26 16:16:45 +00:00
|
|
|
|
|
|
|
# dependencies
|
|
|
|
, pillow
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, opencv4
|
|
|
|
, numpy
|
|
|
|
, pympler
|
|
|
|
, pytestCheckHook
|
2023-09-25 00:39:08 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2023-09-26 16:16:45 +00:00
|
|
|
pname = "pillow-heif";
|
2023-09-25 00:39:08 +00:00
|
|
|
version = "0.13.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bigcat88";
|
|
|
|
repo = "pillow_heif";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-GbOW29rGpLMS7AfShuO6UCzcspdHtFS7hyNKori0otI=";
|
|
|
|
};
|
|
|
|
|
2023-09-26 16:16:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
nasm
|
|
|
|
];
|
2023-09-25 00:39:08 +00:00
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2023-09-26 16:16:45 +00:00
|
|
|
buildInputs = [
|
|
|
|
libaom
|
|
|
|
libde265
|
|
|
|
libheif
|
|
|
|
x265
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pillow
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pillow_heif"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
opencv4
|
|
|
|
numpy
|
|
|
|
pympler
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2023-09-25 00:39:08 +00:00
|
|
|
|
2023-11-10 02:53:41 +00:00
|
|
|
disabledTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# https://github.com/bigcat88/pillow_heif/issues/89
|
|
|
|
# not reproducible in nixpkgs
|
|
|
|
"test_opencv_crash"
|
|
|
|
];
|
|
|
|
|
2023-09-25 00:39:08 +00:00
|
|
|
meta = {
|
2023-09-26 16:16:45 +00:00
|
|
|
changelog = "https://github.com/bigcat88/pillow_heif/releases/tag/v${version}";
|
2023-09-25 00:39:08 +00:00
|
|
|
description = "Python library for working with HEIF images and plugin for Pillow";
|
|
|
|
homepage = "https://github.com/bigcat88/pillow_heif";
|
|
|
|
license = with lib.licenses; [ bsd3 lgpl3 ];
|
|
|
|
maintainers = with lib.maintainers; [ dandellion ];
|
|
|
|
};
|
|
|
|
}
|