minimal-bootstrap.coreutils-musl: init at 9.4

+81
+74
pkgs/os-specific/linux/minimal-bootstrap/coreutils/musl.nix
··· 1 + { lib 2 + , buildPlatform 3 + , hostPlatform 4 + , fetchurl 5 + , bash 6 + , tinycc 7 + , gnumake 8 + , gnugrep 9 + , gnused 10 + , gawk 11 + , gnutar 12 + , gzip 13 + }: 14 + let 15 + pname = "coreutils"; 16 + version = "9.4"; 17 + 18 + src = fetchurl { 19 + url = "mirror://gnu/coreutils/coreutils-${version}.tar.gz"; 20 + hash = "sha256-X2ANkJOXOwr+JTk9m8GMRPIjJlf0yg2V6jHHAutmtzk="; 21 + }; 22 + 23 + configureFlags = [ 24 + "--prefix=${placeholder "out"}" 25 + "--build=${buildPlatform.config}" 26 + "--host=${hostPlatform.config}" 27 + # musl 1.1.x doesn't use 64bit time_t 28 + "--disable-year2038" 29 + # libstdbuf.so fails in static builds 30 + "--enable-no-install-program=stdbuf" 31 + ]; 32 + in 33 + bash.runCommand "${pname}-${version}" { 34 + inherit pname version; 35 + 36 + nativeBuildInputs = [ 37 + tinycc.compiler 38 + gnumake 39 + gnused 40 + gnugrep 41 + gawk 42 + gnutar 43 + gzip 44 + ]; 45 + 46 + passthru.tests.get-version = result: 47 + bash.runCommand "${pname}-get-version-${version}" {} '' 48 + ${result}/bin/cat --version 49 + mkdir $out 50 + ''; 51 + 52 + meta = with lib; { 53 + description = "The GNU Core Utilities"; 54 + homepage = "https://www.gnu.org/software/coreutils"; 55 + license = licenses.gpl3Plus; 56 + maintainers = teams.minimal-bootstrap.members; 57 + platforms = platforms.unix; 58 + }; 59 + } '' 60 + # Unpack 61 + tar xzf ${src} 62 + cd coreutils-${version} 63 + 64 + # Configure 65 + export CC="tcc -B ${tinycc.libs}/lib" 66 + export LD=tcc 67 + bash ./configure ${lib.concatStringsSep " " configureFlags} 68 + 69 + # Build 70 + make -j $NIX_BUILD_CORES AR="tcc -ar" MAKEINFO="true" 71 + 72 + # Install 73 + make -j $NIX_BUILD_CORES install MAKEINFO="true" 74 + ''
+7
pkgs/os-specific/linux/minimal-bootstrap/default.nix
··· 32 32 }; 33 33 34 34 coreutils = callPackage ./coreutils { tinycc = tinycc-mes; }; 35 + coreutils-musl = callPackage ./coreutils/musl.nix { 36 + bash = bash_2_05; 37 + tinycc = tinycc-musl; 38 + gnumake = gnumake-musl; 39 + gnutar = gnutar-musl; 40 + }; 35 41 36 42 diffutils = callPackage ./diffutils { 37 43 bash = bash_2_05; ··· 168 174 echo ${bash_2_05.tests.get-version} 169 175 echo ${binutils.tests.get-version} 170 176 echo ${bzip2.tests.get-version} 177 + echo ${coreutils-musl.tests.get-version} 171 178 echo ${diffutils.tests.get-version} 172 179 echo ${findutils.tests.get-version} 173 180 echo ${gawk-mes.tests.get-version}