nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 67 lines 1.2 kB view raw
1{ 2 lib, 3 buildPlatform, 4 hostPlatform, 5 fetchurl, 6 bash, 7 gnumake, 8 tinycc, 9 gnused, 10 gnugrep, 11 gnutar, 12 gzip, 13}: 14 15let 16 inherit (import ./common.nix { inherit lib; }) meta; 17 pname = "gnused"; 18 # last version that can be bootstrapped with our slightly buggy gnused-mes 19 version = "4.2"; 20 21 src = fetchurl { 22 url = "mirror://gnu/sed/sed-${version}.tar.gz"; 23 hash = "sha256-20XNY/0BDmUFN9ZdXfznaJplJ0UjZgbl5ceCk3Jn2YM="; 24 }; 25in 26bash.runCommand "${pname}-${version}" 27 { 28 inherit pname version meta; 29 30 nativeBuildInputs = [ 31 gnumake 32 tinycc.compiler 33 gnused 34 gnugrep 35 gnutar 36 gzip 37 ]; 38 39 passthru.tests.get-version = 40 result: 41 bash.runCommand "${pname}-get-version-${version}" { } '' 42 ${result}/bin/sed --version 43 mkdir ''${out} 44 ''; 45 } 46 ('' 47 # Unpack 48 tar xzf ${src} 49 cd sed-${version} 50 51 # Configure 52 export CC="tcc -B ${tinycc.libs}/lib" 53 export LD=tcc 54 ./configure \ 55 --build=${buildPlatform.config} \ 56 --host=${hostPlatform.config} \ 57 --disable-shared \ 58 --disable-nls \ 59 --disable-dependency-tracking \ 60 --prefix=$out 61 62 # Build 63 make AR="tcc -ar" 64 65 # Install 66 make install 67 '')