mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
212c28ec39
This is a native build input because it's used at build time by the "built" crate, which tries to embed git info and build timestamps into the binary (ugh). This fixes cross-compilation from x86_64 to aarch64, because git2's build.rs tries to use -m64, which is x86_64-only.
62 lines
1.5 KiB
Nix
62 lines
1.5 KiB
Nix
{ lib
|
|
, rust
|
|
, stdenv
|
|
, rustPlatform
|
|
, fetchCrate
|
|
, pkg-config
|
|
, cargo-c
|
|
, libgit2
|
|
, nasm
|
|
, zlib
|
|
, libiconv
|
|
, Security
|
|
}:
|
|
|
|
let
|
|
rustTargetPlatformSpec = rust.toRustTargetSpec stdenv.hostPlatform;
|
|
in rustPlatform.buildRustPackage rec {
|
|
pname = "rav1e";
|
|
version = "0.6.1";
|
|
|
|
src = fetchCrate {
|
|
inherit pname version;
|
|
sha256 = "sha256-70O9/QRADaEYVvZjEfuBOxPF8lCZ138L2fbFWpj3VUw=";
|
|
};
|
|
|
|
cargoHash = "sha256-iHOmItooNsGq6iTIb9M5IPXMwYh2nQ03qfjomkgCdgw=";
|
|
|
|
auditable = true; # TODO: remove when this is the default
|
|
|
|
depsBuildBuild = [ pkg-config ];
|
|
|
|
nativeBuildInputs = [ cargo-c libgit2 nasm zlib ];
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
libiconv
|
|
Security
|
|
];
|
|
|
|
checkType = "debug";
|
|
|
|
postBuild = ''
|
|
cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec}
|
|
'';
|
|
|
|
postInstall = ''
|
|
cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${rustTargetPlatformSpec}
|
|
'';
|
|
|
|
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
|
|
'';
|
|
homepage = "https://github.com/xiph/rav1e";
|
|
changelog = "https://github.com/xiph/rav1e/releases/tag/v${version}";
|
|
license = licenses.bsd2;
|
|
maintainers = [ ];
|
|
};
|
|
}
|