2020-11-19 02:42:33 +00:00
|
|
|
{ stdenv, rustPlatform, fetchurl, fetchFromGitHub, lib, nasm, cargo-c }:
|
2019-12-14 18:18:31 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rav1e";
|
2021-01-13 16:53:31 +00:00
|
|
|
version = "0.4.0";
|
2019-12-14 18:18:31 +00:00
|
|
|
|
2020-11-19 02:42:33 +00:00
|
|
|
src = stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-${version}-source";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xiph";
|
|
|
|
repo = "rav1e";
|
|
|
|
rev = "v${version}";
|
2021-01-13 16:53:31 +00:00
|
|
|
sha256 = "09w4476x6bdmh9pv4lchrzvfvbjvxxraa9f4dlbwgli89lcg9fcf";
|
2020-11-19 02:42:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = fetchurl {
|
2021-01-13 16:53:31 +00:00
|
|
|
url = "https://github.com/xiph/rav1e/releases/download/v${version}/Cargo.lock";
|
|
|
|
sha256 = "0rkyi010z6qmwdpvzlzyrrhs8na929g11lszhbqx5y0gh3y5nyik";
|
2020-11-19 02:42:33 +00:00
|
|
|
};
|
2019-12-14 18:18:31 +00:00
|
|
|
|
2020-11-19 02:42:33 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r ./* $out/
|
|
|
|
cp ${cargoLock} $out/Cargo.lock
|
|
|
|
'';
|
|
|
|
};
|
2019-12-14 18:18:31 +00:00
|
|
|
|
2021-01-13 16:53:31 +00:00
|
|
|
cargoSha256 = "1iza2cws28hd4a3q90mc90l8ql4bsgapdznfr6bl65cjam43i5sg";
|
2020-06-18 17:17:54 +01:00
|
|
|
nativeBuildInputs = [ nasm cargo-c ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
cargo cbuild --release --frozen --prefix=${placeholder "out"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cargo cinstall --release --frozen --prefix=${placeholder "out"}
|
|
|
|
'';
|
2019-12-14 18:18:31 +00: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 13:07:16 +00:00
|
|
|
homepage = "https://github.com/xiph/rav1e";
|
2020-05-29 20:16:25 +01:00
|
|
|
changelog = "https://github.com/xiph/rav1e/releases/tag/v${version}";
|
2019-12-14 18:18:31 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = [ maintainers.primeos ];
|
|
|
|
};
|
|
|
|
}
|