diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/latest.nix | 71 | ||||
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/mes.nix (renamed from nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/default.nix) | 0 | ||||
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/musl.nix | 70 |
3 files changed, 141 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/latest.nix b/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/latest.nix new file mode 100644 index 000000000000..717ea9868fd9 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/latest.nix @@ -0,0 +1,71 @@ +{ lib +, buildPlatform +, hostPlatform +, fetchurl +, bash +, gcc +, musl +, binutils +, gnumake +, gnused +, gnugrep +, gawk +, gzip +, gnutarBoot +}: +let + pname = "gnutar"; + version = "1.35"; + + src = fetchurl { + url = "mirror://gnu/tar/tar-${version}.tar.gz"; + hash = "sha256-FNVeMgY+qVJuBX+/Nfyr1TN452l4fv95GcN1WwLStX4="; + }; +in +bash.runCommand "${pname}-${version}" { + inherit pname version; + + nativeBuildInputs = [ + gcc + musl + binutils + gnumake + gnused + gnugrep + gawk + gzip + gnutarBoot + ]; + + 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 + tar xzf ${src} + cd tar-${version} + + # Configure + bash ./configure \ + --prefix=$out \ + --build=${buildPlatform.config} \ + --host=${hostPlatform.config} \ + CC=musl-gcc + + # Build + make -j $NIX_BUILD_CORES + + # Install + make -j $NIX_BUILD_CORES install +'' diff --git a/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/default.nix b/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/mes.nix index e07561b3e7e5..e07561b3e7e5 100644 --- a/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/default.nix +++ b/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/mes.nix diff --git a/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/musl.nix b/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/musl.nix new file mode 100644 index 000000000000..0818a0de39a2 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/minimal-bootstrap/gnutar/musl.nix @@ -0,0 +1,70 @@ +{ lib +, buildPlatform +, hostPlatform +, fetchurl +, bash +, tinycc +, gnumake +, gnugrep +, gnused +}: +let + # gnutar with musl preserves modify times, allowing make to not try + # rebuilding pregenerated files + pname = "gnutar-musl"; + version = "1.12"; + + src = fetchurl { + url = "mirror://gnu/tar/tar-${version}.tar.gz"; + hash = "sha256-xsN+iIsTbM76uQPFEUn0t71lnWnUrqISRfYQU6V6pgo="; + }; +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 + export CC="tcc -B ${tinycc.libs}/lib" + export LD=tcc + export ac_cv_sizeof_unsigned_long=4 + export ac_cv_sizeof_long_long=8 + export ac_cv_header_netdb_h=no + bash ./configure \ + --prefix=$out \ + --build=${buildPlatform.config} \ + --host=${hostPlatform.config} \ + --disable-nls + + # Build + make AR="tcc -ar" + + # Install + make install +'' |