Merge branch 'wip/web-extension-usr-local' into 'master'

Fix web extension not being loaded when installed under /usr/local on Fedora

Closes #162 and #161

See merge request GNOME/geary!89
This commit is contained in:
Michael Gratton 2019-01-21 00:54:01 +00:00
commit abccccd685
3 changed files with 10 additions and 9 deletions

View file

@ -27,6 +27,7 @@ locale_dir = join_paths(geary_prefix, get_option('localedir'))
po_dir = join_paths(meson.source_root(), 'po')
vapi_dir = join_paths(meson.source_root(), 'bindings', 'vapi')
metadata_dir = join_paths(meson.source_root(), 'bindings', 'metadata')
web_extensions_dir = join_paths(libdir, 'geary', 'web-extensions')
# Make sure Meson can find our custom VAPI's
add_project_arguments([
@ -128,6 +129,7 @@ conf.set_quoted('_BUILD_ROOT_DIR', meson.build_root())
conf.set_quoted('_SOURCE_ROOT_DIR', meson.source_root())
conf.set_quoted('_GSETTINGS_DIR', join_paths(meson.build_root(), 'desktop'))
conf.set_quoted('_INSTALL_PREFIX', geary_prefix)
conf.set_quoted('_WEB_EXTENSIONS_DIR', web_extensions_dir)
conf.set_quoted('LANGUAGE_SUPPORT_DIRECTORY', locale_dir)
conf.set_quoted('ISO_CODE_639_XML', iso_639_xml)
conf.set_quoted('ISO_CODE_3166_XML', iso_3166_xml)

View file

@ -7,6 +7,7 @@
// Defined by CMake build script.
extern const string _INSTALL_PREFIX;
extern const string _GSETTINGS_DIR;
extern const string _WEB_EXTENSIONS_DIR;
extern const string _SOURCE_ROOT_DIR;
extern const string _BUILD_ROOT_DIR;
extern const string GETTEXT_PACKAGE;
@ -295,16 +296,14 @@ public class GearyApplication : Gtk.Application {
/**
* Returns the directory containing the application's WebExtension libs.
*
* If the application is installed, this will be
* `$INSTALL_PREFIX/lib/geary/web-extension`, else it will be
* When running from the installation prefix, this will be based
* on the Meson `libdir` option, and can be set by invoking `meson
* configure` as appropriate.
*/
public File get_web_extensions_dir() {
File? dir = get_install_dir();
if (dir != null)
dir = dir.get_child("lib").get_child("geary").get_child("web-extensions");
else
dir = File.new_for_path(BUILD_ROOT_DIR).get_child("src");
return dir;
return (get_install_dir() != null)
? File.new_for_path(_WEB_EXTENSIONS_DIR)
: File.new_for_path(BUILD_ROOT_DIR).get_child("src");
}
public File? get_desktop_file() {

View file

@ -60,7 +60,7 @@ geary_web_process = library('geary-web-process',
geary_engine_dep,
],
install: true,
install_dir: join_paths(libdir, meson.project_name(), 'web-extensions'),
install_dir: web_extensions_dir
)
# Now finally, make the geary executable