Files
nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/bzip2/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

60 lines
1.1 KiB
Nix

{
lib,
fetchurl,
bash,
tinycc,
gnumake,
gnutar,
gzip,
}:
let
pname = "bzip2";
version = "1.0.8";
src = fetchurl {
url = "https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz";
sha256 = "0s92986cv0p692icqlw1j42y9nld8zd83qwhzbqd61p1dqbh6nmb";
};
in
bash.runCommand "${pname}-${version}"
{
inherit pname version;
nativeBuildInputs = [
tinycc.compiler
gnumake
gnutar
gzip
];
passthru.tests.get-version =
result:
bash.runCommand "${pname}-get-version-${version}" { } ''
${result}/bin/bzip2 --help
mkdir $out
'';
meta = with lib; {
description = "High-quality data compression program";
homepage = "https://www.sourceware.org/bzip2";
license = licenses.bsdOriginal;
teams = [ teams.minimal-bootstrap ];
platforms = platforms.unix;
};
}
''
# Unpack
tar xzf ${src}
cd bzip2-${version}
# Build
make \
-j $NIX_BUILD_CORES \
CC="tcc -B ${tinycc.libs}/lib" \
AR="tcc -ar" \
bzip2 bzip2recover
# Install
make install -j $NIX_BUILD_CORES PREFIX=$out
''