2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-10-11 12:50:04 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, libaom
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, zlib
|
|
|
|
, libpng
|
|
|
|
, libjpeg
|
|
|
|
, dav1d
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libavif";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "0.10.0";
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AOMediaCodec";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-EGu2avkqQXHFX4gKWsVfVdQN99f4J7Hm86C0sAhuP1Y=";
|
2020-10-11 12:50:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# reco: encode libaom slowest but best, decode dav1d fastest
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
2020-11-21 19:51:51 +00:00
|
|
|
"-DAVIF_CODEC_AOM=ON" # best encoder (slow but small)
|
|
|
|
"-DAVIF_CODEC_DAV1D=ON" # best decoder (fast)
|
|
|
|
"-DAVIF_CODEC_AOM_DECODE=OFF"
|
2020-10-11 12:50:04 +00:00
|
|
|
"-DAVIF_BUILD_APPS=ON"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libaom
|
|
|
|
zlib
|
|
|
|
libpng
|
|
|
|
libjpeg
|
|
|
|
dav1d
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-11 12:50:04 +00:00
|
|
|
description = "C implementation of the AV1 Image File Format";
|
|
|
|
longDescription = ''
|
|
|
|
Libavif aims to be a friendly, portable C implementation of the
|
|
|
|
AV1 Image File Format. It is a work-in-progress, but can already
|
|
|
|
encode and decode all AOM supported YUV formats and bit depths
|
|
|
|
(with alpha). It also features an encoder and a decoder
|
|
|
|
(avifenc/avifdec).
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/AOMediaCodec/libavif";
|
|
|
|
changelog = "https://github.com/AOMediaCodec/libavif/blob/v${version}/CHANGELOG.md";
|
|
|
|
maintainers = with maintainers; [ mkg20001 ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.bsd2;
|
|
|
|
};
|
|
|
|
}
|