From 841c32b0013ec67b1d220eb5d6cbe17a8b97062f Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:01:54 -0800 Subject: [PATCH 1/3] rav1e: remove build-time dependency on libgit2 --- pkgs/by-name/ra/rav1e/package.nix | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/ra/rav1e/package.nix b/pkgs/by-name/ra/rav1e/package.nix index dccb2d01a6b9a..34dda9e57e3e8 100644 --- a/pkgs/by-name/ra/rav1e/package.nix +++ b/pkgs/by-name/ra/rav1e/package.nix @@ -4,11 +4,10 @@ stdenv, rustPlatform, fetchCrate, - pkg-config, cargo-c, + darwin, + libiconv, nasm, - libgit2, - zlib, nix-update-script, testers, rav1e, @@ -23,30 +22,31 @@ rustPlatform.buildRustPackage rec { hash = "sha256-Db7qb7HBAy6lniIiN07iEzURmbfNtuhmgJRv7OUagUM="; }; - # update built to be able to use the system libgit2 - cargoPatches = [ ./update-built.diff ]; - cargoHash = "sha256-Ud9Vw31y8nLo0aC3j7XY1+mN/pRvH9gJ0uIq73hKy3Y="; - - depsBuildBuild = [ - pkg-config - libgit2 - zlib - ]; + cargoHash = "sha256-VyQ6n2kIJ7OjK6Xlf0T0GNsBvgESRETzKZDZzAn8ZuY="; nativeBuildInputs = [ cargo-c nasm ]; - env.LIBGIT2_NO_VENDOR = 1; + buildInputs = 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"; From fab8f4325c0534d7d63d46a2fafe89cee5e29e46 Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:03:00 -0800 Subject: [PATCH 2/3] rav1e: use new Darwin SDK pattern --- pkgs/by-name/ra/rav1e/package.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkgs/by-name/ra/rav1e/package.nix b/pkgs/by-name/ra/rav1e/package.nix index 34dda9e57e3e8..523b8e1de6a04 100644 --- a/pkgs/by-name/ra/rav1e/package.nix +++ b/pkgs/by-name/ra/rav1e/package.nix @@ -5,8 +5,6 @@ rustPlatform, fetchCrate, cargo-c, - darwin, - libiconv, nasm, nix-update-script, testers, @@ -29,11 +27,6 @@ rustPlatform.buildRustPackage rec { nasm ]; - buildInputs = 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 From 9c1453889c82f0a86cfe748b2a2b49c8c9680d0a Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Sun, 1 Dec 2024 23:45:12 -0800 Subject: [PATCH 3/3] rav1e: removed unused cargo patch --- pkgs/by-name/ra/rav1e/update-built.diff | 40 ------------------------- 1 file changed, 40 deletions(-) delete mode 100644 pkgs/by-name/ra/rav1e/update-built.diff diff --git a/pkgs/by-name/ra/rav1e/update-built.diff b/pkgs/by-name/ra/rav1e/update-built.diff deleted file mode 100644 index 3b2a027545d96..0000000000000 --- a/pkgs/by-name/ra/rav1e/update-built.diff +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/Cargo.lock b/Cargo.lock -index 6825377..8512eba 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -242,9 +242,9 @@ dependencies = [ - - [[package]] - name = "built" --version = "0.7.1" -+version = "0.7.5" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "38d17f4d6e4dc36d1a02fbedc2753a096848e7c1b0772f7654eab8e2c927dd53" -+checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" - dependencies = [ - "git2", - ] -@@ -633,9 +633,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - - [[package]] - name = "git2" --version = "0.18.1" -+version = "0.19.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" -+checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" - dependencies = [ - "bitflags 2.4.1", - "libc", -@@ -845,9 +845,9 @@ dependencies = [ - - [[package]] - name = "libgit2-sys" --version = "0.16.1+1.7.1" -+version = "0.17.0+1.8.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" -+checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" - dependencies = [ - "cc", - "libc",