at release-16.03-start 108 lines 3.4 kB view raw
1{ lib, stdenv, fetchurl, perl, gmp ? null 2, aclSupport ? false, acl ? null 3, selinuxSupport? false, libselinux ? null, libsepol ? null 4, autoconf, automake114x, texinfo 5, withPrefix ? false 6}: 7 8assert aclSupport -> acl != null; 9assert selinuxSupport -> libselinux != null && libsepol != null; 10 11with lib; 12 13let 14 self = stdenv.mkDerivation rec { 15 name = "coreutils-8.25"; 16 17 src = fetchurl { 18 url = "mirror://gnu/coreutils/${name}.tar.xz"; 19 sha256 = "11yfrnb94xzmvi4lhclkcmkqsbhww64wf234ya1aacjvg82prrii"; 20 }; 21 22 patches = optional stdenv.isCygwin ./coreutils-8.23-4.cygwin.patch; 23 24 # The test tends to fail on btrfs and maybe other unusual filesystems. 25 postPatch = optionalString (!stdenv.isDarwin) '' 26 sed '2i echo Skipping dd sparse test && exit 0' -i ./tests/dd/sparse.sh 27 sed '2i echo Skipping cp sparse test && exit 0' -i ./tests/cp/sparse.sh 28 ''; 29 30 configureFlags = optionalString stdenv.isSunOS "ac_cv_func_inotify_init=no"; 31 32 nativeBuildInputs = [ perl ]; 33 buildInputs = [ gmp ] 34 ++ optional aclSupport acl 35 ++ optionals stdenv.isCygwin [ autoconf automake114x texinfo ] # due to patch 36 ++ optionals selinuxSupport [ libselinux libsepol ]; 37 38 crossAttrs = { 39 buildInputs = [ gmp.crossDrv ] 40 ++ optional aclSupport acl.crossDrv 41 ++ optionals selinuxSupport [ libselinux.crossDrv libsepol.crossDrv ] 42 ++ optional (stdenv.ccCross.libc ? libiconv) 43 stdenv.ccCross.libc.libiconv.crossDrv; 44 45 buildPhase = '' 46 make || ( 47 pushd man 48 for a in *.x; do 49 touch `basename $a .x`.1 50 done 51 popd; make ) 52 ''; 53 54 postInstall = '' 55 rm $out/share/man/man1/* 56 cp ${self}/share/man/man1/* $out/share/man/man1 57 ''; 58 59 # Needed for fstatfs() 60 # I don't know why it is not properly detected cross building with glibc. 61 configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ]; 62 doCheck = false; 63 }; 64 65 # The tests are known broken on Cygwin 66 # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025), 67 # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351), 68 # and {Open,Free}BSD. 69 doCheck = stdenv ? glibc; 70 71 # Saw random failures like ‘help2man: can't get '--help' info from 72 # man/sha512sum.td/sha512sum’. 73 enableParallelBuilding = false; 74 75 NIX_LDFLAGS = optionalString selinuxSupport "-lsepol"; 76 FORCE_UNSAFE_CONFIGURE = optionalString stdenv.isSunOS "1"; 77 78 makeFlags = optionalString stdenv.isDarwin "CFLAGS=-D_FORTIFY_SOURCE=0"; 79 80 # e.g. ls -> gls; grep -> ggrep 81 postFixup = optionalString withPrefix 82 '' 83 ( 84 cd "$out/bin" 85 find * -type f -executable -exec mv {} g{} \; 86 ) 87 ''; 88 89 meta = { 90 homepage = http://www.gnu.org/software/coreutils/; 91 description = "The basic file, shell and text manipulation utilities of the GNU operating system"; 92 93 longDescription = '' 94 The GNU Core Utilities are the basic file, shell and text 95 manipulation utilities of the GNU operating system. These are 96 the core utilities which are expected to exist on every 97 operating system. 98 ''; 99 100 license = licenses.gpl3Plus; 101 102 platforms = platforms.all; 103 104 maintainers = [ maintainers.eelco ]; 105 }; 106 }; 107in 108 self