2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, llvmPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
clang = llvmPackages.clang-unwrapped;
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "clang-tools";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = lib.getVersion clang;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2021-02-05 17:12:51 +00:00
|
|
|
export libc_includes="${lib.getDev stdenv.cc.libc}/include"
|
2020-04-24 23:36:52 +00:00
|
|
|
export libcpp_includes="${llvmPackages.libcxx}/include/c++/v1"
|
|
|
|
|
|
|
|
export clang=${clang}
|
|
|
|
substituteAll ${./wrapper} $out/bin/clangd
|
|
|
|
chmod +x $out/bin/clangd
|
|
|
|
for tool in \
|
|
|
|
clang-apply-replacements \
|
|
|
|
clang-check \
|
|
|
|
clang-format \
|
|
|
|
clang-rename \
|
|
|
|
clang-tidy
|
|
|
|
do
|
|
|
|
ln -s $out/bin/clangd $out/bin/$tool
|
|
|
|
done
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = clang.meta // {
|
|
|
|
description = "Standalone command line tools for C++ development";
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with lib.maintainers; [ aherrmann ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|