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.
79 lines
1.4 KiB
Nix
79 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildPlatform,
|
|
hostPlatform,
|
|
fetchurl,
|
|
bash,
|
|
gcc,
|
|
binutils,
|
|
gnumake,
|
|
gnused,
|
|
gnugrep,
|
|
gawk,
|
|
diffutils,
|
|
findutils,
|
|
gnutar,
|
|
xz,
|
|
}:
|
|
let
|
|
pname = "gzip-static";
|
|
version = "1.14";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://gnu/gzip/gzip-${version}.tar.xz";
|
|
hash = "sha256-Aae4gb0iC/32Ffl7hxj4C9/T9q3ThbmT3Pbv0U6MCsY=";
|
|
};
|
|
in
|
|
bash.runCommand "${pname}-${version}"
|
|
{
|
|
inherit pname version;
|
|
|
|
nativeBuildInputs = [
|
|
gcc
|
|
binutils
|
|
gnumake
|
|
gnused
|
|
gnugrep
|
|
gawk
|
|
diffutils
|
|
findutils
|
|
gnutar
|
|
xz
|
|
];
|
|
|
|
passthru.tests.get-version =
|
|
result:
|
|
bash.runCommand "${pname}-get-version-${version}" { } ''
|
|
${result}/bin/gzip --version
|
|
mkdir $out
|
|
'';
|
|
|
|
meta = {
|
|
description = "GNU zip compression program";
|
|
homepage = "https://www.gnu.org/software/gzip";
|
|
license = lib.licenses.gpl3Plus;
|
|
platforms = lib.platforms.unix;
|
|
teams = [ lib.teams.minimal-bootstrap ];
|
|
};
|
|
}
|
|
''
|
|
# Unpack
|
|
tar xf ${src}
|
|
cd gzip-${version}
|
|
|
|
# Configure
|
|
bash ./configure \
|
|
--prefix=$out \
|
|
--build=${buildPlatform.config} \
|
|
--host=${hostPlatform.config} \
|
|
--disable-dependency-tracking \
|
|
CFLAGS=-static
|
|
|
|
# Build
|
|
make -j $NIX_BUILD_CORES bin_SCRIPTS=
|
|
|
|
# Install
|
|
make -j $NIX_BUILD_CORES bin_SCRIPTS= install-strip
|
|
rm -rf $out/share
|
|
''
|