clang-tools: New package
Creates and installs wrapper scripts around the clang-tools from `llvmPackages.clang-unwrapped`. Motivation ---------- Fixes #9214 Allows to install clang-tools for C++ development without also installing the clang compiler and its tool-chain. This way it is possible to use e.g. `clang-format` without conflicting with e.g. GCC's tool-chain, or the global system tool-chain.
This commit is contained in:
parent
124f25bc7d
commit
4a3e6d3091
28
pkgs/development/tools/clang-tools/default.nix
Normal file
28
pkgs/development/tools/clang-tools/default.nix
Normal file
@ -0,0 +1,28 @@
|
||||
{ stdenv, makeWrapper, writeScript, llvmPackages }:
|
||||
|
||||
let
|
||||
clang = llvmPackages.clang-unwrapped;
|
||||
version = stdenv.lib.getVersion clang;
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "clang-tools-${version}";
|
||||
builder = writeScript "builder" ''
|
||||
source $stdenv/setup
|
||||
for tool in \
|
||||
clang-apply-replacements \
|
||||
clang-check \
|
||||
clang-format \
|
||||
clang-rename \
|
||||
clang-tidy
|
||||
do
|
||||
makeWrapper $clang/bin/$tool $out/bin/$tool --argv0 $tool
|
||||
done
|
||||
'';
|
||||
buildInputs = [ makeWrapper ];
|
||||
inherit clang;
|
||||
meta = clang.meta // {
|
||||
description = "Standalone command line tools for C++ development";
|
||||
maintainers = with stdenv.lib.maintainers; [ aherrmann ];
|
||||
};
|
||||
}
|
@ -4424,6 +4424,8 @@ in
|
||||
clang_35 = wrapCC llvmPackages_35.clang;
|
||||
clang_34 = wrapCC llvmPackages_34.clang;
|
||||
|
||||
clang-tools = callPackage ../development/tools/clang-tools { };
|
||||
|
||||
clang-analyzer = callPackage ../development/tools/analysis/clang-analyzer { };
|
||||
|
||||
clangUnwrapped = llvm: pkg: callPackage pkg { inherit llvm; };
|
||||
|
Loading…
Reference in New Issue
Block a user