2023-05-22 03:41:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPlatform
|
|
|
|
, hostPlatform
|
|
|
|
, fetchurl
|
|
|
|
, bash
|
|
|
|
, tinycc
|
|
|
|
, gnumake
|
|
|
|
, gnugrep
|
2023-09-25 03:41:35 +00:00
|
|
|
, gnused
|
2023-05-22 03:41:51 +00:00
|
|
|
}:
|
|
|
|
let
|
2023-09-25 03:41:35 +00:00
|
|
|
# gnutar with musl preserves modify times, allowing make to not try
|
|
|
|
# rebuilding pregenerated files
|
|
|
|
pname = "gnutar-musl";
|
2023-05-22 03:41:51 +00:00
|
|
|
version = "1.12";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/tar/tar-${version}.tar.gz";
|
2023-09-25 03:41:35 +00:00
|
|
|
hash = "sha256-xsN+iIsTbM76uQPFEUn0t71lnWnUrqISRfYQU6V6pgo=";
|
2023-05-22 03:41:51 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
bash.runCommand "${pname}-${version}" {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
tinycc.compiler
|
|
|
|
gnumake
|
|
|
|
gnused
|
|
|
|
gnugrep
|
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
ungz --file ${src} --output tar.tar
|
|
|
|
untar --file tar.tar
|
|
|
|
rm tar.tar
|
|
|
|
cd tar-${version}
|
|
|
|
|
|
|
|
# Configure
|
2023-05-24 01:58:37 +00:00
|
|
|
export CC="tcc -B ${tinycc.libs}/lib"
|
2023-09-25 03:41:35 +00:00
|
|
|
export LD=tcc
|
|
|
|
export ac_cv_sizeof_unsigned_long=4
|
|
|
|
export ac_cv_sizeof_long_long=8
|
|
|
|
export ac_cv_header_netdb_h=no
|
2023-05-22 03:41:51 +00:00
|
|
|
bash ./configure \
|
2023-09-25 03:41:35 +00:00
|
|
|
--prefix=$out \
|
2023-05-22 03:41:51 +00:00
|
|
|
--build=${buildPlatform.config} \
|
|
|
|
--host=${hostPlatform.config} \
|
2023-09-25 03:41:35 +00:00
|
|
|
--disable-nls
|
2023-05-22 03:41:51 +00:00
|
|
|
|
|
|
|
# Build
|
|
|
|
make AR="tcc -ar"
|
|
|
|
|
|
|
|
# Install
|
|
|
|
make install
|
|
|
|
''
|