Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport staging-24.11] Reapply: rav1e: remove build-time dependency on libgit2 #362712

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions pkgs/by-name/ra/rav1e/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
stdenv,
rustPlatform,
fetchCrate,
pkg-config,
cargo-c,
darwin,
libgit2,
libiconv,
nasm,
nix-update-script,
testers,
zlib,
rav1e,
}:

Expand All @@ -27,28 +22,24 @@ rustPlatform.buildRustPackage rec {

cargoHash = "sha256-VyQ6n2kIJ7OjK6Xlf0T0GNsBvgESRETzKZDZzAn8ZuY=";

depsBuildBuild = [ pkg-config ];

nativeBuildInputs = [
cargo-c
libgit2
nasm
];

buildInputs =
[ zlib ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
darwin.apple_sdk.frameworks.Security
];
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")'

# Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library
# and linking it with cctools ld64.
postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
substituteInPlace build.rs --replace-fail '.arg("-x")' '.arg("-S")'
# Thin LTO doesn’t appear to work with Rust 1.79. rav1e fail to build when building fern.
substituteInPlace Cargo.toml --replace-fail 'lto = "thin"' 'lto = "fat"'
'';
# Thin LTO doesn’t 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";

Expand Down
Loading