Commit e20d10e0 authored by Emily Trau's avatar Emily Trau Committed by dish
Browse files

minimal-bootstrap.findutils-static: init at 4.9.0

parent 5d403f7f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -107,6 +107,11 @@ lib.makeScope
        tinycc = tinycc-mes;
        gnused = gnused-mes;
      };
      findutils-static = callPackage ./findutils/static.nix {
        gcc = gcc-latest;
        gnumake = gnumake-musl;
        gnutar = gnutar-latest;
      };

      gawk = callPackage ./gawk {
        bash = bash_2_05;
@@ -337,6 +342,7 @@ lib.makeScope
        echo ${diffutils.tests.get-version}
        echo ${diffutils-static.tests.get-version}
        echo ${findutils.tests.get-version}
        echo ${findutils-static.tests.get-version}
        echo ${gawk.tests.get-version}
        echo ${gawk-mes.tests.get-version}
        echo ${gawk-static.tests.get-version}
+80 −0
Original line number Diff line number Diff line
{
  lib,
  buildPlatform,
  hostPlatform,
  fetchurl,
  bash,
  gcc,
  musl,
  binutils,
  gnumake,
  gnused,
  gnugrep,
  gawk,
  diffutils,
  findutils,
  gnutar,
  xz,
}:
let
  pname = "findutils-static";
  version = "4.9.0";

  src = fetchurl {
    url = "mirror://gnu/findutils/findutils-${version}.tar.xz";
    hash = "sha256-or+4wJ1DZ3DtxZ9Q+kg+eFsWGjt7nVR1c8sIBl/UYv4=";
  };
in
bash.runCommand "${pname}-${version}"
  {
    inherit pname version;

    nativeBuildInputs = [
      gcc
      musl
      binutils
      gnumake
      gnused
      gnugrep
      gawk
      diffutils
      findutils
      gnutar
      xz
    ];

    passthru.tests.get-version =
      result:
      bash.runCommand "${pname}-get-version-${version}" { } ''
        ${result}/bin/find --version
        mkdir $out
      '';

    meta = {
      description = "GNU Find Utilities, the basic directory searching utilities of the GNU operating system";
      homepage = "https://www.gnu.org/software/findutils";
      license = lib.licenses.gpl3Plus;
      platforms = lib.platforms.unix;
      teams = [ lib.teams.minimal-bootstrap ];
    };
  }
  ''
    # Unpack
    tar xf ${src}
    cd findutils-${version}

    # Configure
    bash ./configure \
      --prefix=$out \
      --build=${buildPlatform.config} \
      --host=${hostPlatform.config} \
      CC=musl-gcc \
      CFLAGS=-static

    # Build
    make -j $NIX_BUILD_CORES

    # Install
    make -j $NIX_BUILD_CORES install
    rm $out/bin/updatedb
  ''