2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, buildPlatform
|
|
|
|
, hostPlatform
|
|
|
|
, fetchurl
|
|
|
|
, bash
|
2023-10-09 19:29:22 +00:00
|
|
|
, gcc
|
|
|
|
, musl
|
|
|
|
, binutils
|
2023-05-24 13:37:59 +00:00
|
|
|
, gnumake
|
|
|
|
, gnused
|
|
|
|
, gnugrep
|
2023-10-09 19:29:22 +00:00
|
|
|
, gawk
|
|
|
|
, gzip
|
|
|
|
, gnutarBoot
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
pname = "gnutar";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.35";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/tar/tar-${version}.tar.gz";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-FNVeMgY+qVJuBX+/Nfyr1TN452l4fv95GcN1WwLStX4=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
bash.runCommand "${pname}-${version}" {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-10-09 19:29:22 +00:00
|
|
|
gcc
|
|
|
|
musl
|
|
|
|
binutils
|
2023-05-24 13:37:59 +00:00
|
|
|
gnumake
|
|
|
|
gnused
|
|
|
|
gnugrep
|
2023-10-09 19:29:22 +00:00
|
|
|
gawk
|
|
|
|
gzip
|
|
|
|
gnutarBoot
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
passthru.tests.get-version = result:
|
|
|
|
bash.runCommand "${pname}-get-version-${version}" {} ''
|
|
|
|
${result}/bin/tar --version
|
|
|
|
mkdir $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "GNU implementation of the `tar' archiver";
|
|
|
|
homepage = "https://www.gnu.org/software/tar";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = teams.minimal-bootstrap.members;
|
|
|
|
mainProgram = "tar";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
} ''
|
|
|
|
# Unpack
|
2023-10-09 19:29:22 +00:00
|
|
|
tar xzf ${src}
|
2023-05-24 13:37:59 +00:00
|
|
|
cd tar-${version}
|
|
|
|
|
|
|
|
# Configure
|
|
|
|
bash ./configure \
|
2023-10-09 19:29:22 +00:00
|
|
|
--prefix=$out \
|
2023-05-24 13:37:59 +00:00
|
|
|
--build=${buildPlatform.config} \
|
|
|
|
--host=${hostPlatform.config} \
|
2023-10-09 19:29:22 +00:00
|
|
|
CC=musl-gcc
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# Build
|
2023-10-09 19:29:22 +00:00
|
|
|
make -j $NIX_BUILD_CORES
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# Install
|
2023-10-09 19:29:22 +00:00
|
|
|
make -j $NIX_BUILD_CORES install
|
2023-05-24 13:37:59 +00:00
|
|
|
''
|