From d5bb004558003d0e79402edd12a7657ba355c5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20=C5=BDlender?= Date: Sat, 12 Oct 2024 18:42:17 +0200 Subject: [PATCH 1/2] deterministic-uname: use forPlatform for FreeBSD --- pkgs/build-support/deterministic-uname/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/deterministic-uname/default.nix b/pkgs/build-support/deterministic-uname/default.nix index 9efaa2558bfb6..1a4e0a0f089b7 100644 --- a/pkgs/build-support/deterministic-uname/default.nix +++ b/pkgs/build-support/deterministic-uname/default.nix @@ -31,7 +31,7 @@ substituteAll { then "GNU/Linux" else if forPlatform.isDarwin then "Darwin" # darwin isn't in host-os.m4 so where does this come from? - else if stdenv.buildPlatform.isFreeBSD + else if forPlatform.isFreeBSD then "FreeBSD" else "unknown"; From 9dab1c76b5cc49148217d3b79bbca557e830a571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20=C5=BDlender?= Date: Sat, 12 Oct 2024 00:46:33 +0200 Subject: [PATCH 2/2] git: fix darwin to linux cross-compilation --- pkgs/applications/version-management/git/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index a950be71fed2f..1b4f736ed63f8 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -20,6 +20,7 @@ , gzip # needed at runtime by gitweb.cgi , withSsh ? false , sysctl +, deterministic-host-uname # trick Makefile into targeting the host platform when cross-compiling , doInstallCheck ? !stdenv.hostPlatform.isDarwin # extremely slow on darwin , tests }: @@ -84,7 +85,7 @@ stdenv.mkDerivation (finalAttrs: { done ''; - nativeBuildInputs = [ gettext perlPackages.perl makeWrapper pkg-config ] + nativeBuildInputs = [ deterministic-host-uname gettext perlPackages.perl makeWrapper pkg-config ] ++ lib.optionals withManual [ asciidoc texinfo xmlto docbook2x docbook_xsl docbook_xml_dtd_45 libxslt ]; buildInputs = [ curl openssl zlib expat cpio (if stdenv.hostPlatform.isFreeBSD then libiconvReal else libiconv) bash ] @@ -130,8 +131,7 @@ 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.isFreeBSD && stdenv.hostPlatform != stdenv.buildPlatform) "uname_S=FreeBSD"; + ++ lib.optional stdenv.hostPlatform.isDarwin "TKFRAMEWORK=/nonexistent"; disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ stdenv.shellPackage