llvmPackages_git: Build from Git

The version will initially remain the same so that no additional changes
to the packaging are required (i.e. this commit only includes the
required changes to build from the mono repository instead of individual
tarballs).

+40 -77
+3 -10
pkgs/development/compilers/llvm/git/clang/default.nix
··· 1 - { lib, stdenv, llvm_meta, fetch, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 1 + { lib, stdenv, llvm_meta, src, cmake, libxml2, libllvm, version, python3 2 2 , buildLlvmTools 3 3 , fixDarwinDylibNames 4 4 , enableManpages ? false ··· 9 9 pname = "clang"; 10 10 inherit version; 11 11 12 - src = fetch "clang" "1vd9rhhrd8ghdg111lac7w8by71y9l14yh5zxfijsm6lj4p4avp2"; 13 - inherit clang-tools-extra_src; 14 - 15 - unpackPhase = '' 16 - unpackFile $src 17 - mv clang-* clang 18 - sourceRoot=$PWD/clang 19 - unpackFile ${clang-tools-extra_src} 20 - ''; 12 + inherit src; 13 + sourceRoot = "source/clang"; 21 14 22 15 nativeBuildInputs = [ cmake python3 ] 23 16 ++ lib.optional enableManpages python3.pkgs.sphinx
+4 -2
pkgs/development/compilers/llvm/git/compiler-rt/default.nix
··· 1 - { lib, stdenv, llvm_meta, version, fetch, cmake, python3, llvm, libcxxabi }: 1 + { lib, stdenv, llvm_meta, version, src, cmake, python3, llvm, libcxxabi }: 2 2 3 3 let 4 4 ··· 12 12 stdenv.mkDerivation { 13 13 pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 14 inherit version; 15 - src = fetch "compiler-rt" "0d444qihq9jhqnfv003cr704v363va72zl6qaw2algj1c85cva45"; 15 + 16 + inherit src; 17 + sourceRoot = "source/compiler-rt"; 16 18 17 19 nativeBuildInputs = [ cmake python3 llvm.dev ]; 18 20 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+9 -11
pkgs/development/compilers/llvm/git/default.nix
··· 1 1 { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 2 , gccForLibs, preLibcCrossHeaders 3 - , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 3 + , libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith 4 4 , buildLlvmTools # tools, but from the previous stage, for cross 5 5 , targetLlvmLibraries # libraries, but from the next stage, for cross 6 6 # This is the default binutils, but with *this* version of LLD rather ··· 24 24 version = "${release_version}${dash-candidate}"; # differentiating these (variables) is important for RCs 25 25 targetConfig = stdenv.targetPlatform.config; 26 26 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"; 30 32 }; 31 33 32 - clang-tools-extra_src = fetch "clang-tools-extra" "0p3dzr0qa7mar83y66xa5m5apynf6ia0lsdsq6axwnm64ysy0hdd"; 33 - 34 34 llvm_meta = { 35 35 license = lib.licenses.ncsa; 36 36 maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ]; ··· 38 38 }; 39 39 40 40 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; }); 42 42 mkExtraBuildCommands0 = cc: '' 43 43 rsrc="$out/resource-root" 44 44 mkdir "$rsrc" ··· 70 70 llvm = tools.libllvm.out // { outputUnspecified = true; }; 71 71 72 72 libclang = callPackage ./clang { 73 - inherit clang-tools-extra_src llvm_meta; 73 + inherit llvm_meta; 74 74 }; 75 75 76 76 clang-unwrapped = tools.libclang.out // { outputUnspecified = true; }; ··· 116 116 117 117 lld = callPackage ./lld { 118 118 inherit llvm_meta; 119 - inherit (libraries) libunwind; 120 119 }; 121 120 122 121 lldb = callPackage ./lldb { ··· 214 213 }); 215 214 216 215 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; }); 218 217 in { 219 218 220 219 compiler-rt-libc = callPackage ./compiler-rt { ··· 256 255 257 256 libunwind = callPackage ./libunwind { 258 257 inherit llvm_meta; 259 - inherit (buildLlvmTools) llvm; 260 258 stdenv = if stdenv.hostPlatform.useLLVM or false 261 259 then overrideCC stdenv buildLlvmTools.clangNoLibcxx 262 260 else stdenv;
+4 -10
pkgs/development/compilers/llvm/git/libcxx/default.nix
··· 1 - { lib, stdenv, llvm_meta, fetch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version 1 + { lib, stdenv, llvm_meta, src, cmake, python3, libcxxabi, fixDarwinDylibNames, version 2 2 , enableShared ? !stdenv.hostPlatform.isStatic 3 3 }: 4 4 5 - stdenv.mkDerivation { 5 + stdenv.mkDerivation rec { 6 6 pname = "libcxx"; 7 7 inherit version; 8 8 9 - src = fetch "libcxx" "1wf3ww29xkx7prs7pdwicy5qqfapib26110jgmkjrbka9z57bjvx"; 10 - 11 - postUnpack = '' 12 - unpackFile ${libcxxabi.src} 13 - mv libcxxabi-* libcxxabi 14 - unpackFile ${llvm.src} 15 - mv llvm-* llvm 16 - ''; 9 + inherit src; 10 + sourceRoot = "source/${pname}"; 17 11 18 12 outputs = [ "out" "dev" ]; 19 13
+5 -9
pkgs/development/compilers/llvm/git/libcxxabi/default.nix
··· 1 - { lib, stdenv, llvm_meta, cmake, python3, fetch, libcxx, libunwind, llvm, version 1 + { lib, stdenv, llvm_meta, cmake, python3, src, libunwind, version 2 2 , enableShared ? !stdenv.hostPlatform.isStatic 3 3 }: 4 4 5 - stdenv.mkDerivation { 5 + stdenv.mkDerivation rec { 6 6 pname = "libcxxabi"; 7 7 inherit version; 8 8 9 - src = fetch "libcxxabi" "1cbmzspwjlr8f6sp73pw6ivf4dpg6rpc61by0q1m2zca2k6yif3a"; 9 + inherit src; 10 + sourceRoot = "source/${pname}"; 10 11 11 12 outputs = [ "out" "dev" ]; 12 13 13 - postUnpack = '' 14 - unpackFile ${libcxx.src} 15 - mv libcxx-* libcxx 16 - unpackFile ${llvm.src} 17 - mv llvm-* llvm 18 - '' + lib.optionalString stdenv.isDarwin '' 14 + postUnpack = lib.optionalString stdenv.isDarwin '' 19 15 export TRIPLE=x86_64-apple-darwin 20 16 '' + lib.optionalString stdenv.hostPlatform.isMusl '' 21 17 patch -p1 -d libcxx -i ${../../libcxx-0001-musl-hacks.patch}
+3 -9
pkgs/development/compilers/llvm/git/libunwind/default.nix
··· 1 - { lib, stdenv, llvm_meta, version, fetch, libcxx, llvm, cmake 1 + { lib, stdenv, llvm_meta, version, src, cmake 2 2 , enableShared ? !stdenv.hostPlatform.isStatic 3 3 }: 4 4 ··· 6 6 pname = "libunwind"; 7 7 inherit version; 8 8 9 - src = fetch pname "1x8wpmsrsgnwj2v5ih52ylni7r6n8gzkcj6hx65zbxski2rablly"; 10 - 11 - postUnpack = '' 12 - unpackFile ${libcxx.src} 13 - mv libcxx-* libcxx 14 - unpackFile ${llvm.src} 15 - mv llvm-* llvm 16 - ''; 9 + inherit src; 10 + sourceRoot = "source/${pname}"; 17 11 18 12 patches = [ 19 13 ./gnu-install-dirs.patch
+3 -10
pkgs/development/compilers/llvm/git/lld/default.nix
··· 1 1 { lib, stdenv, llvm_meta 2 2 , buildLlvmTools 3 - , fetch 4 - , libunwind 3 + , src 5 4 , cmake 6 5 , libxml2 7 6 , libllvm ··· 12 11 pname = "lld"; 13 12 inherit version; 14 13 15 - src = fetch pname "1zakyxk5bwnh7jarckcd4rbmzi58jgn2dbah5j5cwcyfyfbx9drc"; 14 + inherit src; 15 + sourceRoot = "source/${pname}"; 16 16 17 17 patches = [ 18 18 ./gnu-install-dirs.patch 19 19 ]; 20 - 21 - postPatch = '' 22 - substituteInPlace MachO/CMakeLists.txt --replace \ 23 - '(''${LLVM_MAIN_SRC_DIR}/' '(' 24 - mkdir -p libunwind/include 25 - tar -xf "${libunwind.src}" --wildcards -C libunwind/include --strip-components=2 "libunwind-*/include/" 26 - ''; 27 20 28 21 nativeBuildInputs = [ cmake ]; 29 22 buildInputs = [ libllvm libxml2 ];
+3 -2
pkgs/development/compilers/llvm/git/lldb/default.nix
··· 1 1 { lib, stdenv, llvm_meta 2 2 , runCommand 3 - , fetch 3 + , src 4 4 , cmake 5 5 , zlib 6 6 , ncurses ··· 26 26 pname = "lldb"; 27 27 inherit version; 28 28 29 - src = fetch pname "1v85qyq3snk81vjmwq5q7xikyyqsfpqy2c4qmr81mps4avsw1g0l"; 29 + inherit src; 30 + sourceRoot = "source/${pname}"; 30 31 31 32 patches = [ 32 33 ./procfs.patch
+3 -12
pkgs/development/compilers/llvm/git/llvm/default.nix
··· 1 1 { lib, stdenv, llvm_meta 2 2 , pkgsBuildBuild 3 - , fetch 3 + , src 4 4 , fetchpatch 5 5 , cmake 6 6 , python3 ··· 34 34 pname = "llvm"; 35 35 inherit version; 36 36 37 - src = fetch pname "0l4b79gwfvxild974aigcq1yigypjsk2j5p59syhl6ksd744gp29"; 38 - polly_src = fetch "polly" "1ixl9yj526n8iqh9ckyiah2vzravs9d1akybqq7rvy32n9vgr6hd"; 39 - 40 - unpackPhase = '' 41 - unpackFile $src 42 - mv llvm-${release_version}* llvm 43 - sourceRoot=$PWD/llvm 44 - '' + optionalString enablePolly '' 45 - unpackFile $polly_src 46 - mv polly-* $sourceRoot/tools/polly 47 - ''; 37 + inherit src; 38 + sourceRoot = "source/${pname}"; 48 39 49 40 outputs = [ "out" "lib" "dev" "python" ]; 50 41
+3 -2
pkgs/development/compilers/llvm/git/openmp/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , llvm_meta 4 - , fetch 4 + , src 5 5 , cmake 6 6 , llvm 7 7 , perl ··· 12 12 pname = "openmp"; 13 13 inherit version; 14 14 15 - src = fetch pname "0z8n1wanby6aq3i7d91mgk72hb33zfl5blayk0a22cs7l8i706zb"; 15 + inherit src; 16 + sourceRoot = "source/${pname}"; 16 17 17 18 nativeBuildInputs = [ cmake perl ]; 18 19 buildInputs = [ llvm ];