From 6e46232ca25c044691a2b423a2e96c4b385d9ac5 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Sat, 16 Oct 2021 21:25:13 +0200 Subject: [PATCH] xorg.xinit: fix cross-compiling --- pkgs/servers/x11/xorg/overrides.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 9b119aa7101..3a6ec31ad75 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -779,6 +779,7 @@ self: super: stdenv = if isDarwin then clangStdenv else stdenv; }).overrideAttrs (attrs: { buildInputs = attrs.buildInputs ++ lib.optional isDarwin bootstrap_cmds; + depsBuildBuild = [ buildPackages.stdenv.cc ]; configureFlags = [ "--with-xserver=${self.xorgserver.out}/bin/X" ] ++ lib.optionals isDarwin [ @@ -794,6 +795,10 @@ self: super: sha256 = "18kb88i3s9nbq2jxl7l2hyj6p56c993hivk8mzxg811iqbbawkp7"; }) ]; + postPatch = '' + # Avoid replacement of word-looking cpp's builtin macros in Nix's cross-compiled paths + substituteInPlace Makefile.in --replace "PROGCPPDEFS =" "PROGCPPDEFS = -Dlinux=linux -Dunix=unix" + ''; propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ self.xauth ] ++ lib.optionals isDarwin [ self.libX11 self.xorgproto ]; postFixup = ''