@@ -0,0 +1,60 @@
1+{ stdenv
2+, fetchFromGitHub
3+, libaom
4+, cmake
5+, pkg-config
6+, zlib
7+, libpng
8+, libjpeg
9+, dav1d
10+}:
11+
12+stdenv.mkDerivation rec {
13+ pname = "libavif";
14+ version = "0.8.1";
15+
16+ src = fetchFromGitHub {
17+ owner = "AOMediaCodec";
18+ repo = pname;
19+ rev = "v${version}";
20+ sha256 = "1fs222cn1d60pv5fjsr92axk5dival70b6yqw0wng5ikk9zsdkhy";
21+ };
22+
23+ # reco: encode libaom slowest but best, decode dav1d fastest
24+
25+ cmakeFlags = [
26+ "-DBUILD_SHARED_LIBS=ON"
27+ "-DAVIF_CODEC_AOM=ON"
28+ "-DAVIF_CODEC_DAV1D=ON"
29+ "-DAVIF_BUILD_APPS=ON"
30+ ];
31+
32+ nativeBuildInputs = [
33+ cmake
34+ pkg-config
35+ ];
36+
37+ buildInputs = [
38+ libaom
39+ zlib
40+ libpng
41+ libjpeg
42+ dav1d
43+ ];
44+
45+ meta = with stdenv.lib; {
46+ description = "C implementation of the AV1 Image File Format";
47+ longDescription = ''
48+ Libavif aims to be a friendly, portable C implementation of the
49+ AV1 Image File Format. It is a work-in-progress, but can already
50+ encode and decode all AOM supported YUV formats and bit depths
51+ (with alpha). It also features an encoder and a decoder
52+ (avifenc/avifdec).
53+ '';
54+ homepage = "https://github.com/AOMediaCodec/libavif";
55+ changelog = "https://github.com/AOMediaCodec/libavif/blob/v${version}/CHANGELOG.md";
56+ maintainers = with maintainers; [ mkg20001 ];
57+ platforms = platforms.all;
58+ license = licenses.bsd2;
59+ };
60+}