Files
Aleksi Hannula 745f12467c minimal-bootstrap: Fix tools in preparation for early cross-compilation
Various packages under minimal-bootstrap explicitly use the musl gcc
wrapper (especially the *-static packages).

In #494106, the desire is to allow these packages to run on a host
platform which may differ from the bootstrap seed platform. That host
platform may be a non-musl platform, and furthermore musl may not even
be available on the desired host architecture.

This change aims to make the packages more generic wrt libc. It is
extracted out of #494106.
2026-06-17 13:34:53 +03:00

58 lines
973 B
Nix

{
lib,
fetchurl,
bash,
gcc,
binutils,
gnumake,
gnused,
gnugrep,
gnutar,
xz,
}:
let
pname = "zlib";
version = "1.3.2";
src = fetchurl {
url = "https://github.com/madler/zlib/releases/download/v${version}/zlib-${version}.tar.xz";
hash = "sha256-16BlR4Ok2lKdG7eTt62cMxgCCvd2Z7yuNfldDkKnkvM=";
};
in
bash.runCommand "${pname}-${version}"
{
inherit pname version;
nativeBuildInputs = [
gcc
binutils
gnumake
gnused
gnugrep
gnutar
xz
];
meta = {
description = "Lossless data-compression library";
homepage = "https://zlib.net";
license = lib.licenses.zlib;
platforms = lib.platforms.unix;
teams = [ lib.teams.minimal-bootstrap ];
};
}
''
# Unpack
tar xf ${src}
cd zlib-${version}
# Configure
bash ./configure --prefix=$out
# Build
make -j $NIX_BUILD_CORES
# Install
make -j $NIX_BUILD_CORES install
''