@@ -1,6 +1,6 @@
11{ lowPrio, newScope, pkgs, lib, stdenv, cmake
22, gccForLibs, preLibcCrossHeaders
3−, libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
3+, libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
44, buildLlvmTools # tools, but from the previous stage, for cross
55, targetLlvmLibraries # libraries, but from the next stage, for cross
66# This is the default binutils, but with *this* version of LLD rather
@@ -24,13 +24,13 @@ let
2424 version = "${release_version}${dash-candidate}"; # differentiating these (variables) is important for RCs
2525 targetConfig = stdenv.targetPlatform.config;
2626
27− fetch = name: sha256: fetchurl {
28− url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}-${release_version}${candidate}.src.tar.xz";
29− inherit sha256;
27+ src = fetchFromGitHub {
28+ owner = "llvm";
29+ repo = "llvm-project";
30+ rev = "llvmorg-${version}";
31+ sha256 = "07jz8pywc2qqa1srdnqg5p2y4lx3ki1inpigarzgxc3j20r4gb58";
3032 };
3133
32− clang-tools-extra_src = fetch "clang-tools-extra" "0p3dzr0qa7mar83y66xa5m5apynf6ia0lsdsq6axwnm64ysy0hdd";
33−
3434 llvm_meta = {
3535 license = lib.licenses.ncsa;
3636 maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ];
@@ -38,7 +38,7 @@ let
3838 };
3939
4040 tools = lib.makeExtensible (tools: let
41− callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch buildLlvmTools; });
41+ callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version src buildLlvmTools; });
4242 mkExtraBuildCommands0 = cc: ''
4343 rsrc="$out/resource-root"
4444 mkdir "$rsrc"
@@ -70,7 +70,7 @@ let
7070 llvm = tools.libllvm.out // { outputUnspecified = true; };
7171
7272 libclang = callPackage ./clang {
73− inherit clang-tools-extra_src llvm_meta;
73+ inherit llvm_meta;
7474 };
7575
7676 clang-unwrapped = tools.libclang.out // { outputUnspecified = true; };
@@ -116,7 +116,6 @@ let
116116
117117 lld = callPackage ./lld {
118118 inherit llvm_meta;
119− inherit (libraries) libunwind;
120119 };
121120
122121 lldb = callPackage ./lldb {
@@ -214,7 +213,7 @@ let
214213 });
215214
216215 libraries = lib.makeExtensible (libraries: let
217− callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
216+ callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version src; });
218217 in {
219218
220219 compiler-rt-libc = callPackage ./compiler-rt {
@@ -256,7 +255,6 @@ let
256255
257256 libunwind = callPackage ./libunwind {
258257 inherit llvm_meta;
259− inherit (buildLlvmTools) llvm;
260258 stdenv = if stdenv.hostPlatform.useLLVM or false
261259 then overrideCC stdenv buildLlvmTools.clangNoLibcxx
262260 else stdenv;