diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f892e8de..528972c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ variables: meson desktop-file-utils libcanberra-devel libgee-devel glib2-devel gmime-devel gtk3-devel libnotify-devel sqlite-devel webkitgtk4-devel libsecret-devel libxml2-devel vala-tools - gcr-devel enchant-devel libunwind-devel iso-codes-devel + gcr-devel enchant2-devel libunwind-devel iso-codes-devel gnome-online-accounts-devel itstool json-glib-devel FEDORA_TEST_DEPS: Xvfb tar xz diff --git a/INSTALL b/INSTALL index 60094d86..d096dd12 100644 --- a/INSTALL +++ b/INSTALL @@ -45,7 +45,7 @@ libraries. Install them by running this command: desktop-file-utils iso-codes-devel libcanberra-devel libgee-devel \ glib2-devel gmime-devel gtk3-devel libnotify-devel sqlite-devel \ webkitgtk4-devel libsecret-devel libxml2-devel vala-tools \ - gcr-devel enchant-devel libunwind-devel json-glib-devel \ + gcr-devel enchant2-devel libunwind-devel json-glib-devel \ gnome-online-accounts-devel itstool Installing dependencies on Ubuntu/Debian diff --git a/bindings/vapi/enchant-2.vapi b/bindings/vapi/enchant-2.vapi new file mode 100644 index 00000000..c4a030f7 --- /dev/null +++ b/bindings/vapi/enchant-2.vapi @@ -0,0 +1,34 @@ +[CCode (cheader_filename = "enchant.h")] +namespace Enchant { + public delegate void BrokerDescribeFn (string provider_name, string provider_desc, string provider_dll_file); + public delegate void DictDescribeFn (string lang_tag, string provider_name, string provider_desc, string provider_file); + + [Compact] + [CCode (free_function = "enchant_broker_free")] + public class Broker { + [CCode (cname = "enchant_broker_init")] + public Broker (); + + public unowned Dict request_dict (string tag); + public unowned Dict request_pwl_dict (string pwl); + public void free_dict (Dict dict); + public int dict_exists (string tag); + public void set_ordering (string tag, string ordering); + public void describe (BrokerDescribeFn fn); + public void list_dicts (DictDescribeFn fn); + public unowned string get_error (); + } + + [Compact] + public class Dict { + public int check (string word, long len = -1); + public unowned string[] suggest (string word, long len = -1); + public void free_string_list ([CCode (array_length = false)] string[] string_list); + public void add_to_session (string word, long len = -1); + public int is_in_session (string word, long len = -1); + public void store_replacement ( string mis, long mis_len, string cor, long cor_len); + public void add_to_pwl ( string word, long len = -1); + public void describe (DictDescribeFn fn); + public unowned string get_error (); + } +} diff --git a/meson.build b/meson.build index b3c34db0..0c0a2151 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ sqlite = dependency('sqlite3', version: '>= 3.12') webkit2gtk = dependency('webkit2gtk-4.0', version: '>=' + target_webkit) # Secondary deps - keep sorted alphabetically -enchant = dependency('enchant', version: '>= 1.6') +enchant = dependency('enchant-2', version: '>=2.1', required: false) # see below gck = dependency('gck-1') gcr = dependency('gcr-3', version: '>= 3.10.1') gdk = dependency('gdk-3.0', version: '>=' + target_gtk) @@ -74,9 +74,14 @@ libunwind_dep = dependency('libunwind', version: '>= 1.1') libunwind_generic_dep = dependency('libunwind-generic', version: '>= 1.1') libxml = dependency('libxml-2.0', version: '>= 2.7.8') posix = valac.find_library('posix') -webkit2gtk = dependency('webkit2gtk-4.0', version: '>=' + target_webkit) webkit2gtk_web_extension = dependency('webkit2gtk-web-extension-4.0', version: '>=' + target_webkit) +# Can currently use either Enchant 1 or 2 +if not enchant.found() + enchant = dependency('enchant', version: '>=1.6') +endif + + # Libunwind system dependencies above ensures appropriate versions, # but this declared depencency is what we actually build against so we # can include the custom VAPI correctly. We need to add unwind_lib to diff --git a/org.gnome.Geary.json b/org.gnome.Geary.json index e956d74d..93c45ff3 100644 --- a/org.gnome.Geary.json +++ b/org.gnome.Geary.json @@ -107,19 +107,6 @@ } ] }, - { - "name" : "enchant", - "cleanup" : [ - "/bin" - ], - "sources" : [ - { - "type" : "archive", - "url" : "https://github.com/AbiWord/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz", - "sha256" : "bef0d9c0fef2e4e8746956b68e4d6c6641f6b85bd2908d91731efb68eba9e3f5" - } - ] - }, { "name": "geary", "buildsystem": "meson",