Files
Aleksi Hannula 4af58188ea minimal-bootstrap.gnused-static: 4.9 -> 4.10
Added linux-headers to the include path, the new version of the
vendored gnulib depends on a few headers.
2026-08-01 09:17:23 +03:00

74 lines
1.3 KiB
Nix

{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
gcc,
binutils,
gnumake,
gnused,
gnugrep,
gawk,
diffutils,
findutils,
gnutar,
linux-headers,
xz,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gnused-static";
version = "4.10";
src = fetchurl {
url = "mirror://gnu/sed/sed-${version}.tar.xz";
hash = "sha256-uOchgrLslqNXTimYxHt6qmTMIM4ADY6awxPMB87PKMc=";
};
in
bash.runCommand "${pname}-${version}"
{
inherit pname version meta;
nativeBuildInputs = [
gcc
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} \
--disable-dependency-tracking \
--disable-nls \
CFLAGS="-I${linux-headers}/include"
# Build
make -j $NIX_BUILD_CORES
# Install
make -j $NIX_BUILD_CORES install-strip
rm -rf $out/share
''