git: fix darwin to linux cross-compilation

This commit is contained in:
Simon Žlender 2024-10-12 00:46:33 +02:00
parent d5bb004558
commit 9dab1c76b5

View File

@ -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