[geary/mjog/make-client-lib-private] Install client library in private lib sub-directory



commit 83be745e950eb6b956b6491e9aeaf9685a2aef42
Author: Michael Gratton <mike vee net>
Date:   Mon Mar 30 11:01:03 2020 +1100

    Install client library in private lib sub-directory
    
    Use Geary's private lib sub-directory so that the library won't be found
    on the global library search path. Version the library name to avoid
    clashes. Update the binary's rpath on install so it can find the lib
    still.
    
    Fixes #775

 meson.build            |  5 +++--
 src/client/meson.build | 16 ++++++++++++++--
 src/meson.build        |  1 +
 3 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index 6a5bb77d..fe04aaae 100644
--- a/meson.build
+++ b/meson.build
@@ -136,8 +136,9 @@ i18n = import('i18n')
 
 # Static install dirs
 dbus_services_dir = join_paths(data_dir, 'dbus-1', 'services')
-plugins_dir = join_paths(lib_dir, 'geary', 'plugins')
-web_extensions_dir = join_paths(lib_dir, 'geary', 'web-extensions')
+client_lib_dir = join_paths(lib_dir, 'geary')
+plugins_dir = join_paths(client_lib_dir, 'plugins')
+web_extensions_dir = join_paths(client_lib_dir, 'web-extensions')
 
 # Ensure SQLite was built correctly
 if not cc.has_header_symbol('sqlite3.h', 'SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER', dependencies: sqlite)
diff --git a/src/client/meson.build b/src/client/meson.build
index df20d6b4..cbb0b3bc 100644
--- a/src/client/meson.build
+++ b/src/client/meson.build
@@ -1,5 +1,15 @@
 # Geary client
 
+geary_client_package_name = 'geary-client'
+geary_client_api_version = '.'.join([
+  geary_version.split('.')[0],
+  geary_version.split('.')[1]
+])
+geary_client_package = '@0@-@1@'.format(
+  geary_client_package_name,
+  geary_client_api_version
+)
+
 geary_client_vala_sources = files(
   'application/application-attachment-manager.vala',
   'application/application-avatar-store.vala',
@@ -173,13 +183,15 @@ if webkit_version[0].to_int() <= 2 and webkit_version[1].to_int() <= 24
 endif
 
 # Main client application library
-geary_client_lib = shared_library('geary-client',
+geary_client_lib = shared_library(
+  geary_client_package,
   geary_client_sources,
   dependencies: geary_client_dependencies,
   include_directories: config_h_dir,
   vala_args: geary_client_vala_args,
   c_args: geary_c_args,
-  install: true
+  install: true,
+  install_dir: client_lib_dir,
 )
 
 geary_client_dep = declare_dependency(
diff --git a/src/meson.build b/src/meson.build
index 47f95b2f..6126cb6b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -109,6 +109,7 @@ geary_bin = executable('geary',
   vala_args: geary_vala_args,
   c_args: geary_c_args,
   install: true,
+  install_rpath: client_lib_dir,
 )
 
 if enable_valadoc


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]