llvmPackages_{12,13,14,15,16,17,18,19,20,git}.lld: nixfmt

authored by Tristan Ross and committed by Alyssa Ross 80f5345b 436e8094

+58 -38
+58 -38
pkgs/development/compilers/llvm/common/lld/default.nix
··· 1 - { lib 2 - , stdenv 3 - , llvm_meta 4 - , release_version 5 - , buildLlvmTools 6 - , monorepoSrc ? null 7 - , src ? null 8 - , runCommand 9 - , cmake 10 - , ninja 11 - , libxml2 12 - , libllvm 13 - , version 14 - , devExtraCmakeFlags ? [] 15 - , getVersionFile 16 - , fetchpatch 17 }: 18 stdenv.mkDerivation (finalAttrs: { 19 pname = "lld"; ··· 21 22 src = 23 if monorepoSrc != null then 24 - runCommand "lld-src-${version}" { inherit (monorepoSrc) passthru; } ('' 25 - mkdir -p "$out" 26 - '' + lib.optionalString (lib.versionAtLeast release_version "14") '' 27 - cp -r ${monorepoSrc}/cmake "$out" 28 - '' + '' 29 - cp -r ${monorepoSrc}/lld "$out" 30 - mkdir -p "$out/libunwind" 31 - cp -r ${monorepoSrc}/libunwind/include "$out/libunwind" 32 - mkdir -p "$out/llvm" 33 - '') else src; 34 35 sourceRoot = "${finalAttrs.src.name}/lld"; 36 ··· 39 ++ lib.optional (lib.versions.major release_version == "14") ( 40 getVersionFile "lld/fix-root-src-dir.patch" 41 ) 42 - ++ lib.optional ( 43 - lib.versionAtLeast release_version "16" && lib.versionOlder release_version "18" 44 - ) (getVersionFile "lld/add-table-base.patch") 45 ++ lib.optional (lib.versions.major release_version == "18") ( 46 # https://github.com/llvm/llvm-project/pull/97122 47 fetchpatch { ··· 53 ); 54 55 nativeBuildInputs = [ cmake ] ++ lib.optional (lib.versionAtLeast release_version "15") ninja; 56 - buildInputs = [ libllvm libxml2 ]; 57 58 - cmakeFlags = lib.optionals (lib.versionOlder release_version "14") [ 59 - (lib.cmakeFeature "LLVM_CONFIG_PATH" "${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}") 60 - ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ 61 - (lib.cmakeFeature "LLD_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/lld") 62 - ] ++ [ 63 - (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") 64 - ] ++ devExtraCmakeFlags; 65 66 postPatch = lib.optionalString (lib.versionOlder release_version "14") '' 67 substituteInPlace MachO/CMakeLists.txt --replace-fail \ ··· 71 # Musl's default stack size is too small for lld to be able to link Firefox. 72 LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152"; 73 74 - outputs = [ "out" "lib" "dev" ]; 75 76 meta = llvm_meta // { 77 homepage = "https://lld.llvm.org/";
··· 1 + { 2 + lib, 3 + stdenv, 4 + llvm_meta, 5 + release_version, 6 + buildLlvmTools, 7 + monorepoSrc ? null, 8 + src ? null, 9 + runCommand, 10 + cmake, 11 + ninja, 12 + libxml2, 13 + libllvm, 14 + version, 15 + devExtraCmakeFlags ? [ ], 16 + getVersionFile, 17 + fetchpatch, 18 }: 19 stdenv.mkDerivation (finalAttrs: { 20 pname = "lld"; ··· 22 23 src = 24 if monorepoSrc != null then 25 + runCommand "lld-src-${version}" { inherit (monorepoSrc) passthru; } ( 26 + '' 27 + mkdir -p "$out" 28 + '' 29 + + lib.optionalString (lib.versionAtLeast release_version "14") '' 30 + cp -r ${monorepoSrc}/cmake "$out" 31 + '' 32 + + '' 33 + cp -r ${monorepoSrc}/lld "$out" 34 + mkdir -p "$out/libunwind" 35 + cp -r ${monorepoSrc}/libunwind/include "$out/libunwind" 36 + mkdir -p "$out/llvm" 37 + '' 38 + ) 39 + else 40 + src; 41 42 sourceRoot = "${finalAttrs.src.name}/lld"; 43 ··· 46 ++ lib.optional (lib.versions.major release_version == "14") ( 47 getVersionFile "lld/fix-root-src-dir.patch" 48 ) 49 + ++ lib.optional (lib.versionAtLeast release_version "16" && lib.versionOlder release_version "18") ( 50 + getVersionFile "lld/add-table-base.patch" 51 + ) 52 ++ lib.optional (lib.versions.major release_version == "18") ( 53 # https://github.com/llvm/llvm-project/pull/97122 54 fetchpatch { ··· 60 ); 61 62 nativeBuildInputs = [ cmake ] ++ lib.optional (lib.versionAtLeast release_version "15") ninja; 63 + buildInputs = [ 64 + libllvm 65 + libxml2 66 + ]; 67 68 + cmakeFlags = 69 + lib.optionals (lib.versionOlder release_version "14") [ 70 + (lib.cmakeFeature "LLVM_CONFIG_PATH" "${libllvm.dev}/bin/llvm-config${ 71 + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native" 72 + }") 73 + ] 74 + ++ lib.optionals (lib.versionAtLeast release_version "15") [ 75 + (lib.cmakeFeature "LLD_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/lld") 76 + ] 77 + ++ [ 78 + (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") 79 + ] 80 + ++ devExtraCmakeFlags; 81 82 postPatch = lib.optionalString (lib.versionOlder release_version "14") '' 83 substituteInPlace MachO/CMakeLists.txt --replace-fail \ ··· 87 # Musl's default stack size is too small for lld to be able to link Firefox. 88 LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-Wl,-z,stack-size=2097152"; 89 90 + outputs = [ 91 + "out" 92 + "lib" 93 + "dev" 94 + ]; 95 96 meta = llvm_meta // { 97 homepage = "https://lld.llvm.org/";