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