git: add rust opt-in (#476300)

This commit is contained in:
Philip Taron
2026-01-02 21:46:00 +00:00
committed by GitHub
+10 -1
View File
@@ -51,6 +51,9 @@
deterministic-host-uname, # trick Makefile into targeting the host platform when cross-compiling
doInstallCheck ? !stdenv.hostPlatform.isDarwin, # extremely slow on darwin
tests,
rustSupport ? false,
cargo,
rustc,
}:
assert osxkeychainSupport -> stdenv.hostPlatform.isDarwin;
@@ -186,6 +189,10 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals withLibsecret [
glib
libsecret
]
++ lib.optionals rustSupport [
cargo
rustc
];
# required to support pthread_cancel()
@@ -234,7 +241,9 @@ stdenv.mkDerivation (finalAttrs: {
# acceptable version.
#
# See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706
++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent";
++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent"
# Starting with future Git version 3.0.0, rust will be mandatory. For now, it's optional.
++ lib.optional rustSupport "WITH_RUST=YesPlease";
disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
stdenv.shellPackage