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

minimal-bootstrap.bzip2-static: init at 1.0.8

parent 97370d4e
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
{
  lib,
  fetchurl,
  bash,
  gcc,
  musl,
  binutils,
  gnumake,
  gnutar,
  gzip,
}:
let
  pname = "bzip2-static";
  version = "1.0.8";

  src = fetchurl {
    url = "https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz";
    sha256 = "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb";
  };
in
bash.runCommand "${pname}-${version}"
  {
    inherit pname version;

    nativeBuildInputs = [
      gcc
      musl
      binutils
      gnumake
      gnutar
      gzip
    ];

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

    meta = {
      description = "High-quality data compression program";
      homepage = "https://www.sourceware.org/bzip2";
      license = lib.licenses.bsdOriginal;
      platforms = lib.platforms.unix;
      teams = [ lib.teams.minimal-bootstrap ];
    };
  }
  ''
    # Unpack
    tar xf ${src}
    cd bzip2-${version}

    # Build
    make \
      -j $NIX_BUILD_CORES \
      CC=musl-gcc \
      CFLAGS=-static \
      bzip2 bzip2recover

    # Install
    make install -j $NIX_BUILD_CORES PREFIX=$out
  ''
+8 −0
Original line number Diff line number Diff line
@@ -70,7 +70,14 @@ lib.makeScope
        gnutar = gnutar-musl;
      };

      bzip2-static = callPackage ./bzip2/static.nix {
        gcc = gcc-latest;
        gnumake = gnumake-musl;
        gnutar = gnutar-latest;
      };

      coreutils = callPackage ./coreutils { tinycc = tinycc-mes; };

      coreutils-musl = callPackage ./coreutils/musl.nix {
        bash = bash_2_05;
        tinycc = tinycc-musl;
@@ -355,6 +362,7 @@ lib.makeScope
        echo ${bison.tests.get-version}
        echo ${busybox-static.tests.get-version}
        echo ${bzip2.tests.get-version}
        echo ${bzip2-static.tests.get-version}
        echo ${coreutils-musl.tests.get-version}
        echo ${coreutils-static.tests.get-version}
        echo ${diffutils.tests.get-version}