Files
nixpkgs/pkgs/by-name/ra/rav1e/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

73 lines
2.1 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
lib,
rust,
stdenv,
rustPlatform,
fetchCrate,
cargo-c,
nasm,
nix-update-script,
testers,
rav1e,
}:
rustPlatform.buildRustPackage rec {
pname = "rav1e";
version = "0.8.1";
src = fetchCrate {
inherit pname version;
hash = "sha256-GCfh2v3w5C8h4GuPKkTMUAhPspT1W0drrRpELCJWeTI=";
};
cargoHash = "sha256-KQsAEs608OyzwZtJRXw7Zwh5X+4yFJpacOMoij58vh0=";
nativeBuildInputs = [
cargo-c
nasm
];
postPatch = ''
# remove feature that requires libgit2 and is only used to print a version string
substituteInPlace Cargo.toml --replace-fail '"git_version",' ""
''
+ lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
# Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library
# and linking it with cctools ld64.
substituteInPlace build.rs --replace-fail '.arg("-x")' '.arg("-S")'
# Thin LTO doesnt appear to work with Rust 1.79. rav1e fail to build when building fern.
substituteInPlace Cargo.toml --replace-fail 'lto = "thin"' 'lto = "fat"'
'';
checkType = "debug";
postBuild = ''
${rust.envVars.setEnv} cargo cbuild --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
'';
postInstall = ''
${rust.envVars.setEnv} cargo cinstall --release --frozen --prefix=${placeholder "out"} --target ${stdenv.hostPlatform.rust.rustcTarget}
'';
passthru = {
tests.version = testers.testVersion { package = rav1e; };
updateScript = nix-update-script { };
};
meta = {
description = "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 = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ getchoo ];
mainProgram = "rav1e";
};
}