30 buildPythonPackage rec {
31 pname = "pillow-heif";
35 src = fetchFromGitHub {
38 rev = "refs/tags/v${version}";
39 hash = "sha256-fKh4UbTVj74YxH2vvL24DNmMxg10GSYAmduwuRneE+0=";
44 # fix libheif 1.18 support in tests
45 url = "https://github.com/bigcat88/pillow_heif/commit/a59434e9ca1138e47e322ddef2adc79e684384f1.patch";
46 hash = "sha256-yVT/pnO5KWMnsO95EPCZgyhx6FIJOhsna7t0zpTjWpE=";
51 sed -i '/addopts/d' pyproject.toml
61 dontUseCmakeConfigure = true;
71 # clang-16: error: argument unused during compilation: '-fno-strict-overflow'
72 NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
74 RELEASE_FULL_FLAG = 1;
77 propagatedBuildInputs = [ pillow ];
79 pythonImportsCheck = [ "pillow_heif" ];
93 ++ lib.optionals stdenv.hostPlatform.isDarwin [
94 # https://github.com/bigcat88/pillow_heif/issues/89
95 # not reproducible in nixpkgs
98 ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
99 # RuntimeError: Encoder plugin generated an error: Unsupported bit depth: Bit depth not supported by x265
100 "test_open_heif_compare_non_standard_modes_data"
101 "test_open_save_disable_16bit"
102 "test_save_bgr_16bit_to_10_12_bit"
103 "test_save_bgra_16bit_to_10_12_bit"
104 "test_premultiplied_alpha"
106 "test_I_color_modes_to_10_12_bit"
110 changelog = "https://github.com/bigcat88/pillow_heif/releases/tag/v${version}";
111 description = "Python library for working with HEIF images and plugin for Pillow";
112 homepage = "https://github.com/bigcat88/pillow_heif";
113 license = with lib.licenses; [
117 maintainers = with lib.maintainers; [ dandellion ];