build: remove IMHEX_PLUGINS_IN_SHARE option + only allow AppImage to load plugins from inside itself

Rationale: The `IMHEX_PLUGINS_IN_SHARE` is a hack to prevent the appimage from loading plugin from system imhex installation, like /usr/lib/imhex/

In reality, I do not think people compile plugins specifically for the AppImage (plugins must be compiled for the specific imhex & compiler version the imhex binary is used), and this lets us remove the hack
This commit is contained in:
iTrooz
2025-12-14 18:29:00 +01:00
parent 07b6fa0e2e
commit 49bbe7dc77
4 changed files with 23 additions and 20 deletions

View File

@@ -97,6 +97,13 @@ namespace hex::paths {
}
static std::vector<std::fs::path> getPluginPaths() {
// If running from an AppImage, only allow loaded plugins from inside it
#if defined(OS_LINUX)
if(const char* appdir = std::getenv("APPDIR")) { // check for AppImage environment
return {std::string(appdir) + "/usr/lib/imhex"};
}
#endif
std::vector<std::fs::path> paths = getDataPaths(true);
// Add the system plugin directory to the path if one was provided at compile time