lol

Merge pull request #237870 from emilytrau/minimal-xz

minimal-bootstrap.xz: init at 5.0.8

authored by

John Ericson and committed by
GitHub
5467f89e a5a0c781

+110
+7
pkgs/os-specific/linux/minimal-bootstrap/default.nix
··· 70 70 tinycc-bootstrappable = lib.recurseIntoAttrs (callPackage ./tinycc/bootstrappable.nix { }); 71 71 tinycc-mes = lib.recurseIntoAttrs (callPackage ./tinycc/mes.nix { }); 72 72 73 + xz = callPackage ./xz { 74 + bash = bash_2_05; 75 + tinycc = tinycc-mes; 76 + inherit (heirloom) sed; 77 + }; 78 + 73 79 inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText; 74 80 75 81 test = kaem.runCommand "minimal-bootstrap-test" {} '' ··· 83 89 echo ${heirloom.tests.get-version} 84 90 echo ${mes.compiler.tests.get-version} 85 91 echo ${tinycc-mes.compiler.tests.chain} 92 + echo ${xz.tests.get-version} 86 93 mkdir ''${out} 87 94 ''; 88 95 })
+78
pkgs/os-specific/linux/minimal-bootstrap/xz/default.nix
··· 1 + { lib 2 + , buildPlatform 3 + , hostPlatform 4 + , fetchurl 5 + , bash 6 + , tinycc 7 + , gnumake 8 + , gnugrep 9 + , gawk 10 + , sed 11 + }: 12 + let 13 + pname = "xz"; 14 + # >=5.2 uses poll.h, unsupported by meslibc 15 + version = "5.0.8"; 16 + 17 + src = fetchurl { 18 + url = "https://tukaani.org/xz/xz-${version}.tar.bz2"; 19 + sha256 = "1nkb68dyrf16xwyqichcy1vhgbfg20dxz459rcsdx85h1gczk1i2"; 20 + }; 21 + in 22 + bash.runCommand "${pname}-${version}" { 23 + inherit pname version; 24 + 25 + nativeBuildInputs = [ 26 + tinycc.compiler 27 + gnumake 28 + gnugrep 29 + gawk 30 + sed 31 + ]; 32 + 33 + passthru.tests.get-version = result: 34 + bash.runCommand "${pname}-get-version-${version}" {} '' 35 + ${result}/bin/xz --version 36 + mkdir $out 37 + ''; 38 + 39 + meta = with lib; { 40 + description = "A general-purpose data compression software, successor of LZMA"; 41 + homepage = "https://tukaani.org/xz"; 42 + license = with licenses; [ gpl2Plus lgpl21Plus ]; 43 + maintainers = teams.minimal-bootstrap.members; 44 + platforms = platforms.unix; 45 + }; 46 + } '' 47 + # Unpack 48 + unbz2 --file ${src} --output xz.tar 49 + untar --file xz.tar 50 + rm xz.tar 51 + cd xz-${version} 52 + 53 + # Configure 54 + export CC="tcc -B ${tinycc.libs}/lib -include${./stubs.h}" 55 + export CPP="tcc -E" 56 + export LD=tcc 57 + export AR="tcc -ar" 58 + export SED=sed 59 + export ac_cv_prog_cc_c99= 60 + export ac_cv_header_fcntl_h=yes 61 + export ac_cv_header_limits_h=yes 62 + export ac_cv_header_sys_time_h=yes 63 + export ac_cv_func_utime=no 64 + bash ./configure \ 65 + --prefix=$out \ 66 + --build=${buildPlatform.config} \ 67 + --host=${hostPlatform.config} \ 68 + --disable-shared \ 69 + --disable-nls \ 70 + --disable-threads \ 71 + --disable-assembler 72 + 73 + # Build 74 + make all 75 + 76 + # Install 77 + make install 78 + ''
+25
pkgs/os-specific/linux/minimal-bootstrap/xz/stubs.h
··· 1 + #define sig_atomic_t int 2 + 3 + #define SSIZE_MAX LONG_MAX 4 + 5 + #define O_NOCTTY 0400 6 + #define O_NONBLOCK 04000 7 + 8 + #define S_ISVTX 01000 9 + #define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) 10 + 11 + int fchmod (int fd, int mode) 12 + { 13 + return 0; 14 + } 15 + 16 + int fchown (int fd, int owner, int group) 17 + { 18 + return 0; 19 + } 20 + 21 + #include <signal.h> 22 + int sigfillset (sigset_t * set) 23 + { 24 + return 0; 25 + }