2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, buildPlatform
|
|
|
|
, hostPlatform
|
|
|
|
, fetchurl
|
|
|
|
, bash
|
|
|
|
, tinycc
|
|
|
|
, gnumake
|
2023-10-09 19:29:22 +00:00
|
|
|
, gnused
|
2023-07-15 17:15:38 +00:00
|
|
|
, gnugrep
|
|
|
|
, gawk
|
2023-10-09 19:29:22 +00:00
|
|
|
, gnutar
|
|
|
|
, gzip
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "xz";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "5.4.3";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-10-09 19:29:22 +00:00
|
|
|
url = "https://tukaani.org/xz/xz-${version}.tar.gz";
|
|
|
|
hash = "sha256-HDguC8Lk4K9YOYqQPdYv/35RAXHS3keh6+BtFSjpt+k=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
bash.runCommand "${pname}-${version}" {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
tinycc.compiler
|
|
|
|
gnumake
|
2023-10-09 19:29:22 +00:00
|
|
|
gnused
|
2023-07-15 17:15:38 +00:00
|
|
|
gnugrep
|
|
|
|
gawk
|
2023-10-09 19:29:22 +00:00
|
|
|
gnutar
|
|
|
|
gzip
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
passthru.tests.get-version = result:
|
|
|
|
bash.runCommand "${pname}-get-version-${version}" {} ''
|
|
|
|
${result}/bin/xz --version
|
|
|
|
mkdir $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "General-purpose data compression software, successor of LZMA";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://tukaani.org/xz";
|
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
maintainers = teams.minimal-bootstrap.members;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} ''
|
|
|
|
# Unpack
|
2023-10-09 19:29:22 +00:00
|
|
|
tar xzf ${src}
|
2023-07-15 17:15:38 +00:00
|
|
|
cd xz-${version}
|
|
|
|
|
|
|
|
# Configure
|
2023-10-09 19:29:22 +00:00
|
|
|
export CC="tcc -B ${tinycc.libs}/lib"
|
2023-07-15 17:15:38 +00:00
|
|
|
export AR="tcc -ar"
|
2023-10-09 19:29:22 +00:00
|
|
|
export LD=tcc
|
2023-07-15 17:15:38 +00:00
|
|
|
bash ./configure \
|
|
|
|
--prefix=$out \
|
|
|
|
--build=${buildPlatform.config} \
|
|
|
|
--host=${hostPlatform.config} \
|
|
|
|
--disable-shared \
|
|
|
|
--disable-assembler
|
|
|
|
|
|
|
|
# Build
|
2023-10-09 19:29:22 +00:00
|
|
|
make -j $NIX_BUILD_CORES
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# Install
|
2023-10-09 19:29:22 +00:00
|
|
|
make -j $NIX_BUILD_CORES install
|
2023-07-15 17:15:38 +00:00
|
|
|
''
|