Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

75 lines
1.4 KiB
Nix

{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
tinycc,
gnumake,
gnupatch,
gnused,
gnugrep,
}:
let
inherit (import ./common.nix { inherit lib; }) meta;
pname = "gawk-mes";
# >=3.1.x is incompatible with mes-libc
version = "3.0.6";
src = fetchurl {
url = "mirror://gnu/gawk/gawk-${version}.tar.gz";
sha256 = "1z4bibjm7ldvjwq3hmyifyb429rs2d9bdwkvs0r171vv1khpdwmb";
};
patches = [
# for reproducibility don't generate date stamp
./no-stamp.patch
];
in
bash.runCommand "${pname}-${version}"
{
inherit pname version meta;
nativeBuildInputs = [
tinycc.compiler
gnumake
gnupatch
gnused
gnugrep
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/awk --version
mkdir $out
'';
}
''
# Unpack
ungz --file ${src} --output gawk.tar
untar --file gawk.tar
rm gawk.tar
cd gawk-${version}
# Patch
${lib.concatMapStringsSep "\n" (f: "patch -Np0 -i ${f}") patches}
# Configure
export CC="tcc -B ${tinycc.libs}/lib"
export ac_cv_func_getpgrp_void=yes
export ac_cv_func_tzset=yes
bash ./configure \
--build=${buildPlatform.config} \
--host=${hostPlatform.config} \
--disable-nls \
--prefix=$out
# Build
make gawk
# Install
install -D gawk $out/bin/gawk
ln -s gawk $out/bin/awk
''