Unverified Commit 7ec29303 authored by jopejoe1's avatar jopejoe1 Committed by GitHub
Browse files

minimal-bootstrap: add static packages (#459002)

parents 2da1bf35 f2d79303
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
  bash_2_05,
}:
let
  inherit (import ./common.nix { inherit lib; }) meta;
  pname = "bash";
  version = "2.05b";

@@ -69,7 +70,7 @@ let
in
kaem.runCommand "${pname}-${version}"
  {
    inherit pname version;
    inherit pname version meta;

    nativeBuildInputs = [
      tinycc.compiler
@@ -124,14 +125,6 @@ kaem.runCommand "${pname}-${version}"
        ${result}/bin/bash --version
        mkdir ''${out}
      '';

    meta = {
      description = "GNU Bourne-Again Shell, the de facto standard shell on Linux";
      homepage = "https://www.gnu.org/software/bash";
      license = lib.licenses.gpl3Plus;
      teams = [ lib.teams.minimal-bootstrap ];
      platforms = lib.platforms.unix;
    };
  }
  ''
    # Unpack
+10 −0
Original line number Diff line number Diff line
{ lib }:
{
  meta = {
    description = "GNU Bourne-Again Shell, the de facto standard shell on Linux";
    homepage = "https://www.gnu.org/software/bash";
    license = lib.licenses.gpl3Plus;
    teams = [ lib.teams.minimal-bootstrap ];
    platforms = lib.platforms.unix;
  };
}
+3 −11
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
  coreutils,
}:
let
  inherit (import ./common.nix { inherit lib; }) meta;
  pname = "bash";
  version = "5.2.37";

@@ -33,7 +34,7 @@ let
in
bootBash.runCommand "${pname}-${version}"
  {
    inherit pname version;
    inherit pname version meta;

    nativeBuildInputs = [
      coreutils
@@ -85,24 +86,15 @@ bootBash.runCommand "${pname}-${version}"
        }
        // (removeAttrs env [ "nativeBuildInputs" ])
      );

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

    meta = {
      description = "GNU Bourne-Again Shell, the de facto standard shell on Linux";
      homepage = "https://www.gnu.org/software/bash";
      license = lib.licenses.gpl3Plus;
      teams = [ lib.teams.minimal-bootstrap ];
      platforms = lib.platforms.unix;
    };
  }
  ''
    # Unpack
    # unpack
    tar xzf ${src}
    cd bash-${version}

+75 −0
Original line number Diff line number Diff line
{
  lib,
  buildPlatform,
  hostPlatform,
  fetchurl,
  bash,
  gcc,
  musl,
  binutils,
  gnumake,
  gnused,
  gnugrep,
  gawk,
  diffutils,
  findutils,
  gnutar,
  gzip,
}:
let
  inherit (import ./common.nix { inherit lib; }) meta;
  pname = "bash-static";
  version = "5.2.15";

  src = fetchurl {
    url = "mirror://gnu/bash/bash-${version}.tar.gz";
    sha256 = "132qng0jy600mv1fs95ylnlisx2wavkkgpb19c6kmz7lnmjhjwhk";
  };
in
bash.runCommand "${pname}-${version}"
  {
    inherit pname version meta;

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

    passthru.tests.get-version =
      result:
      bash.runCommand "${pname}-get-version-${version}" { } ''
        ${result}/bin/bash --version
        mkdir $out
      '';
  }
  ''
    # Unpack
    tar xf ${src}
    cd bash-${version}

    # Configure
    bash ./configure \
      --prefix=$out \
      --build=${buildPlatform.config} \
      --host=${hostPlatform.config} \
      --without-bash-malloc \
      --enable-static-link \
      bash_cv_func_strtoimax=y \
      CC=musl-gcc

    # Build
    make -j $NIX_BUILD_CORES

    # Install
    make -j $NIX_BUILD_CORES install-strip
    rm $out/bin/bashbug
  ''
+10 −0
Original line number Diff line number Diff line
{ lib }:
{
  meta = {
    description = "Tools for manipulating binaries (linker, assembler, etc.)";
    homepage = "https://www.gnu.org/software/binutils";
    license = lib.licenses.gpl3Plus;
    teams = [ lib.teams.minimal-bootstrap ];
    platforms = lib.platforms.unix;
  };
}
Loading