fix clangd wrapper

* get libc-cflags and libcxx-cxxflags from the sibling clang
  derivation.

* fix the order of those for C++ (libc-cflags use -idirafter for a
  reason).
This commit is contained in:
Michael Livshin
2021-04-24 10:37:57 +03:00
parent cd0ffd3f5f
commit 782cb7aea0
2 changed files with 19 additions and 12 deletions
@@ -1,22 +1,22 @@
{ lib, stdenv, llvmPackages }:
let
clang = llvmPackages.clang-unwrapped;
unwrapped = llvmPackages.clang-unwrapped;
in stdenv.mkDerivation {
pname = "clang-tools";
version = lib.getVersion clang;
version = lib.getVersion unwrapped;
dontUnpack = true;
clang = llvmPackages.clang;
inherit unwrapped;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
export libc_includes="${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
for tool in \
@@ -32,7 +32,7 @@ in stdenv.mkDerivation {
runHook postInstall
'';
meta = clang.meta // {
meta = unwrapped.meta // {
description = "Standalone command line tools for C++ development";
maintainers = with lib.maintainers; [ aherrmann ];
};