Files
nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/diffutils/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

76 lines
1.5 KiB
Nix

{
lib,
buildPlatform,
hostPlatform,
fetchurl,
bash,
tinycc,
gnumake,
gnugrep,
gnused,
gawk,
gnutar,
xz,
}:
let
pname = "diffutils";
# last version that can be built by tinycc-musl 0.9.27
version = "3.8";
src = fetchurl {
url = "mirror://gnu/diffutils/diffutils-${version}.tar.xz";
hash = "sha256-pr3X0bMSZtEcT03mwbdI1GB6sCMa9RiPwlM9CuJDj+w=";
};
in
bash.runCommand "${pname}-${version}"
{
inherit pname version;
nativeBuildInputs = [
tinycc.compiler
gnumake
gnused
gnugrep
gawk
gnutar
xz
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/diff --version
mkdir $out
'';
meta = {
description = "Commands for showing the differences between files (diff, cmp, etc.)";
homepage = "https://www.gnu.org/software/diffutils/diffutils.html";
license = lib.licenses.gpl3Only;
teams = [ lib.teams.minimal-bootstrap ];
platforms = lib.platforms.unix;
};
}
''
# Unpack
cp ${src} diffutils.tar.xz
unxz diffutils.tar.xz
tar xf diffutils.tar
rm diffutils.tar
cd diffutils-${version}
# Configure
export CC="tcc -B ${tinycc.libs}/lib"
export LD=tcc
bash ./configure \
--prefix=$out \
--build=${buildPlatform.config} \
--host=${hostPlatform.config}
# Build
make -j $NIX_BUILD_CORES AR="tcc -ar"
# Install
make -j $NIX_BUILD_CORES install
''