summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorRyan Burns <rtburns@protonmail.com>2021-02-11 20:26:26 -0800
committerRyan Burns <rtburns@protonmail.com>2021-02-17 12:52:18 -0800
commit7c01f4b8fb82924225541a50996eba26ad67ecfe (patch)
tree9fc0f07341f2e5588d30d3fe9393a692bfcdf181 /pkgs/tools
parent29acad708dc8e8ef10ec7811e154f14924302e34 (diff)
downloadnixpkgs-7c01f4b8fb82924225541a50996eba26ad67ecfe.tar
nixpkgs-7c01f4b8fb82924225541a50996eba26ad67ecfe.tar.gz
nixpkgs-7c01f4b8fb82924225541a50996eba26ad67ecfe.tar.bz2
nixpkgs-7c01f4b8fb82924225541a50996eba26ad67ecfe.tar.lz
nixpkgs-7c01f4b8fb82924225541a50996eba26ad67ecfe.tar.xz
nixpkgs-7c01f4b8fb82924225541a50996eba26ad67ecfe.tar.zst
nixpkgs-7c01f4b8fb82924225541a50996eba26ad67ecfe.zip
grub2: fix cross-compilation
* gettext is used for native binaries, not hosted libs
* grub2 expects `BUILD_CC` to point to a native C compiler
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index b97d086b972..318fbba876c 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -1,5 +1,6 @@
 { lib, stdenv, fetchgit, flex, bison, python3, autoconf, automake, gnulib, libtool
 , gettext, ncurses, libusb-compat-0_1, freetype, qemu, lvm2, unifont, pkg-config
+, pkgsBuildBuild
 , fuse # only needed for grub-mount
 , runtimeShell
 , zfs ? null
@@ -62,11 +63,13 @@ stdenv.mkDerivation rec {
     echo 'echo "Compile grub2 with { kbdcompSupport = true; } to enable support for this command."' >> util/grub-kbdcomp.in
   '';
 
-  nativeBuildInputs = [ bison flex python3 pkg-config autoconf automake ];
-  buildInputs = [ ncurses libusb-compat-0_1 freetype gettext lvm2 fuse libtool ]
+  nativeBuildInputs = [ bison flex python3 pkg-config autoconf automake gettext ];
+  buildInputs = [ ncurses libusb-compat-0_1 freetype lvm2 fuse libtool ]
     ++ optional doCheck qemu
     ++ optional zfsSupport zfs;
 
+  strictDeps = true;
+
   hardeningDisable = [ "all" ];
 
   # Work around a bug in the generated flex lexer (upstream flex bug?)
@@ -99,7 +102,10 @@ stdenv.mkDerivation rec {
       substituteInPlace ./configure --replace '/usr/share/fonts/unifont' '${unifont}/share/fonts'
     '';
 
-  configureFlags = [ "--enable-grub-mount" ] # dep of os-prober
+  configureFlags = [
+    "--enable-grub-mount" # dep of os-prober
+    "BUILD_CC=${pkgsBuildBuild.stdenv.cc}/bin/cc"
+  ]
     ++ optional zfsSupport "--enable-libzfs"
     ++ optionals efiSupport [ "--with-platform=efi" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}" "--program-prefix=" ]
     ++ optionals xenSupport [ "--with-platform=xen" "--target=${efiSystemsBuild.${stdenv.hostPlatform.system}.target}"];