From cb280a3a24a897088067766c895a4ecc335eb152 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Sun, 30 Mar 2025 20:44:13 -0700 Subject: [PATCH] llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libcxx: move src --- .../compilers/llvm/common/libcxx/default.nix | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/pkgs/development/compilers/llvm/common/libcxx/default.nix b/pkgs/development/compilers/llvm/common/libcxx/default.nix index 929d31c49738..2a3168a57ad2 100644 --- a/pkgs/development/compilers/llvm/common/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/common/libcxx/default.nix @@ -32,25 +32,6 @@ let # Note: useLLVM is likely false for Darwin but true under pkgsLLVM useLLVM = stdenv.hostPlatform.useLLVM or false; - src' = if monorepoSrc != null then - runCommand "libcxx-src-${version}" { inherit (monorepoSrc) passthru; } ('' - mkdir -p "$out/llvm" - '' + (lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '') + '' - cp -r ${monorepoSrc}/libcxx "$out" - cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" - cp -r ${monorepoSrc}/llvm/utils "$out/llvm" - '' + (lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/third-party "$out" - '') + (lib.optionalString (lib.versionAtLeast release_version "20") '' - cp -r ${monorepoSrc}/libc "$out" - '') + '' - cp -r ${monorepoSrc}/runtimes "$out" - '' + (lib.optionalString (cxxabi == null) '' - cp -r ${monorepoSrc}/libcxxabi "$out" - '')) else src; - cxxabiCMakeFlags = lib.optionals (lib.versionAtLeast release_version "18") [ (lib.cmakeBool "LIBCXXABI_USE_LLVM_UNWINDER" false) ] ++ lib.optionals (useLLVM && !stdenv.hostPlatform.isWasm) (if lib.versionAtLeast release_version "18" then [ @@ -120,7 +101,24 @@ stdenv.mkDerivation (finalAttrs: { pname = "libcxx"; inherit version cmakeFlags; - src = src'; + src = if monorepoSrc != null then + runCommand "libcxx-src-${version}" { inherit (monorepoSrc) passthru; } ('' + mkdir -p "$out/llvm" + '' + (lib.optionalString (lib.versionAtLeast release_version "14") '' + cp -r ${monorepoSrc}/cmake "$out" + '') + '' + cp -r ${monorepoSrc}/libcxx "$out" + cp -r ${monorepoSrc}/llvm/cmake "$out/llvm" + cp -r ${monorepoSrc}/llvm/utils "$out/llvm" + '' + (lib.optionalString (lib.versionAtLeast release_version "14") '' + cp -r ${monorepoSrc}/third-party "$out" + '') + (lib.optionalString (lib.versionAtLeast release_version "20") '' + cp -r ${monorepoSrc}/libc "$out" + '') + '' + cp -r ${monorepoSrc}/runtimes "$out" + '' + (lib.optionalString (cxxabi == null) '' + cp -r ${monorepoSrc}/libcxxabi "$out" + '')) else src; outputs = [ "out" "dev" ];