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