anchor.diff:  
     # Works around a bug with 8.26:
     # Makefile:3440: *** Recursive variable 'INSTALL' references itself (eventually).  Stop.
  -  preInstall = optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
  +  preInstall = optionalString isCross ''
       sed -i Makefile -e 's|^INSTALL =.*|INSTALL = ${buildPackages.coreutils}/bin/install -c|'
     '';
   
  -  postInstall = optionalString (stdenv.hostPlatform != stdenv.buildPlatform && !minimal) ''
  +  postInstall = optionalString (isCross && !minimal) ''
       rm $out/share/man/man1/*
       cp ${buildPackages.coreutils-full}/share/man/man1/* $out/share/man/man1
     ''
  
positive.code: { stdenv, lib, buildPackages
  , autoreconfHook, bison, texinfo, fetchurl, perl, xz, libiconv, gmp ? null
  , aclSupport ? stdenv.isLinux, acl ? null
  , attrSupport ? stdenv.isLinux, attr ? null
  , selinuxSupport? false, libselinux ? null, libsepol ? null
  # No openssl in default version, so openssl-induced rebuilds aren't too big.
  # It makes *sum functions significantly faster.
  , minimal ? true, withOpenssl ? !minimal, openssl ? null
  , withPrefix ? false
  , singleBinary ? "symlinks" # you can also pass "shebangs" or false
  }:
  
  # Note: this package is used for bootstrapping fetchurl, and thus
  # cannot use fetchpatch! All mutable patches (generated by GitHub or
  # cgit) that are needed here should be included directly in Nixpkgs as
  # files.
  
  assert aclSupport -> acl != null;
  assert selinuxSupport -> libselinux != null && libsepol != null;
  
  with lib;
  
  stdenv.mkDerivation (rec {
    pname = "coreutils${optionalString (!minimal) "-full"}";
    version = "9.1";
  
    src = fetchurl {
  
negative.code: 
      # intermittent failures on builders, unknown reason
      sed '2i echo Skipping du basic test && exit 77' -i ./tests/du/basic.sh
    '' + (optionalString (stdenv.hostPlatform.libc == "musl") (concatStringsSep "\n" [
      ''
        echo "int main() { return 77; }" > gnulib-tests/test-parse-datetime.c
        echo "int main() { return 77; }" > gnulib-tests/test-getlogin.c
  