Skip to content

Commit 18e6680

Browse files
authored
rav1e: remove build-time dependency on libgit2 (#355325)
2 parents 95c55e6 + c4a4f95 commit 18e6680

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

pkgs/by-name/ra/rav1e/package.nix

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@
44
stdenv,
55
rustPlatform,
66
fetchCrate,
7-
pkg-config,
87
cargo-c,
9-
darwin,
10-
libgit2,
11-
libiconv,
128
nasm,
139
nix-update-script,
1410
testers,
15-
zlib,
1611
rav1e,
1712
}:
1813

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

2823
cargoHash = "sha256-VyQ6n2kIJ7OjK6Xlf0T0GNsBvgESRETzKZDZzAn8ZuY=";
2924

30-
depsBuildBuild = [ pkg-config ];
31-
3225
nativeBuildInputs = [
3326
cargo-c
34-
libgit2
3527
nasm
3628
];
3729

38-
buildInputs =
39-
[ zlib ]
40-
++ lib.optionals stdenv.hostPlatform.isDarwin [
41-
libiconv
42-
darwin.apple_sdk.frameworks.Security
43-
];
30+
postPatch =
31+
''
32+
# remove feature that requires libgit2 and is only used to print a version string
33+
substituteInPlace Cargo.toml --replace-fail '"git_version",' ""
34+
''
35+
+ lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
36+
# Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library
37+
# and linking it with cctools ld64.
38+
substituteInPlace build.rs --replace-fail '.arg("-x")' '.arg("-S")'
4439
45-
# Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library
46-
# and linking it with cctools ld64.
47-
postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
48-
substituteInPlace build.rs --replace-fail '.arg("-x")' '.arg("-S")'
49-
# Thin LTO doesn’t appear to work with Rust 1.79. rav1e fail to build when building fern.
50-
substituteInPlace Cargo.toml --replace-fail 'lto = "thin"' 'lto = "fat"'
51-
'';
40+
# Thin LTO doesn’t appear to work with Rust 1.79. rav1e fail to build when building fern.
41+
substituteInPlace Cargo.toml --replace-fail 'lto = "thin"' 'lto = "fat"'
42+
'';
5243

5344
checkType = "debug";
5445

0 commit comments

Comments
 (0)