coreutils: Use buildPackages instead of self hack for native version

This commit is contained in:
John Ericson 2017-01-15 13:28:35 -05:00
parent bf17d6dacf
commit eee7cafaf7

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, perl, xz, gmp ? null { lib, stdenv, buildPackages, fetchurl, perl, xz, gmp ? null
, aclSupport ? false, acl ? null , aclSupport ? false, acl ? null
, attrSupport ? false, attr ? null , attrSupport ? false, attr ? null
, selinuxSupport? false, libselinux ? null, libsepol ? null , selinuxSupport? false, libselinux ? null, libsepol ? null
@ -12,8 +12,7 @@ assert selinuxSupport -> libselinux != null && libsepol != null;
with lib; with lib;
let stdenv.mkDerivation rec {
self = stdenv.mkDerivation rec {
name = "coreutils-8.26"; name = "coreutils-8.26";
src = fetchurl { src = fetchurl {
@ -63,12 +62,12 @@ let
# Works around a bug with 8.26: # Works around a bug with 8.26:
# Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop. # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
preInstall = '' preInstall = ''
sed -i Makefile -e 's|^INSTALL =.*|INSTALL = ${self}/bin/install -c|' sed -i Makefile -e 's|^INSTALL =.*|INSTALL = ${buildPackages.coreutils}/bin/install -c|'
''; '';
postInstall = '' postInstall = ''
rm $out/share/man/man1/* rm $out/share/man/man1/*
cp ${self}/share/man/man1/* $out/share/man/man1 cp ${buildPackages.coreutils}/share/man/man1/* $out/share/man/man1
''; '';
# Needed for fstatfs() # Needed for fstatfs()
@ -110,6 +109,4 @@ let
maintainers = [ maintainers.eelco ]; maintainers = [ maintainers.eelco ];
}; };
}; }
in
self