Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rstudio: clean up and refactor #357034

Merged
merged 5 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 16 additions & 36 deletions pkgs/applications/editors/rstudio/clang-location.patch
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
diff --git a/src/cpp/core/libclang/LibClang.cpp b/src/cpp/core/libclang/LibClang.cpp
index f166a43b37..d8024b2ce7 100644
--- a/src/cpp/core/libclang/LibClang.cpp
+++ b/src/cpp/core/libclang/LibClang.cpp
@@ -62,7 +62,7 @@

// 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();
+ FilePath llvmPath("@libclang@");
boost::format fmt("%1%/lib/clang/%2%/include");
fmt % llvmPath.getAbsolutePath() % version.asString();
std::string includePath = fmt.str();
@@ -74,47 +74,7 @@

std::vector<std::string> systemClangVersions()
{
- std::vector<std::string> clangVersions;
-
-#if defined(__APPLE__)
- // NOTE: the version of libclang.dylib bundled with Xcode
- // doesn't seem to work well when loaded as a library
- // (there seems to be extra orchestration required to get
- // include paths set up; easier to just depend on command
- // line tools since we request their installation in other
- // contexts as well)
- clangVersions = {
@@ -84,34 +84,13 @@ std::vector<std::string> systemClangVersions()
// line tools since we request their installation in other
// contexts as well)
clangVersions = {
- "/Library/Developer/CommandLineTools/usr/lib/libclang.dylib"
- };
-#elif defined(__unix__)
- // default set of versions
- clangVersions = {
+ "@libclang@/lib/libclang.dylib"
};
#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@/lib/libclang.so",
};
-
- // iterate through the set of available 'llvm' directories
- for (const char* prefix : {"/usr/lib", "/usr/lib64"})
Expand All @@ -51,11 +36,6 @@
- if (path.getFilename().find("llvm") == 0)
- clangVersions.push_back(path.completePath("lib/libclang.so.1").getAbsolutePath());
- }
-#endif
-
- return clangVersions;
+ return std::vector<std::string> { "@libclang.so@" };
}



#endif

return clangVersions;
Loading
Loading