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