File 0006-Fix-libclang-usage.patch of Package rstudio

From e93996837bceb3bdae376332be5aca964a2737ff Mon Sep 17 00:00:00 2001
From: Aaron Puchert <aaronpuchert@alice-dsl.net>
Date: Mon, 7 Sep 2020 11:12:26 +0200
Subject: [PATCH 6/8] Fix libclang usage

---
 src/cpp/core/include/core/libclang/LibClang.hpp |  1 +
 src/cpp/core/libclang/LibClang.cpp              | 14 +++++---------
 2 files changed, 6 insertions(+), 9 deletions(-)

--- a/src/cpp/core/include/core/libclang/LibClang.hpp
+++ b/src/cpp/core/include/core/libclang/LibClang.hpp
@@ -36,6 +36,7 @@
 
 #include "clang-c/Index.h"
 #include "clang-c/CXCompilationDatabase.h"
+#include "clang-c/Documentation.h"
 
 namespace rstudio {
 namespace core {
--- a/src/cpp/core/libclang/LibClang.cpp
+++ b/src/cpp/core/libclang/LibClang.cpp
@@ -62,12 +62,11 @@ std::vector<std::string> defaultCompileA
 
    // we need to add in the associated libclang headers as
    // they are not discovered / used by default during compilation
-   FilePath llvmPath = s_libraryPath.getParent().getParent();
-   boost::format fmt("%1%/lib/clang/%2%/include");
+   FilePath llvmPath = s_libraryPath.getParent();
+   boost::format fmt("%1%/clang/%2%/include");
    fmt % llvmPath.getAbsolutePath() % version.asString();
    std::string includePath = fmt.str();
-   if (FilePath(includePath).exists())
-     compileArgs.push_back(std::string("-I") + includePath);
+   compileArgs.push_back(std::string("-I") + includePath);
 
    return compileArgs;
 }
@@ -89,12 +88,9 @@ std::vector<std::string> systemClangVers
 #elif defined(__unix__)
    // default set of versions
    clangVersions = {
-      "/usr/lib/libclang.so",
-      "/usr/lib/llvm/libclang.so",
-      "/usr/lib64/libclang.so",
-      "/usr/lib64/llvm/libclang.so",
+      "LIBCLANG_PLACEHOLDER",
    };
-   
+#elif 0
    // iterate through the set of available 'llvm' directories
    for (const char* prefix : {"/usr/lib", "/usr/lib64"})
    {
openSUSE Build Service is sponsored by