2024-05-13 21:24:10 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, dav1d, rav1e, libde265, x265
|
|
|
|
, libpng, libjpeg, libaom, gdk-pixbuf
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# for passthru.tests
|
2024-05-13 21:24:10 +00:00
|
|
|
, gimp, imagemagick, imlib2Full, imv, vips }:
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libheif";
|
|
|
|
version = "1.17.6";
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" "man" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "strukturag";
|
|
|
|
repo = "libheif";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-pp+PjV/pfExLqzFE61mxliOtVAYOePh1+i1pwZxDLAM=";
|
|
|
|
};
|
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2024-05-02 00:46:19 +00:00
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
buildInputs = [ dav1d rav1e libde265 x265 libpng libjpeg libaom gdk-pixbuf ];
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# Fix installation path for gdk-pixbuf module
|
2024-05-13 21:24:10 +00:00
|
|
|
PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR =
|
|
|
|
"${placeholder "out"}/${gdk-pixbuf.moduleDir}";
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# Wrong include path in .cmake. It's a bit difficult to patch because of special characters.
|
|
|
|
postFixup = ''
|
2024-05-13 21:24:10 +00:00
|
|
|
sed '/^ INTERFACE_INCLUDE_DIRECTORIES/s|"[^"]*/include"|"${
|
|
|
|
placeholder "dev"
|
|
|
|
}/include"|' \
|
2024-05-02 00:46:19 +00:00
|
|
|
-i "$dev"/lib/cmake/libheif/libheif-config.cmake
|
|
|
|
'';
|
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
passthru.tests = { inherit gimp imagemagick imlib2Full imv vips; };
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.libheif.org/";
|
2024-05-13 21:24:10 +00:00
|
|
|
description =
|
|
|
|
"ISO/IEC 23008-12:2017 HEIF image file format decoder and encoder";
|
2024-05-02 00:46:19 +00:00
|
|
|
license = lib.licenses.lgpl3Plus;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ gebner ];
|
|
|
|
};
|
|
|
|
}
|