nixpkgs-suyu/pkgs/development/tools/clang-tools/default.nix
Andreas Herrmann 4a3e6d3091 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.
2016-09-28 09:31:30 +02:00

28 lines
692 B
Nix

{ 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 ];
};
}