2021-10-08 03:10:22 +02:00
|
|
|
{ lib, rust, stdenv, rustPlatform, fetchCrate, nasm, cargo-c, libiconv }:
|
2019-12-14 19:18:31 +01:00
|
|
|
|
2021-05-31 00:29:16 +02:00
|
|
|
let
|
|
|
|
rustTargetPlatformSpec = rust.toRustTargetSpec stdenv.hostPlatform;
|
|
|
|
in rustPlatform.buildRustPackage rec {
|
2019-12-14 19:18:31 +01:00
|
|
|
pname = "rav1e";
|
2022-01-20 15:24:48 +01:00
|
|
|
version = "0.5.1";
|
2019-12-14 19:18:31 +01:00
|
|
|
|
2021-10-08 03:10:22 +02:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2022-01-20 15:24:48 +01:00
|
|
|
sha256 = "sha256-v2i/dMWos+nB3cRDOkROSOPb1ONRosbmp9RDZI2DLeI=";
|
2020-11-19 03:42:33 +01:00
|
|
|
};
|
2019-12-14 19:18:31 +01:00
|
|
|
|
2022-01-20 15:24:48 +01:00
|
|
|
cargoSha256 = "sha256-V9QbztkFj3t5yBV+yySysDy3Q6IUY4gNzBL8h23aEg4=";
|
2021-10-08 03:10:22 +02:00
|
|
|
|
2020-06-18 18:17:54 +02:00
|
|
|
nativeBuildInputs = [ nasm cargo-c ];
|
2021-04-01 14:05:00 +02:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
2020-06-18 18:17:54 +02:00
|
|
|
|
2021-12-06 07:24:28 +01:00
|
|
|
checkType = "debug";
|
|
|
|
|
2020-06-18 18:17:54 +02:00
|
|
|
postBuild = ''
|
2021-05-31 00:29:16 +02:00
|
|
|
cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec}
|
2020-06-18 18:17:54 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-05-31 00:29:16 +02:00
|
|
|
cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec}
|
2020-06-18 18:17:54 +02:00
|
|
|
'';
|
2019-12-14 19:18:31 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The fastest and safest AV1 encoder";
|
|
|
|
longDescription = ''
|
|
|
|
rav1e is an AV1 video encoder. It is designed to eventually cover all use
|
|
|
|
cases, though in its current form it is most suitable for cases where
|
|
|
|
libaom (the reference encoder) is too slow.
|
|
|
|
Features: https://github.com/xiph/rav1e#features
|
|
|
|
'';
|
2020-11-19 14:07:16 +01:00
|
|
|
homepage = "https://github.com/xiph/rav1e";
|
2020-05-29 21:16:25 +02:00
|
|
|
changelog = "https://github.com/xiph/rav1e/releases/tag/v${version}";
|
2019-12-14 19:18:31 +01:00
|
|
|
license = licenses.bsd2;
|
2021-05-16 13:24:22 +02:00
|
|
|
maintainers = [ ];
|
2019-12-14 19:18:31 +01:00
|
|
|
};
|
|
|
|
}
|