diff options
-rw-r--r-- | pkgs/os-specific/linux/minimal-bootstrap/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/minimal-bootstrap/xz/default.nix | 35 | ||||
-rw-r--r-- | pkgs/os-specific/linux/minimal-bootstrap/xz/stubs.h | 25 |
3 files changed, 16 insertions, 48 deletions
diff --git a/pkgs/os-specific/linux/minimal-bootstrap/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/default.nix index 9d14a60f74f98..a5c67db65902d 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/default.nix @@ -149,8 +149,8 @@ lib.makeScope xz = callPackage ./xz { bash = bash_2_05; - tinycc = tinycc-mes; - inherit (heirloom) sed; + tinycc = tinycc-musl; + musl = musl11; }; inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText; diff --git a/pkgs/os-specific/linux/minimal-bootstrap/xz/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/xz/default.nix index 92cb240c5f164..32c5b3999c1b7 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/xz/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/xz/default.nix @@ -4,19 +4,21 @@ , fetchurl , bash , tinycc +, musl , gnumake +, gnused , gnugrep , gawk -, sed +, gnutar +, gzip }: let pname = "xz"; - # >=5.2 uses poll.h, unsupported by meslibc - version = "5.0.8"; + version = "5.4.3"; src = fetchurl { - url = "https://tukaani.org/xz/xz-${version}.tar.bz2"; - sha256 = "1nkb68dyrf16xwyqichcy1vhgbfg20dxz459rcsdx85h1gczk1i2"; + url = "https://tukaani.org/xz/xz-${version}.tar.gz"; + hash = "sha256-HDguC8Lk4K9YOYqQPdYv/35RAXHS3keh6+BtFSjpt+k="; }; in bash.runCommand "${pname}-${version}" { @@ -25,9 +27,11 @@ bash.runCommand "${pname}-${version}" { nativeBuildInputs = [ tinycc.compiler gnumake + gnused gnugrep gawk - sed + gnutar + gzip ]; passthru.tests.get-version = result: @@ -45,33 +49,22 @@ bash.runCommand "${pname}-${version}" { }; } '' # Unpack - unbz2 --file ${src} --output xz.tar - untar --file xz.tar - rm xz.tar + tar xzf ${src} cd xz-${version} # Configure - export CC="tcc -B ${tinycc.libs}/lib -include${./stubs.h}" - export CPP="tcc -E" - export LD=tcc + export CC="tcc -B ${musl}/lib" export AR="tcc -ar" - export SED=sed - export ac_cv_prog_cc_c99= - export ac_cv_header_fcntl_h=yes - export ac_cv_header_limits_h=yes - export ac_cv_header_sys_time_h=yes - export ac_cv_func_utime=no + export LD=tcc bash ./configure \ --prefix=$out \ --build=${buildPlatform.config} \ --host=${hostPlatform.config} \ --disable-shared \ - --disable-nls \ - --disable-threads \ --disable-assembler # Build - make all + make # Install make install diff --git a/pkgs/os-specific/linux/minimal-bootstrap/xz/stubs.h b/pkgs/os-specific/linux/minimal-bootstrap/xz/stubs.h deleted file mode 100644 index cbf6f823299e1..0000000000000 --- a/pkgs/os-specific/linux/minimal-bootstrap/xz/stubs.h +++ /dev/null @@ -1,25 +0,0 @@ -#define sig_atomic_t int - -#define SSIZE_MAX LONG_MAX - -#define O_NOCTTY 0400 -#define O_NONBLOCK 04000 - -#define S_ISVTX 01000 -#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) - -int fchmod (int fd, int mode) -{ - return 0; -} - -int fchown (int fd, int owner, int group) -{ - return 0; -} - -#include <signal.h> -int sigfillset (sigset_t * set) -{ - return 0; -} |