16 gdkPixbufModuleDir = "${placeholder "out"}/${gdk-pixbuf.moduleDir}";
17 gdkPixbufModuleFile = "${placeholder "out"}/${gdk-pixbuf.binaryDir}/avif-loaders.cache";
20 stdenv.mkDerivation rec {
24 src = fetchFromGitHub {
25 owner = "AOMediaCodec";
28 sha256 = "sha256-3zNhKl8REWsRlblXIFD7zn7qvrc/pa4wHZI0oEc3pKE=";
31 # reco: encode libaom slowest but best, decode dav1d fastest
34 "-DBUILD_SHARED_LIBS=ON"
35 "-DAVIF_CODEC_AOM=ON" # best encoder (slow but small)
36 "-DAVIF_CODEC_DAV1D=ON" # best decoder (fast)
37 "-DAVIF_CODEC_AOM_DECODE=OFF"
38 "-DAVIF_BUILD_APPS=ON"
39 "-DAVIF_BUILD_GDK_PIXBUF=ON"
60 substituteInPlace contrib/gdk-pixbuf/avif.thumbnailer.in \
61 --replace '@CMAKE_INSTALL_FULL_BINDIR@/gdk-pixbuf-thumbnailer' "$out/libexec/gdk-pixbuf-thumbnailer-avif"
64 env.PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = gdkPixbufModuleDir;
67 GDK_PIXBUF_MODULEDIR=${gdkPixbufModuleDir} \
68 GDK_PIXBUF_MODULE_FILE=${gdkPixbufModuleFile} \
69 gdk-pixbuf-query-loaders --update-cache
72 # Cross-compiled gdk-pixbuf doesn't support thumbnailers
73 + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
75 makeWrapper ${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer "$out/libexec/gdk-pixbuf-thumbnailer-avif" \
76 --set GDK_PIXBUF_MODULE_FILE ${gdkPixbufModuleFile}
80 description = "C implementation of the AV1 Image File Format";
82 Libavif aims to be a friendly, portable C implementation of the
83 AV1 Image File Format. It is a work-in-progress, but can already
84 encode and decode all AOM supported YUV formats and bit depths
85 (with alpha). It also features an encoder and a decoder
88 homepage = "https://github.com/AOMediaCodec/libavif";
89 changelog = "https://github.com/AOMediaCodec/libavif/blob/v${version}/CHANGELOG.md";
90 maintainers = with maintainers; [ mkg20001 ];
91 platforms = platforms.all;
92 license = licenses.bsd2;