Files
nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gawk/static.nix
Aleksi Hannula be7d828eef minimal-bootstrap.gawk{,-static}: 5.3.2 -> 5.4.1
Added the same patch that is also vendored for the top-level package.
2026-08-01 09:17:23 +03:00

86 lines
1.6 KiB
Nix

{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
gcc,
binutils,
gnupatch,
gnumake,
gnused,
gnugrep,
gawk,
diffutils,
findutils,
gnutar,
gzip,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gawk-static";
version = "5.4.1";
src = fetchurl {
url = "mirror://gnu/gawk/gawk-${version}.tar.gz";
hash = "sha256-izsOqDkwMRo/MJBdPOiY0yxhA8L+INapC0A0EXGxdN4=";
};
patches = [
./node-struct-without-gmp-mpfr.patch
];
in
bash.runCommand "${pname}-${version}"
{
inherit pname version meta;
nativeBuildInputs = [
gcc
binutils
gnupatch
gnumake
gnused
gnugrep
gawk
diffutils
findutils
gnutar
gzip
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/awk --version
${result}/bin/awk 'BEGIN { if (2 + 2 != 4) exit 1 }'
mkdir $out
'';
}
''
# Unpack
tar xf ${src}
cd gawk-${version}
# Patch
${lib.concatMapStringsSep "\n" (f: "patch -Np1 -i ${f}") patches}
# Configure
bash ./configure \
--prefix=$out \
--build=${buildPlatform.config} \
--host=${hostPlatform.config} \
--disable-dependency-tracking \
--disable-extensions \
--disable-mpfr \
--disable-nls \
--disable-pma
# Build
make -j $NIX_BUILD_CORES
# Install
make -j $NIX_BUILD_CORES install-strip
rm $out/bin/gawkbug
rm -rf $out/etc $out/include $out/lib $out/libexec
rm -rf $out/share
''