Make sure to always find installed plugins

This commit is contained in:
Přemysl Eric Janouch 2022-09-19 04:26:08 +02:00
parent 00184811ea
commit c0e1cd57b2
Signed by: p
GPG Key ID: A0420B94F92B9493
4 changed files with 5 additions and 1 deletions

View File

@ -225,7 +225,6 @@ add_custom_target (clang-tidy
# Installation # Installation
install (TARGETS xB xC xD DESTINATION ${CMAKE_INSTALL_BINDIR}) install (TARGETS xB xC xD DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
# XXX: our defaults for XDG_DATA_DIRS expect /usr/local/share or /usr/share
install (DIRECTORY plugins/xB/ install (DIRECTORY plugins/xB/
DESTINATION ${CMAKE_INSTALL_DATADIR}/xB/plugins USE_SOURCE_PERMISSIONS) DESTINATION ${CMAKE_INSTALL_DATADIR}/xB/plugins USE_SOURCE_PERMISSIONS)
install (DIRECTORY plugins/xC/ install (DIRECTORY plugins/xC/

View File

@ -3,6 +3,9 @@
#define PROGRAM_VERSION "${project_version}" #define PROGRAM_VERSION "${project_version}"
// We use the XDG Base Directory Specification, but may be installed anywhere.
#define PROJECT_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}"
#cmakedefine HAVE_READLINE #cmakedefine HAVE_READLINE
#cmakedefine HAVE_EDITLINE #cmakedefine HAVE_EDITLINE
#cmakedefine HAVE_LUA #cmakedefine HAVE_LUA

1
xB.c
View File

@ -1019,6 +1019,7 @@ plugin_resolve_relative_filename (const char *filename)
{ {
struct strv paths = strv_make (); struct strv paths = strv_make ();
get_xdg_data_dirs (&paths); get_xdg_data_dirs (&paths);
strv_append (&paths, PROJECT_DATADIR);
char *result = resolve_relative_filename_generic char *result = resolve_relative_filename_generic
(&paths, PROGRAM_NAME "/plugins/", filename); (&paths, PROGRAM_NAME "/plugins/", filename);
strv_free (&paths); strv_free (&paths);

1
xC.c
View File

@ -11540,6 +11540,7 @@ plugin_resolve_relative_filename (const char *filename)
{ {
struct strv paths = strv_make (); struct strv paths = strv_make ();
get_xdg_data_dirs (&paths); get_xdg_data_dirs (&paths);
strv_append (&paths, PROJECT_DATADIR);
char *result = resolve_relative_filename_generic char *result = resolve_relative_filename_generic
(&paths, PROGRAM_NAME "/plugins/", filename); (&paths, PROGRAM_NAME "/plugins/", filename);
strv_free (&paths); strv_free (&paths);