summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmily <hello@emily.moe>2024-11-12 15:19:11 +0000
committerGitHub <noreply@github.com>2024-11-12 15:19:11 +0000
commit815716364992b5c5c9824e15abd290b38dec65db (patch)
treed5a4d008171b5502256a7110ca52973c0e317080
parentnixos/fail2ban: fix typo (#355328) (diff)
downloadnixpkgs-origin/revert-355325-rav1e-remove-libgit.tar.gz
Revert "rav1e: remove build-time dependency on libgit2"origin/revert-355325-rav1e-remove-libgit
-rw-r--r--pkgs/by-name/ra/rav1e/package.nix33
1 files changed, 21 insertions, 12 deletions
diff --git a/pkgs/by-name/ra/rav1e/package.nix b/pkgs/by-name/ra/rav1e/package.nix
index 523b8e1de6a0..e8834ac131e4 100644
--- a/pkgs/by-name/ra/rav1e/package.nix
+++ b/pkgs/by-name/ra/rav1e/package.nix
@@ -4,10 +4,15 @@
stdenv,
rustPlatform,
fetchCrate,
+ pkg-config,
cargo-c,
+ darwin,
+ libgit2,
+ libiconv,
nasm,
nix-update-script,
testers,
+ zlib,
rav1e,
}:
@@ -22,24 +27,28 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-VyQ6n2kIJ7OjK6Xlf0T0GNsBvgESRETzKZDZzAn8ZuY=";
+ depsBuildBuild = [ pkg-config ];
+
nativeBuildInputs = [
cargo-c
+ libgit2
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")'
+ buildInputs =
+ [ zlib ]
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
+ libiconv
+ darwin.apple_sdk.frameworks.Security
+ ];
- # 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"'
- '';
+ # 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"'
+ '';
checkType = "debug";