minimal-bootstrap.gnused-static: init at 4.9

This commit is contained in:
Emily Trau
2025-12-17 12:41:19 -05:00
committed by dish
parent bac6125f3e
commit e336b7c768
2 changed files with 79 additions and 0 deletions
@@ -189,6 +189,12 @@ lib.makeScope
tinycc = tinycc-bootstrappable;
};
gnused-static = callPackage ./gnused/static.nix {
gcc = gcc-latest;
gnumake = gnumake-musl;
gnutar = gnutar-latest;
};
gnutar = callPackage ./gnutar/mes.nix {
bash = bash_2_05;
tinycc = tinycc-mes;
@@ -337,6 +343,7 @@ lib.makeScope
echo ${gnum4.tests.get-version}
echo ${gnused.tests.get-version}
echo ${gnused-mes.tests.get-version}
echo ${gnused-static.tests.get-version}
echo ${gnutar.tests.get-version}
echo ${gnutar-latest.tests.get-version}
echo ${gnutar-musl.tests.get-version}
@@ -0,0 +1,72 @@
{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
gcc,
musl,
binutils,
gnumake,
gnused,
gnugrep,
gawk,
diffutils,
findutils,
gnutar,
xz,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gnused-static";
version = "4.9";
src = fetchurl {
url = "mirror://gnu/sed/sed-${version}.tar.xz";
hash = "sha256-biJrcy4c1zlGStaGK9Ghq6QteYKSLaelNRljHSSXUYE=";
};
in
bash.runCommand "${pname}-${version}"
{
inherit pname version meta;
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/sed --version
mkdir $out
'';
}
''
# Unpack
tar xf ${src}
cd sed-${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
''