diff --git a/pkgs/os-specific/linux/minimal-bootstrap/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/default.nix index 459321cb0da2..4195397700e2 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/default.nix @@ -12,7 +12,7 @@ lib.makeScope newScope (self: with self; { inherit system; }; - inherit (callPackage ./stage0-posix { }) kaem m2libc mescc-tools mescc-tools-extra writeTextFile writeText runCommand fetchtarball; + inherit (callPackage ./stage0-posix { }) kaem m2libc mescc-tools mescc-tools-extra writeTextFile writeText runCommand; nyacc = callPackage ./mes/nyacc.nix { }; mes = callPackage ./mes { }; diff --git a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/default.nix index 5f33264e2b22..b8d79bde939b 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/default.nix @@ -32,5 +32,5 @@ lib.makeScope newScope (self: with self; { mescc-tools-extra = callPackage ./mescc-tools-extra { }; - inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText runCommand fetchtarball; + inherit (callPackage ./utils.nix { }) derivationWithMeta writeTextFile writeText runCommand; }) diff --git a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix index c2b0c753a93a..bf3d34b96b0a 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/stage0-posix/utils.nix @@ -80,24 +80,4 @@ rec { PATH = lib.makeBinPath ((env.nativeBuildInputs or []) ++ [ kaem mescc-tools mescc-tools-extra ]); } // (builtins.removeAttrs env [ "nativeBuildInputs" ])); - # Fetch and unpack a .tar.gz file. Does not strip top-level directory - fetchtarball = - { url - # Unlike fetchzip, this hash is of the tarball and not the decompressed output - , sha256 - , name ? baseNameOf (toString url) - , postFetch ? "" - }: - let - tarball = fetchurl { inherit url sha256; }; - in - runCommand name {} '' - cd ''${TMP} - ungz --file ${tarball} --output tmp.tar - mkdir ''${out} - cd ''${out} - untar --file ''${TMP}/tmp.tar - - ${postFetch} - ''; } diff --git a/pkgs/os-specific/linux/minimal-bootstrap/tinycc/bootstrappable.nix b/pkgs/os-specific/linux/minimal-bootstrap/tinycc/bootstrappable.nix index c218e7432271..7db7049fcab9 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/tinycc/bootstrappable.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/tinycc/bootstrappable.nix @@ -9,7 +9,7 @@ { lib , runCommand -, fetchtarball +, fetchurl , mes , buildTinyccN , mes-libc @@ -17,10 +17,16 @@ let version = "unstable-2023-04-20"; rev = "80114c4da6b17fbaabb399cc29f427e368309bc8"; - src = (fetchtarball { + tarball = fetchurl { url = "https://gitlab.com/janneke/tinycc/-/archive/${rev}/tinycc-${rev}.tar.gz"; sha256 = "1a0cw9a62qc76qqn5sjmp3xrbbvsz2dxrw21lrnx9q0s74mwaxbq"; - }) + "/tinycc-${rev}"; + }; + src = (runCommand "tinycc-bootstrappable-${version}-source" {} '' + ungz --file ${tarball} --output tinycc.tar + mkdir -p ''${out} + cd ''${out} + untar --file ''${NIX_BUILD_TOP}/tinycc.tar + '') + "/tinycc-${rev}"; meta = with lib; { description = "Tiny C Compiler's bootstrappable fork"; diff --git a/pkgs/os-specific/linux/minimal-bootstrap/tinycc/default.nix b/pkgs/os-specific/linux/minimal-bootstrap/tinycc/default.nix index 12e876ec4362..2a3bd2a337e5 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/tinycc/default.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/tinycc/default.nix @@ -6,16 +6,22 @@ { lib , runCommand -, fetchtarball +, fetchurl , callPackage , mes }: let version = "unstable-2023-04-20"; - src = (fetchtarball { + tarball = fetchurl { url = "https://repo.or.cz/tinycc.git/snapshot/86f3d8e33105435946383aee52487b5ddf918140.tar.gz"; sha256 = "11idrvbwfgj1d03crv994mpbbbyg63j1k64lw1gjy7mkiifw2xap"; - }) + "/tinycc-86f3d8e"; + }; + src = (runCommand "tinycc-${version}-source" {} '' + ungz --file ${tarball} --output tinycc.tar + mkdir -p ''${out} + cd ''${out} + untar --file ''${NIX_BUILD_TOP}/tinycc.tar + '') + "/tinycc-86f3d8e"; meta = with lib; { description = "Small, fast, and embeddable C compiler and interpreter";