2021-04-05 15:23:46 +00:00
|
|
|
{ stdenv, rustPlatform, fetchurl, fetchFromGitHub, lib, nasm, cargo-c, libiconv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rav1e";
|
2021-04-05 15:23:46 +00:00
|
|
|
version = "0.4.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
src = stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-${version}-source";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xiph";
|
|
|
|
repo = "rav1e";
|
|
|
|
rev = "v${version}";
|
2021-04-05 15:23:46 +00:00
|
|
|
sha256 = "0jnq5a3fv6fzzbmprzfxidlcwwgblkwwm0135cfw741wjv7f7h6r";
|
2020-11-21 19:51:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
url = "https://github.com/xiph/rav1e/releases/download/v${version}/Cargo.lock";
|
2021-04-05 15:23:46 +00:00
|
|
|
sha256 = "14fi9wam9rs5206rvcd2f3sjpzq41pnfml14w74wn2ws3gpi46zn";
|
2020-11-21 19:51:51 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r ./* $out/
|
|
|
|
cp ${cargoLock} $out/Cargo.lock
|
|
|
|
'';
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
cargoSha256 = "1j92prjyr86wyx58h10xq9c9z28ky86h291x65w7qrxpj658aiz1";
|
2020-08-20 17:08:02 +00:00
|
|
|
nativeBuildInputs = [ nasm cargo-c ];
|
2021-04-05 15:23:46 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
cargo cbuild --release --frozen --prefix=${placeholder "out"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
cargo cinstall --release --frozen --prefix=${placeholder "out"}
|
|
|
|
'';
|
2020-04-24 23:36:52 +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-21 19:51:51 +00:00
|
|
|
homepage = "https://github.com/xiph/rav1e";
|
2020-06-02 18:00:15 +00:00
|
|
|
changelog = "https://github.com/xiph/rav1e/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|