Re: [gtk-osx-devel] [PATCH] make enchant to look for modules/configs in env specified dirs



Please file a bug report (bugzilla.gnome.org, gtk-mac-integration) rather than sending patches to the mailing 
list.

IMO it would be better to use XDG at least for module-dir. Config-dir defaults to ~/.enchant; if the stupid 
tarball included enchant-cocoa.[ch] it would instead be /Library/Application Support/Enchant, but that would 
require su to install dictionaries. In any case it can’t be in the bundle, as that would violate the code 
signature. What do you have in mind for this?

Regards,
John Ralls



On Dec 31, 2014, at 8:48 AM, Igor Mammedov <imammedo redhat com> wrote:

currently library looks for dictionary modules libraries and configs
only at hardcoded places i.e. at isnstall prefix and $HOME.

However it doesn't work when bundled application is moved to
system without gtk-osx build env or it's moved to another place.

Teach library check addtional pathes provided via env variables:
ENCHANT_MODULE_PATH/ENCHANT_CONFIG_PATH
which should be set by luncher script of the bundle to point
at spelling modules/configs directories.

Signed-off-by: Igor Mammedov <imammedo redhat com>
---
modulesets-stable/gtk-osx-unsupported.modules |  1 +
patches/enchant-env.patch                     | 26 ++++++++++++++++++++++++++
2 files changed, 27 insertions(+)
create mode 100644 patches/enchant-env.patch

diff --git a/modulesets-stable/gtk-osx-unsupported.modules b/modulesets-stable/gtk-osx-unsupported.modules
index 95bc531..a3b1b04 100644
--- a/modulesets-stable/gtk-osx-unsupported.modules
+++ b/modulesets-stable/gtk-osx-unsupported.modules
@@ -126,6 +126,7 @@
    <branch module="1.6.0/enchant-1.6.0.tar.gz" version="1.6.0"
          repo="abisource/enchant">
 <patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/enchant-gsize.patch"; strip="1"/>
+ <patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/enchant-env.patch"; strip="1"/>
    </branch>
    <dependencies>
      <dep package="glib"/>
diff --git a/patches/enchant-env.patch b/patches/enchant-env.patch
new file mode 100644
index 0000000..7cae667
--- /dev/null
+++ b/patches/enchant-env.patch
@@ -0,0 +1,26 @@
+diff --git a/src/enchant.c b/src/enchant.c
+index 79fb21c..8a1b100 100644
+--- a/src/enchant.c
++++ b/src/enchant.c
+@@ -251,6 +251,10 @@ enchant_get_module_dirs (void)
+             }
+ #endif
+ 
++    module_dir = g_getenv("ENCHANT_MODULE_PATH");
++    if (module_dir)
++            module_dirs = enchant_slist_append_unique_path (module_dirs, g_strdup(module_dir));
++
+     return module_dirs;
+ }
+ 
+@@ -291,6 +295,10 @@ enchant_get_conf_dirs (void)
+     conf_dirs = enchant_slist_append_unique_path (conf_dirs, g_strdup (ENCHANT_GLOBAL_ORDERING));
+ #endif
+ 
++    ordering_dir = g_getenv("ENCHANT_CONFIG_PATH");
++    if (ordering_dir)
++            conf_dirs = enchant_slist_append_unique_path (conf_dirs, g_strdup(ordering_dir));
++
+     return conf_dirs;
+ }
+ 
-- 
1.9.3 (Apple Git-50)




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