diff --git a/pkgs/os-specific/linux/minimal-bootstrap/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/default.nix index 5dd0860ac1f..1c286e73aa1 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/default.nix @@ -42,6 +42,12 @@ lib.makeScope coreutils = callPackage ./coreutils { tinycc = tinycc-mes; }; + diffutils = callPackage ./diffutils { + bash = bash_2_05; + gcc = gcc2; + glibc = glibc22; + }; + gawk = callPackage ./gawk { bash = bash_2_05; tinycc = tinycc-mes; @@ -134,6 +140,7 @@ lib.makeScope echo ${binutils.tests.get-version} echo ${binutils-mes.tests.get-version} echo ${bzip2.tests.get-version} + echo ${diffutils.tests.get-version} echo ${gawk.tests.get-version} echo ${gcc2.tests.get-version} echo ${gcc2-mes.tests.get-version} diff --git a/pkgs/os-specific/linux/minimal-bootstrap/diffutils/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/diffutils/default.nix new file mode 100644 index 00000000000..7545a52524a --- /dev/null +++ b/pkgs/os-specific/linux/minimal-bootstrap/diffutils/default.nix @@ -0,0 +1,72 @@ +{ lib +, buildPlatform +, hostPlatform +, fetchurl +, bash +, gcc +, glibc +, binutils +, linux-headers +, gnumake +, gnugrep +, gnused +, gawk +, gnutar +, gzip +}: +let + pname = "diffutils"; + version = "2.8.1"; + + src = fetchurl { + url = "mirror://gnu/diffutils/diffutils-${version}.tar.gz"; + sha256 = "0nizs9r76aiymzasmj1jngl7s71jfzl9xfziigcls8k9n141f065"; + }; +in +bash.runCommand "${pname}-${version}" { + inherit pname version; + + nativeBuildInputs = [ + gcc + binutils + gnumake + gnused + gnugrep + gawk + gnutar + gzip + ]; + + passthru.tests.get-version = result: + bash.runCommand "${pname}-get-version-${version}" {} '' + ${result}/bin/diff --version + mkdir $out + ''; + + meta = with lib; { + description = "Commands for showing the differences between files (diff, cmp, etc.)"; + homepage = "https://www.gnu.org/software/diffutils/diffutils.html"; + license = licenses.gpl3Only; + maintainers = teams.minimal-bootstrap.members; + platforms = platforms.unix; + }; +} '' + # Unpack + tar xzf ${src} + cd diffutils-${version} + + # Configure + export C_INCLUDE_PATH="${glibc}/include:${linux-headers}/include" + export LIBRARY_PATH="${glibc}/lib" + export LIBS="-lc -lnss_files -lnss_dns -lresolv" + bash ./configure \ + --prefix=$out \ + --build=${buildPlatform.config} \ + --host=${hostPlatform.config} + + # Build + make + + # Install + make install +''