nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 75 lines 1.3 kB view raw
1{ 2 lib, 3 buildPlatform, 4 hostPlatform, 5 fetchurl, 6 bash, 7 gcc, 8 musl, 9 binutils, 10 gnumake, 11 gnused, 12 gnugrep, 13 gawk, 14 gzip, 15 gnutarBoot, 16}: 17let 18 pname = "gnutar"; 19 version = "1.35"; 20 21 src = fetchurl { 22 url = "mirror://gnu/tar/tar-${version}.tar.gz"; 23 hash = "sha256-FNVeMgY+qVJuBX+/Nfyr1TN452l4fv95GcN1WwLStX4="; 24 }; 25in 26bash.runCommand "${pname}-${version}" 27 { 28 inherit pname version; 29 30 nativeBuildInputs = [ 31 gcc 32 musl 33 binutils 34 gnumake 35 gnused 36 gnugrep 37 gawk 38 gzip 39 gnutarBoot 40 ]; 41 42 passthru.tests.get-version = 43 result: 44 bash.runCommand "${pname}-get-version-${version}" { } '' 45 ${result}/bin/tar --version 46 mkdir $out 47 ''; 48 49 meta = with lib; { 50 description = "GNU implementation of the `tar' archiver"; 51 homepage = "https://www.gnu.org/software/tar"; 52 license = licenses.gpl3Plus; 53 teams = [ teams.minimal-bootstrap ]; 54 mainProgram = "tar"; 55 platforms = platforms.unix; 56 }; 57 } 58 '' 59 # Unpack 60 tar xzf ${src} 61 cd tar-${version} 62 63 # Configure 64 bash ./configure \ 65 --prefix=$out \ 66 --build=${buildPlatform.config} \ 67 --host=${hostPlatform.config} \ 68 CC=musl-gcc 69 70 # Build 71 make -j $NIX_BUILD_CORES 72 73 # Install 74 make -j $NIX_BUILD_CORES install 75 ''