From ee7de87ba1eb94d03a341b84a8181d4a12082cb2 Mon Sep 17 00:00:00 2001 From: Michael Eden Date: Thu, 21 Mar 2019 14:44:47 -0400 Subject: [PATCH] nix: replace build utils with host utils in config.nix --- pkgs/tools/package-management/nix/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index d725692f40541..fb2587845d4a2 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -9,6 +9,7 @@ let common = { lib, stdenv, fetchurl, fetchpatch, perl, curl, bzip2, sqlite, openssl ? null, xz + , bash, coreutils, gzip, gnutar , pkgconfig, boehmgc, perlPackages, libsodium, brotli, boost, editline , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook_xsl_ns , busybox-sandbox-shell @@ -99,6 +100,21 @@ common = export TMPDIR=$NIX_BUILD_TOP ''; + # substitute build-time binaries with host-binaries + preInstall = '' + substituteInPlace corepkgs/config.nix.in \ + --subst-var-by bash ${bash}/bin/bash \ + --subst-var-by coreutils ${coreutils}/bin \ + --subst-var-by bzip2 ${bzip2}/bin/bzip2 \ + --subst-var-by gzip ${gzip}/bin/gzip \ + --subst-var-by xz ${xz}/bin/xz \ + --subst-var-by tar ${gnutar}/bin/tar \ + --subst-var-by tr ${coreutils}/bin/tr + + substituteInPlace scripts/nix-profile.sh.in \ + --subst-var-by coreutils ${coreutils}/bin + ''; + separateDebugInfo = stdenv.isLinux; enableParallelBuilding = true;