From 7bfd3a8454834170035b6034ec37029e1cf3f1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6gler?= Date: Sun, 17 Oct 2021 11:06:26 +0200 Subject: [PATCH] gitMinimal: Fix wrong shell for cross compiled package --- .../version-management/git-and-tools/git/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 521e42e845f2..156bf1fb3cd5 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -97,8 +97,10 @@ stdenv.mkDerivation { makeFlags = [ "prefix=\${out}" - "SHELL_PATH=${stdenv.shell}" ] + # Git does not allow setting a shell separately for building and run-time. + # Therefore lets leave it at the default /bin/sh when cross-compiling + ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "SHELL_PATH=${stdenv.shell}" ++ (if perlSupport then ["PERL_PATH=${perlPackages.perl}/bin/perl"] else ["NO_PERL=1"]) ++ (if pythonSupport then ["PYTHON_PATH=${python3}/bin/python"] else ["NO_PYTHON=1"]) ++ lib.optionals stdenv.isSunOS ["INSTALL=install" "NO_INET_NTOP=" "NO_INET_PTON="] @@ -115,6 +117,10 @@ stdenv.mkDerivation { # See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706 ++ lib.optional stdenv.isDarwin "TKFRAMEWORK=/nonexistent"; + disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + stdenv.shellPackage + ]; + postBuild = '' make -C contrib/subtree