aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-06-29 02:24:59 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-06-29 02:25:23 +0200
commitc420e3ce861bff2433c7f3e6da3bb9df18c8e095 (patch)
treed76b4be3db76f7305080ffa0b9ba82c9020dff7b
parent11567dc05cba0c8c5cd36523063066666a212caf (diff)
downloadponymap-c420e3ce861bff2433c7f3e6da3bb9df18c8e095.tar.gz
ponymap-c420e3ce861bff2433c7f3e6da3bb9df18c8e095.tar.xz
ponymap-c420e3ce861bff2433c7f3e6da3bb9df18c8e095.zip
Fix plugin search path on Nix
Even its non-full GNUInstallDirs paths are absolute, which is apparently allowed.
-rw-r--r--CMakeLists.txt1
-rw-r--r--config.h.in2
-rw-r--r--ponymap.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6750eb9..fb004be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,6 +70,7 @@ set (project_headers ${PROJECT_BINARY_DIR}/config.h)
# Generate a configuration file
include (GNUInstallDirs)
set (plugin_dir ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})
+set (full_plugin_dir ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME})
configure_file (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h)
include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
diff --git a/config.h.in b/config.h.in
index d35dfe2..124feae 100644
--- a/config.h.in
+++ b/config.h.in
@@ -5,6 +5,6 @@
#define PROGRAM_VERSION "${PROJECT_VERSION}"
#cmakedefine WITH_LUA
-#define PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${plugin_dir}"
+#define PLUGIN_DIR "${full_plugin_dir}"
#endif // ! CONFIG_H
diff --git a/ponymap.c b/ponymap.c
index 1c93f88..41255d4 100644
--- a/ponymap.c
+++ b/ponymap.c
@@ -840,6 +840,7 @@ load_one_plugin (struct app_context *ctx, const char *name, const char *path)
void *table = dlopen (path, RTLD_LAZY | RTLD_LOCAL);
if (!table)
{
+ print_debug ("%s", path);
print_error ("could not load `%s': %s", name, dlerror ());
return false;
}
@@ -874,6 +875,7 @@ load_plugins (struct app_context *ctx)
DIR *dir = opendir (plugin_dir);
if (!dir)
{
+ print_debug ("%s", plugin_dir);
print_fatal ("%s: %s",
"cannot open plugin directory", strerror (errno));
return false;