From 912056c71ec2dc4f09ef6f2ab82f943f8aa69c2b Mon Sep 17 00:00:00 2001 From: Rahul Butani Date: Wed, 5 Oct 2022 10:21:58 -0500 Subject: [PATCH] llvmPackages_15: switch to using `ninja` --- pkgs/development/compilers/llvm/15/clang/default.nix | 8 +++----- .../compilers/llvm/15/compiler-rt/default.nix | 4 ++-- pkgs/development/compilers/llvm/15/default.nix | 6 +++--- .../development/compilers/llvm/15/libcxx/default.nix | 6 +++--- .../compilers/llvm/15/libcxxabi/default.nix | 4 ++-- .../compilers/llvm/15/libunwind/default.nix | 3 ++- pkgs/development/compilers/llvm/15/lld/default.nix | 3 ++- pkgs/development/compilers/llvm/15/lldb/default.nix | 7 +++---- pkgs/development/compilers/llvm/15/llvm/default.nix | 12 ++++-------- .../development/compilers/llvm/15/openmp/default.nix | 3 ++- 10 files changed, 26 insertions(+), 30 deletions(-) diff --git a/pkgs/development/compilers/llvm/15/clang/default.nix b/pkgs/development/compilers/llvm/15/clang/default.nix index d10c358ae197..6102947b1afd 100644 --- a/pkgs/development/compilers/llvm/15/clang/default.nix +++ b/pkgs/development/compilers/llvm/15/clang/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, llvm_meta , monorepoSrc, runCommand -, substituteAll, cmake, libxml2, libllvm, version, python3 +, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -20,7 +20,7 @@ let sourceRoot = "${src.name}/${pname}"; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake ninja python3 ] ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; @@ -114,9 +114,7 @@ let } // lib.optionalAttrs enableManpages { pname = "clang-manpages"; - buildPhase = '' - make docs-clang-man - ''; + ninjaFlags = [ "docs-clang-man" ]; installPhase = '' mkdir -p $out/share/man/man1 diff --git a/pkgs/development/compilers/llvm/15/compiler-rt/default.nix b/pkgs/development/compilers/llvm/15/compiler-rt/default.nix index fbfff9ad10fd..bc7195b836a1 100644 --- a/pkgs/development/compilers/llvm/15/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/15/compiler-rt/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, llvm_meta, version , monorepoSrc, runCommand -, cmake, python3, xcbuild, libllvm, libcxxabi, libxcrypt +, cmake, ninja, python3, xcbuild, libllvm, libcxxabi, libxcrypt , doFakeLibgcc ? stdenv.hostPlatform.isFreeBSD }: @@ -27,7 +27,7 @@ stdenv.mkDerivation { inherit src; sourceRoot = "${src.name}/${baseName}"; - nativeBuildInputs = [ cmake python3 libllvm.dev ] + nativeBuildInputs = [ cmake ninja python3 libllvm.dev ] ++ lib.optional stdenv.isDarwin xcbuild.xcrun; buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; diff --git a/pkgs/development/compilers/llvm/15/default.nix b/pkgs/development/compilers/llvm/15/default.nix index b729616843d2..3a48a5b0e00a 100644 --- a/pkgs/development/compilers/llvm/15/default.nix +++ b/pkgs/development/compilers/llvm/15/default.nix @@ -1,4 +1,4 @@ -{ lowPrio, newScope, pkgs, lib, stdenv, stdenvNoCC, cmake +{ lowPrio, newScope, pkgs, lib, stdenv, stdenvNoCC, cmake, ninja , gccForLibs, preLibcCrossHeaders , libxml2, python3, isl, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross @@ -41,7 +41,7 @@ let }; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version monorepoSrc buildLlvmTools; }); + callPackage = newScope (tools // { inherit stdenv cmake ninja libxml2 python3 isl release_version version monorepoSrc buildLlvmTools; }); mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" @@ -220,7 +220,7 @@ let }); libraries = lib.makeExtensible (libraries: let - callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version monorepoSrc; }); + callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake ninja libxml2 python3 isl release_version version monorepoSrc; }); in { compiler-rt-libc = callPackage ./compiler-rt { diff --git a/pkgs/development/compilers/llvm/15/libcxx/default.nix b/pkgs/development/compilers/llvm/15/libcxx/default.nix index b4d973f0b073..94374c8a312d 100644 --- a/pkgs/development/compilers/llvm/15/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/15/libcxx/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, llvm_meta , monorepoSrc, runCommand -, cmake, python3, fixDarwinDylibNames, version +, cmake, ninja, python3, fixDarwinDylibNames, version , cxxabi ? if stdenv.hostPlatform.isFreeBSD then libcxxrt else libcxxabi , libcxxabi, libcxxrt , enableShared ? !stdenv.hostPlatform.isStatic @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { patchShebangs utils/cat_files.py ''; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake ninja python3 ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames; buildInputs = lib.optionals (!headersOnly) [ cxxabi ]; @@ -88,7 +88,7 @@ stdenv.mkDerivation rec { "-DCMAKE_CXX_COMPILER_WORKS=ON" ]; - buildFlags = lib.optional headersOnly "generate-cxx-headers"; + ninjaFlags = lib.optional headersOnly "generate-cxx-headers"; installTargets = lib.optional headersOnly "install-cxx-headers"; passthru = { diff --git a/pkgs/development/compilers/llvm/15/libcxxabi/default.nix b/pkgs/development/compilers/llvm/15/libcxxabi/default.nix index ea9f7cb0772e..cb5fa44f0700 100644 --- a/pkgs/development/compilers/llvm/15/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/15/libcxxabi/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, llvm_meta, cmake, python3 +{ lib, stdenv, llvm_meta, cmake, ninja, python3 , monorepoSrc, runCommand, fetchpatch , cxx-headers, libunwind, version , enableShared ? !stdenv.hostPlatform.isStatic @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { cd ../runtimes ''; - nativeBuildInputs = [ cmake python3 ]; + nativeBuildInputs = [ cmake ninja python3 ]; buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.hostPlatform.isWasm) libunwind; cmakeFlags = [ diff --git a/pkgs/development/compilers/llvm/15/libunwind/default.nix b/pkgs/development/compilers/llvm/15/libunwind/default.nix index 0b59fff1357e..dd14e2acaf86 100644 --- a/pkgs/development/compilers/llvm/15/libunwind/default.nix +++ b/pkgs/development/compilers/llvm/15/libunwind/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, llvm_meta, version , monorepoSrc, runCommand , cmake +, ninja , python3 , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -41,7 +42,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ cmake python3 ]; + nativeBuildInputs = [ cmake ninja python3 ]; cmakeFlags = [ "-DLLVM_ENABLE_RUNTIMES=libunwind" diff --git a/pkgs/development/compilers/llvm/15/lld/default.nix b/pkgs/development/compilers/llvm/15/lld/default.nix index fea7bf227bf8..e8bca769de5f 100644 --- a/pkgs/development/compilers/llvm/15/lld/default.nix +++ b/pkgs/development/compilers/llvm/15/lld/default.nix @@ -2,6 +2,7 @@ , buildLlvmTools , monorepoSrc, runCommand , cmake +, ninja , libxml2 , libllvm , version @@ -27,7 +28,7 @@ stdenv.mkDerivation rec { ./gnu-install-dirs.patch ]; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake ninja ]; buildInputs = [ libllvm libxml2 ]; cmakeFlags = [ diff --git a/pkgs/development/compilers/llvm/15/lldb/default.nix b/pkgs/development/compilers/llvm/15/lldb/default.nix index 2b1b377abe5a..15bcb40c3b43 100644 --- a/pkgs/development/compilers/llvm/15/lldb/default.nix +++ b/pkgs/development/compilers/llvm/15/lldb/default.nix @@ -2,6 +2,7 @@ , runCommand , monorepoSrc , cmake +, ninja , zlib , ncurses , swig @@ -64,7 +65,7 @@ stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" ]; nativeBuildInputs = [ - cmake python3 which swig lit makeWrapper lua5_3 + cmake ninja python3 which swig lit makeWrapper lua5_3 ] ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; @@ -159,9 +160,7 @@ stdenv.mkDerivation (rec { } // lib.optionalAttrs enableManpages { pname = "lldb-manpages"; - buildPhase = '' - make docs-lldb-man - ''; + ninjaFlags = [ "docs-lldb-man" ]; propagatedBuildInputs = []; diff --git a/pkgs/development/compilers/llvm/15/llvm/default.nix b/pkgs/development/compilers/llvm/15/llvm/default.nix index 558c9a4828c3..8eba6a717e7c 100644 --- a/pkgs/development/compilers/llvm/15/llvm/default.nix +++ b/pkgs/development/compilers/llvm/15/llvm/default.nix @@ -4,6 +4,7 @@ , runCommand , fetchpatch , cmake +, ninja , python3 , libffi , libbfd @@ -49,7 +50,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake ninja python3 ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -245,15 +246,10 @@ in stdenv.mkDerivation (rec { } // lib.optionalAttrs enableManpages { pname = "llvm-manpages"; - buildPhase = '' - make docs-llvm-man - ''; - propagatedBuildInputs = []; - installPhase = '' - make -C docs install - ''; + ninjaFlags = [ "docs-llvm-man" ]; + installTargets = [ "install-docs-llvm-man" ]; postPatch = null; postInstall = null; diff --git a/pkgs/development/compilers/llvm/15/openmp/default.nix b/pkgs/development/compilers/llvm/15/openmp/default.nix index 7c2ab76c5258..52aeb4bd9800 100644 --- a/pkgs/development/compilers/llvm/15/openmp/default.nix +++ b/pkgs/development/compilers/llvm/15/openmp/default.nix @@ -4,6 +4,7 @@ , monorepoSrc , runCommand , cmake +, ninja , llvm , targetLlvm , lit @@ -33,7 +34,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ cmake perl pkg-config lit ]; + nativeBuildInputs = [ cmake ninja perl pkg-config lit ]; buildInputs = [ (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) ];