2019-06-16 21:59:06 +02:00
|
|
|
{ stdenv, llvmPackages }:
|
2016-09-27 23:55:26 +02:00
|
|
|
|
|
|
|
let
|
2019-01-05 12:19:37 +01:00
|
|
|
clang = llvmPackages.clang-unwrapped;
|
2018-11-15 06:18:49 +01:00
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "clang-tools";
|
2016-09-27 23:55:26 +02:00
|
|
|
version = stdenv.lib.getVersion clang;
|
|
|
|
|
2019-06-19 17:45:34 +02:00
|
|
|
dontUnpack = true;
|
2018-11-15 06:18:49 +01:00
|
|
|
|
2018-12-12 15:11:17 +01:00
|
|
|
installPhase = ''
|
2018-11-15 06:18:49 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2018-12-12 15:11:17 +01:00
|
|
|
mkdir -p $out/bin
|
2019-11-13 15:38:22 +01:00
|
|
|
export libc_includes="${stdenv.lib.getDev stdenv.cc.libc}/include"
|
|
|
|
export libcpp_includes="${llvmPackages.libcxx}/include/c++/v1"
|
|
|
|
|
|
|
|
export clang=${clang}
|
|
|
|
substituteAll ${./wrapper} $out/bin/clangd
|
|
|
|
chmod +x $out/bin/clangd
|
2016-09-27 23:55:26 +02:00
|
|
|
for tool in \
|
|
|
|
clang-apply-replacements \
|
|
|
|
clang-check \
|
|
|
|
clang-format \
|
|
|
|
clang-rename \
|
2019-11-13 15:38:22 +01:00
|
|
|
clang-tidy
|
2016-09-27 23:55:26 +02:00
|
|
|
do
|
2019-11-13 15:38:22 +01:00
|
|
|
ln -s $out/bin/clangd $out/bin/$tool
|
2016-09-27 23:55:26 +02:00
|
|
|
done
|
2018-11-15 06:18:49 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-09-27 23:55:26 +02:00
|
|
|
'';
|
2018-11-15 06:18:49 +01:00
|
|
|
|
2016-09-27 23:55:26 +02:00
|
|
|
meta = clang.meta // {
|
|
|
|
description = "Standalone command line tools for C++ development";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ aherrmann ];
|
|
|
|
};
|
|
|
|
}
|