about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmily2024-11-12 14:56:42 +0000
committerGitHub2024-11-12 14:56:42 +0000
commit18e6680cb4556afeccfe7149ece7b5284d4b2548 (patch)
treea577db85a6ae01db28d9712f3f33e0a190ec822a
parent95c55e6d11d59431b407234db42ef3c9f6a844d4 (diff)
parentc4a4f958cb5af702f61f88d0e762af1700c6a705 (diff)
rav1e: remove build-time dependency on libgit2 (#355325)
-rw-r--r--pkgs/by-name/ra/rav1e/package.nix33
1 files changed, 12 insertions, 21 deletions
diff --git a/pkgs/by-name/ra/rav1e/package.nix b/pkgs/by-name/ra/rav1e/package.nix
index e8834ac131e4..523b8e1de6a0 100644
--- a/pkgs/by-name/ra/rav1e/package.nix
+++ b/pkgs/by-name/ra/rav1e/package.nix
@@ -4,15 +4,10 @@
   stdenv,
   rustPlatform,
   fetchCrate,
-  pkg-config,
   cargo-c,
-  darwin,
-  libgit2,
-  libiconv,
   nasm,
   nix-update-script,
   testers,
-  zlib,
   rav1e,
 }:
 
@@ -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";