From 61a1ffbcb2c3c5387eb37589ee0a769d31675ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Sun, 20 Sep 2020 01:55:56 +0200 Subject: [PATCH] libavif: init at 0.8.1 --- .../development/libraries/libavif/default.nix | 60 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/development/libraries/libavif/default.nix diff --git a/pkgs/development/libraries/libavif/default.nix b/pkgs/development/libraries/libavif/default.nix new file mode 100644 index 000000000000..7b6d1ecfbb27 --- /dev/null +++ b/pkgs/development/libraries/libavif/default.nix @@ -0,0 +1,60 @@ +{ stdenv +, fetchFromGitHub +, libaom +, cmake +, pkg-config +, zlib +, libpng +, libjpeg +, dav1d +}: + +stdenv.mkDerivation rec { + pname = "libavif"; + version = "0.8.1"; + + src = fetchFromGitHub { + owner = "AOMediaCodec"; + repo = pname; + rev = "v${version}"; + sha256 = "1fs222cn1d60pv5fjsr92axk5dival70b6yqw0wng5ikk9zsdkhy"; + }; + + # reco: encode libaom slowest but best, decode dav1d fastest + + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DAVIF_CODEC_AOM=ON" + "-DAVIF_CODEC_DAV1D=ON" + "-DAVIF_BUILD_APPS=ON" + ]; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + libaom + zlib + libpng + libjpeg + dav1d + ]; + + meta = with stdenv.lib; { + 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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04e0f41e13ee..df09e1c939f6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13207,6 +13207,8 @@ in libavc1394 = callPackage ../development/libraries/libavc1394 { }; + libavif = callPackage ../development/libraries/libavif { }; + libb2 = callPackage ../development/libraries/libb2 { }; libbap = callPackage ../development/libraries/libbap {