llvmPackages_15: switch to using ninja

This commit is contained in:
Rahul Butani 2022-10-05 10:21:58 -05:00
parent 19d1571ee4
commit 912056c71e
No known key found for this signature in database
10 changed files with 26 additions and 30 deletions

View file

@ -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

View file

@ -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;

View file

@ -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 {

View file

@ -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 = {

View file

@ -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 = [

View file

@ -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"

View file

@ -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 = [

View file

@ -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 = [];

View file

@ -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;

View file

@ -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)
];