diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-02-16 12:59:29 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-02-16 12:59:29 +0000 |
commit | 79599515788b85b18aa655e7b7f8cc05c1bbddd8 (patch) | |
tree | ade7cb031f363fad64c77139dea7aa3d81908537 /mail-client/geary | |
parent | 6bc2e4d7c5906e46a8f275a876ead6ec41aca5bb (diff) |
gentoo resync : 16.02.1018
Diffstat (limited to 'mail-client/geary')
-rw-r--r-- | mail-client/geary/Manifest | 7 | ||||
-rw-r--r-- | mail-client/geary/files/0.12.4-fix-cancellable.patch | 25 | ||||
-rw-r--r-- | mail-client/geary/files/geary-0.12-libdir.patch | 54 | ||||
-rw-r--r-- | mail-client/geary/files/geary-0.12-use-upstream-jsc.patch | 511 | ||||
-rw-r--r-- | mail-client/geary/geary-0.12.4.ebuild (renamed from mail-client/geary/geary-0.12.3.ebuild) | 9 |
5 files changed, 602 insertions, 4 deletions
diff --git a/mail-client/geary/Manifest b/mail-client/geary/Manifest index 85ff8322112b..65fc227f7ba0 100644 --- a/mail-client/geary/Manifest +++ b/mail-client/geary/Manifest @@ -1,3 +1,6 @@ -DIST geary-0.12.3.tar.xz 1069444 BLAKE2B 73f4382cd97813fcb3921daeab4338f4797bef2b5dcb1f7df1afeb75be48877109dcb15317f9bbe595326ee38f9ea3359a7d062c39ea3d83e1d36c34b680e707 SHA512 0e22b7ad8b79d17e55f6ab75a13883db04b21b1be9c2b06b08009e48fe433de323e23414ae8e47543bcb7785d6aa90bea582a2e20eaed1ce7bcb02687a69b9b6 -EBUILD geary-0.12.3.ebuild 1966 BLAKE2B 71ef0ad6f68c44fe8df194c8fb5caf39ace3fb9353e7e916ba8008ef6204c4d497eea8f122a2eed2667fd7562e4e558a8a3caa46ada46a880dc31d702b12294a SHA512 e362fbb121707a35e6d64c767cd11998becb7764cffb0e9a040a1402f9a5c5cef5f8e5fb8a955347dff0dd89aa1e188dc43f205d59928a52858d10ae61d1ab4a +AUX 0.12.4-fix-cancellable.patch 1001 BLAKE2B 2c72ce0b32d92bec4e0053b54ca3e17485d64f25f4a24c29cadf47c9edd1593a6b6811328e2cdf60bca438cb808185de3be4e1554d55a3df71c2dd09ea800690 SHA512 4c3ae1076eea3b83e707fb2f74d66f32188728d3f057c67a2754c388241753d024f62a7ecafe7f557b555d328fc765e14d2729a822d26613d61966edf304199a +AUX geary-0.12-libdir.patch 2742 BLAKE2B bd931c4577630001998a9b444226690002a81773351b81a158dafb2031c30ca000831710055d248b408e70700aa2d27195f94f384a3b25713636b8547216fa6f SHA512 8a136e702b036d976201bd67c5e5759ba4c28a5f73c04e2cdb32890d7fe0d4f6c9b6879a08bb2d2ba71fbbf60a5262dabc93928288e937ad9b1b40554bffd13b +AUX geary-0.12-use-upstream-jsc.patch 18753 BLAKE2B 818c36ed24c7a0cfdee0679e41243c8ace7a966947c64561808587ccc7bf2a8558a48b3245a494f82553d9fd4bbf712be00efc74531cd21547f9445cb56208a8 SHA512 40fce0b4098ab13adf6f2db0f6bf4fe419f77ee159074928d7e44d103d989ac86de609df7bb8d13e47e87986fceed0e5ec92365913ae24daba148769ec82d5b5 +DIST geary-0.12.4.tar.xz 1070368 BLAKE2B 7d4c07184cd99ed507839e3f2c53171bf75809e76ef92283a15d93bd3f074ed700f6db2de14263bf8f7c060526023a81e9123433cf11a353c68497a3b70e2bdd SHA512 5bf05390e06ecd7e3b3de35fcfa068e5ad475f1e4f67c4b2ff65d9f8162759cccc1aa47f0ed9c3a0a8d68059fa404d4360e019ac42cdfc86a8258790f0a6df7c +EBUILD geary-0.12.4.ebuild 2167 BLAKE2B 6e4eec0507651c0f32181c7711a53e637b74806d1725e6df049108ff0be0a7e8c3ebf8bb6286a9005589ca3797f80d58c0e213e304178fbe2ebca264bc54a788 SHA512 4f22f6491d7451b3fbf3473f8393f8dde2deb35c83a15e2fadd3e0c8c2a553f44dbb707c92f9d3a1dbe6ae2d227c812ca4b67e4ed38829b03bb0324ff22044bd MISC metadata.xml 249 BLAKE2B e71e1b95fee768c696704acbf7e3cf0e599ed2bc8de92bae0141d1194ef9e842bdc292798904487a9b90ddfda9b0e84abd3b76b1518576c1d288240e4e46f110 SHA512 c40662134899a5c9f0369a1017806f35adf3280a0b3c91726f7a8ca6012a073a8b471583f5bfb6fe95faac1dcf607e8e2e43f8c91d48ec46f4a8824e2f551506 diff --git a/mail-client/geary/files/0.12.4-fix-cancellable.patch b/mail-client/geary/files/0.12.4-fix-cancellable.patch new file mode 100644 index 000000000000..6549bd0d622a --- /dev/null +++ b/mail-client/geary/files/0.12.4-fix-cancellable.patch @@ -0,0 +1,25 @@ +From 088cb2c0aa35ad4b54ea5a0a2edaf0ff96c64b45 Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz <ricotz@ubuntu.com> +Date: Tue, 27 Nov 2018 14:53:56 +0100 +Subject: [PATCH] Actually use error variable to check for IOError.CANCELLED + +--- + src/client/application/geary-controller.vala | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala +index 3e6c8fcb..6bfeaab9 100644 +--- a/src/client/application/geary-controller.vala ++++ b/src/client/application/geary-controller.vala +@@ -2599,7 +2599,7 @@ public class GearyController : Geary.BaseObject { + yield do_empty_folder_async(emptyable, cancellable); + } catch (Error err) { + // don't report to user if cancelled +- if (cancellable is IOError.CANCELLED) ++ if (err is IOError.CANCELLED) + return; + + ErrorDialog dialog = new ErrorDialog(main_window, +-- +2.18.1 + diff --git a/mail-client/geary/files/geary-0.12-libdir.patch b/mail-client/geary/files/geary-0.12-libdir.patch new file mode 100644 index 000000000000..8e84ffa018b2 --- /dev/null +++ b/mail-client/geary/files/geary-0.12-libdir.patch @@ -0,0 +1,54 @@ +diff -up geary-0.12.0/src/client/application/geary-application.vala.orig geary-0.12.0/src/client/application/geary-application.vala +--- geary-0.12.0/src/client/application/geary-application.vala.orig 2017-10-02 11:53:11.000000000 +0200 ++++ geary-0.12.0/src/client/application/geary-application.vala 2017-10-04 09:06:00.563953050 +0200 +@@ -7,6 +7,7 @@ + // Defined by CMake build script. + extern const string _INSTALL_PREFIX; + extern const string _GSETTINGS_DIR; ++extern const string _LIB_SUFFIX; + extern const string _SOURCE_ROOT_DIR; + extern const string _BUILD_ROOT_DIR; + extern const string GETTEXT_PACKAGE; +@@ -28,6 +29,7 @@ public class GearyApplication : Gtk.Appl + public const string VERSION = Geary.Version.GEARY_VERSION; + public const string INSTALL_PREFIX = _INSTALL_PREFIX; + public const string GSETTINGS_DIR = _GSETTINGS_DIR; ++ public const string LIB_SUFFIX = _LIB_SUFFIX; + public const string SOURCE_ROOT_DIR = _SOURCE_ROOT_DIR; + public const string BUILD_ROOT_DIR = _BUILD_ROOT_DIR; + +@@ -302,12 +304,12 @@ public class GearyApplication : Gtk.Appl + * 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 ++ * `$INSTALL_PREFIX/lib$LIB_SUFFIX/geary/web-extension`, else it will be + */ + 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"); ++ dir = dir.get_child("lib" + LIB_SUFFIX).get_child("geary").get_child("web-extensions"); + else + dir = File.new_for_path(BUILD_ROOT_DIR).get_child("src"); + return dir; +diff -up geary-0.12.0/src/CMakeLists.txt.orig geary-0.12.0/src/CMakeLists.txt +--- geary-0.12.0/src/CMakeLists.txt.orig 2017-10-02 11:53:11.000000000 +0200 ++++ geary-0.12.0/src/CMakeLists.txt 2017-10-04 09:06:00.565953028 +0200 +@@ -567,6 +567,7 @@ set(CFLAGS + ${DEPS_CFLAGS} + ${DEPS_CFLAGS_OTHER} + -D_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" ++ -D_LIB_SUFFIX=\"${LIB_SUFFIX}\" + -D_BUILD_ROOT_DIR=\"${CMAKE_BINARY_DIR}\" + -D_SOURCE_ROOT_DIR=\"${CMAKE_SOURCE_DIR}\" + -D_GSETTINGS_DIR=\"${CMAKE_BINARY_DIR}/gsettings\" +@@ -745,7 +746,7 @@ OPTIONS + + add_library(geary-web-process MODULE ${WEB_PROCESS_VALA_C}) + target_link_libraries(geary-web-process PRIVATE ${DEPS_LIBRARIES} geary-engine) +-install(TARGETS geary-web-process LIBRARY DESTINATION lib/geary/web-extensions) ++install(TARGETS geary-web-process LIBRARY DESTINATION lib${LIB_SUFFIX}/geary/web-extensions) + + # Console app + ################################################# diff --git a/mail-client/geary/files/geary-0.12-use-upstream-jsc.patch b/mail-client/geary/files/geary-0.12-use-upstream-jsc.patch new file mode 100644 index 000000000000..c7965ccf3159 --- /dev/null +++ b/mail-client/geary/files/geary-0.12-use-upstream-jsc.patch @@ -0,0 +1,511 @@ +commit a0b1827298dc3210ad0ad16b09cff3507c3ad333 +Author: Thomas Moschny <thomas.moschny@gmx.de> +Date: Sat Jul 14 12:33:47 2018 + + Squashed commit of the following: + + commit e091f24b00ec421e1aadd5e360d1550e658ad5ef + Author: Michael James Gratton <mike@vee.net> + Date: Sun May 20 19:07:56 2018 +1000 + + Clean up JS util API courtesy the new bindings. + + commit 0d966950a2cba888873cd3a7f4f42bb7a017dc6d + Author: Rico Tzschichholz <ricotz@ubuntu.com> + Date: Mon Apr 23 19:56:18 2018 +0200 + + Adjust to upstream javascriptcore-4.0 bindings + + commit 5d0f711426d76f878cf9b71f7e8f785199c7cde1 + Author: Rico Tzschichholz <ricotz@ubuntu.com> + Date: Thu Jun 22 15:01:19 2017 +0200 + + bindings: Drop custom javascriptcore-4.0 and webkit2gtk-4.0 vapi + +diff --git a/bindings/metadata/Soup-2.4.metadata b/bindings/metadata/Soup-2.4.metadata +deleted file mode 100644 +index f3e72e8..0000000 +--- a/bindings/metadata/Soup-2.4.metadata ++++ /dev/null +@@ -1,3 +0,0 @@ +-AuthDomain.accepts skip +-AuthDomain.challenge skip +- +diff --git a/bindings/metadata/WebKit2-4.0.metadata b/bindings/metadata/WebKit2-4.0.metadata +deleted file mode 100644 +index 3e3044f..0000000 +--- a/bindings/metadata/WebKit2-4.0.metadata ++++ /dev/null +@@ -1,15 +0,0 @@ +- +-JavascriptResult +- .get_global_context nullable=false unowned=true +- .get_value nullable=false unowned=true +- +-//Forward upstream +-Download +- .failed#signal.error type="WebKit.DownloadError" +-PrintOperation +- .failed#signal.error type="WebKit.PrintError" +-WebResource +- .failed#signal.error type="GLib.Error" +-WebView +- .load_failed#signal.error type="GLib.Error" +- .show_option_menu#signal skip +diff --git a/bindings/metadata/WebKit2WebExtension-4.0-custom.vala b/bindings/metadata/WebKit2WebExtension-4.0-custom.vala +deleted file mode 100644 +index a994a77..0000000 +--- a/bindings/metadata/WebKit2WebExtension-4.0-custom.vala ++++ /dev/null +@@ -1,5 +0,0 @@ +-namespace WebKit { +- namespace DOM { +- public delegate void EventTargetFunc (WebKit.DOM.EventTarget target, WebKit.DOM.Event event); +- } +-} +diff --git a/bindings/metadata/WebKit2WebExtension-4.0.metadata b/bindings/metadata/WebKit2WebExtension-4.0.metadata +deleted file mode 100644 +index c496dba..0000000 +--- a/bindings/metadata/WebKit2WebExtension-4.0.metadata ++++ /dev/null +@@ -1,9 +0,0 @@ +-DOM* parent="WebKit.DOM" name="DOM(.+)" +- +-DOMEventTarget.add_event_listener skip +-_ContextMenu skip +-_ContextMenuItem skip +- +-Frame.get_javascript_* nullable=false unowned=true +- +-DOMEventTarget.add_event_listener_with_closure.handler type="owned WebKit.DOM.EventTargetFunc" +diff --git a/bindings/vapi/javascriptcore-4.0.vapi b/bindings/vapi/javascriptcore-4.0.vapi +deleted file mode 100644 +index d152ce2..0000000 +--- a/bindings/vapi/javascriptcore-4.0.vapi ++++ /dev/null +@@ -1,155 +0,0 @@ +-/* +- * Copyright 2017 Michael Gratton <mike@vee.net> +- * +- * This software is licensed under the GNU Lesser General Public License +- * (version 2.1 or later). See the COPYING file in this distribution. +- */ +- +-[CCode (cprefix = "JS", +- gir_namespace = "JavaScriptCore", +- gir_version = "4.0", +- lower_case_cprefix = "JS_", +- cheader_filename = "JavaScriptCore/JavaScript.h")] +-namespace JS { +- +- [CCode (cname = "JSContextRef")] +- [SimpleType] +- public struct Context { +- +- [CCode (cname = "JSEvaluateScript")] +- public Value evaluate_script(String script, +- Object? thisObject, +- String? sourceURL, +- int startingLineNumber, +- out Value? exception); +- +- [CCode (cname = "JSCheckScriptSyntax")] +- public Value check_script_syntax(String script, +- String? sourceURL, +- int startingLineNumber, +- out Value? exception); +- +- } +- +- [CCode (cname = "JSGlobalContextRef")] +- [SimpleType] +- public struct GlobalContext : Context { +- +- [CCode (cname = "JSGlobalContextRetain")] +- public bool retain(); +- +- [CCode (cname = "JSGlobalContextRelease")] +- public bool release(); +- +- } +- +- [CCode (cname = "JSType", has_type_id = false)] +- public enum Type { +- +- [CCode (cname = "kJSTypeUndefined")] +- UNDEFINED, +- +- [CCode (cname = "kJSTypeNull")] +- NULL, +- +- [CCode (cname = "kJSTypeBoolean")] +- BOOLEAN, +- +- [CCode (cname = "kJSTypeNumber")] +- NUMBER, +- +- [CCode (cname = "kJSTypeString")] +- STRING, +- +- [CCode (cname = "kJSTypeObject")] +- OBJECT +- } +- +- [CCode (cname = "JSObjectRef")] +- [SimpleType] +- public struct Object { +- +- [CCode (cname = "JSObjectMakeFunction")] +- public Object.make_function(String? name, +- [CCode (array_length_pos=1.5)] +- String[]? parameterNames, +- String body, +- String? sourceURL, +- int startingLineNumber, +- out Value? exception); +- +- [CCode (cname = "JSObjectCallAsFunction", instance_pos = 1.1)] +- public Value call_as_function(Context ctx, +- Object? thisObject, +- [CCode (array_length_pos=2.5)] +- Value[]? arguments, +- out Value? exception); +- +- [CCode (cname = "JSObjectHasProperty", instance_pos = 1.1)] +- public bool has_property(Context ctx, String property_name); +- +- [CCode (cname = "JSObjectGetProperty", instance_pos = 1.1)] +- public Value get_property(Context ctx, +- String property_name, +- out Value? exception); +- +- } +- +- [CCode (cname = "JSValueRef")] +- [SimpleType] +- public struct Value { +- +- [CCode (cname = "JSValueGetType", instance_pos = 1.1)] +- public Type get_type(Context context); +- +- [CCode (cname = "JSValueIsBoolean", instance_pos = 1.1)] +- public bool is_boolean(Context ctx); +- +- [CCode (cname = "JSValueIsNumber", instance_pos = 1.1)] +- public bool is_number(Context ctx); +- +- [CCode (cname = "JSValueIsObject", instance_pos = 1.1)] +- public bool is_object(Context ctx); +- +- [CCode (cname = "JSValueIsString", instance_pos = 1.1)] +- public bool is_string(Context ctx); +- +- [CCode (cname = "JSValueToBoolean", instance_pos = 1.1)] +- public bool to_boolean(Context ctx); +- +- [CCode (cname = "JSValueToNumber", instance_pos = 1.1)] +- public double to_number(Context ctx, out Value exception); +- +- [CCode (cname = "JSValueToObject", instance_pos = 1.1)] +- public Object to_object(Context ctx, out Value exception); +- +- [CCode (cname = "JSValueToStringCopy", instance_pos = 1.1)] +- public String to_string_copy(Context ctx, out Value exception); +- +- } +- +- [CCode (cname = "JSStringRef")] +- [SimpleType] +- public struct String { +- +- [CCode (cname = "JSStringCreateWithUTF8CString")] +- public String.create_with_utf8_cstring(string str); +- +- [CCode (cname = "JSStringGetLength")] +- public int String.get_length(); +- +- [CCode (cname = "JSStringGetMaximumUTF8CStringSize")] +- public int String.get_maximum_utf8_cstring_size(); +- +- [CCode (cname = "JSStringGetUTF8CString")] +- public void String.get_utf8_cstring(string* buffer, int bufferSize); +- +- [CCode (cname = "JSStringRetain")] +- public void String.retain(); +- +- [CCode (cname = "JSStringRelease")] +- public void String.release(); +- +- } +- +-} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 1e4213f..e0bebdf 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -526,7 +526,7 @@ set(ENGINE_PACKAGES + gio-2.0 + glib-2.0 + gmime-2.6 +- javascriptcore-4.0 ++ javascriptcoregtk-4.0 + libxml-2.0 + posix + sqlite3 +@@ -551,7 +551,7 @@ set(WEB_PROCESS_PACKAGES + geary-engine + gee-0.8 + gtk+-3.0 +- javascriptcore-4.0 ++ javascriptcoregtk-4.0 + libsoup-2.4 + webkit2gtk-web-extension-4.0 + ) +@@ -618,7 +618,6 @@ add_definitions(${CFLAGS}) + set(VALAC_OPTIONS + --vapidir=${CMAKE_BINARY_DIR}/src + --vapidir=${CMAKE_SOURCE_DIR}/bindings/vapi +- --metadatadir=${CMAKE_SOURCE_DIR}/bindings/metadata + --target-glib=${TARGET_GLIB} + --thread + --debug +@@ -650,38 +649,6 @@ set_property( + ) + target_link_libraries(geary-engine m ${DEPS_LIBRARIES} sqlite3-unicodesn) + +-# WebKit2GTK VAPI generation +-################################################# +-add_custom_target(webkit2gtk-vapi +- DEPENDS +- "${CMAKE_BINARY_DIR}/src/webkit2gtk-4.0.vapi" +- "${CMAKE_BINARY_DIR}/src/webkit2gtk-web-extension-4.0.vapi" +- "${CMAKE_SOURCE_DIR}/bindings/vapi/javascriptcore-4.0.vapi" +-) +-add_custom_command( +- OUTPUT +- ${CMAKE_BINARY_DIR}/src/webkit2gtk-4.0.vapi +- DEPENDS +- "${CMAKE_SOURCE_DIR}/bindings/metadata/WebKit2-4.0.metadata" +- "${CMAKE_SOURCE_DIR}/bindings/vapi/javascriptcore-4.0.vapi" +- WORKING_DIRECTORY +- "${CMAKE_SOURCE_DIR}/bindings/metadata" +- COMMAND +- vapigen --library=webkit2gtk-4.0 --pkg gtk+-3.0 --pkg libsoup-2.4 --pkg javascriptcore-4.0 --vapidir=${CMAKE_SOURCE_DIR}/bindings/vapi --metadatadir=${CMAKE_SOURCE_DIR}/bindings/metadata --directory=${CMAKE_BINARY_DIR}/src `${PKG_CONFIG_EXECUTABLE} --variable=girdir gobject-introspection-1.0`/WebKit2-4.0.gir +-) +-add_custom_command( +- OUTPUT +- "${CMAKE_BINARY_DIR}/src/webkit2gtk-web-extension-4.0.vapi" +- DEPENDS +- "${CMAKE_SOURCE_DIR}/bindings/metadata/WebKit2WebExtension-4.0.metadata" +- "${CMAKE_SOURCE_DIR}/bindings/metadata/WebKit2WebExtension-4.0-custom.vala" +- "${CMAKE_SOURCE_DIR}/bindings/vapi/javascriptcore-4.0.vapi" +- WORKING_DIRECTORY +- "${CMAKE_SOURCE_DIR}/bindings/metadata" +- COMMAND +- vapigen --library=webkit2gtk-web-extension-4.0 --pkg gtk+-3.0 --pkg libsoup-2.4 --pkg javascriptcore-4.0 --vapidir=${CMAKE_SOURCE_DIR}/bindings/vapi --metadatadir=${CMAKE_SOURCE_DIR}/bindings/metadata --directory=${CMAKE_BINARY_DIR}/src `${PKG_CONFIG_EXECUTABLE} --variable=girdir gobject-introspection-1.0`/WebKit2WebExtension-4.0.gir WebKit2WebExtension-4.0-custom.vala +-) +- + # Client library (static lib used for building client and unit tests) + ################################################# + +@@ -698,7 +665,7 @@ OPTIONS + ) + + add_library(geary-client STATIC ${CLIENT_VALA_C}) +-add_dependencies(geary-client resource_copy webkit2gtk-vapi) ++add_dependencies(geary-client resource_copy) + target_link_libraries(geary-client m ${DEPS_LIBRARIES} geary-engine) + + # Main client application binary +diff --git a/src/client/conversation-viewer/conversation-web-view.vala b/src/client/conversation-viewer/conversation-web-view.vala +index 588d39b..d851235 100644 +--- a/src/client/conversation-viewer/conversation-web-view.vala ++++ b/src/client/conversation-viewer/conversation-web-view.vala +@@ -183,7 +183,7 @@ public class ConversationWebView : ClientWebView { + + private void on_deceptive_link_clicked(WebKit.JavascriptResult result) { + try { +- JS.GlobalContext context = result.get_global_context(); ++ unowned JS.GlobalContext context = result.get_global_context(); + JS.Object details = WebKitUtil.to_object(result); + + uint reason = (uint) Geary.JS.to_number( +diff --git a/src/client/util/util-webkit.vala b/src/client/util/util-webkit.vala +index 319e28a..45a27c4 100644 +--- a/src/client/util/util-webkit.vala ++++ b/src/client/util/util-webkit.vala +@@ -18,8 +18,8 @@ namespace WebKitUtil { + */ + public bool to_bool(WebKit.JavascriptResult result) + throws Geary.JS.Error { +- JS.GlobalContext context = result.get_global_context(); +- JS.Value value = result.get_value(); ++ unowned JS.GlobalContext context = result.get_global_context(); ++ unowned JS.Value value = result.get_value(); + if (!value.is_boolean(context)) { + throw new Geary.JS.Error.TYPE("Result is not a JS Boolean object"); + } +@@ -59,12 +59,12 @@ namespace WebKitUtil { + */ + public string as_string(WebKit.JavascriptResult result) + throws Geary.JS.Error { +- JS.GlobalContext context = result.get_global_context(); +- JS.Value js_str_value = result.get_value(); ++ unowned JS.GlobalContext context = result.get_global_context(); ++ unowned JS.Value js_str_value = result.get_value(); + JS.Value? err = null; + JS.String js_str = js_str_value.to_string_copy(context, out err); + Geary.JS.check_exception(context, err); +- return Geary.JS.to_string_released(js_str); ++ return Geary.JS.to_native_string(js_str); + } + + /** +diff --git a/src/client/web-process/web-process-extension.vala b/src/client/web-process/web-process-extension.vala +index ee89139..1f478a6 100644 +--- a/src/client/web-process/web-process-extension.vala ++++ b/src/client/web-process/web-process-extension.vala +@@ -87,10 +87,9 @@ public class GearyWebExtension : Object { + bool should_load = false; + WebKit.Frame frame = page.get_main_frame(); + // Explicit cast fixes build on s390x/ppc64. Bug 783882 +- JS.GlobalContext context = (JS.GlobalContext) +- frame.get_javascript_global_context(); ++ unowned JS.GlobalContext context = frame.get_javascript_global_context(); + try { +- JS.Value ret = execute_script( ++ unowned JS.Value ret = execute_script( + context, "geary.allowRemoteImages", int.parse("__LINE__") + ); + should_load = ret.to_boolean(context); +@@ -106,8 +105,7 @@ public class GearyWebExtension : Object { + private void remote_image_load_blocked(WebKit.WebPage page) { + WebKit.Frame frame = page.get_main_frame(); + // Explicit cast fixes build on s390x/ppc64. Bug 783882 +- JS.GlobalContext context = (JS.GlobalContext) +- frame.get_javascript_global_context(); ++ unowned JS.GlobalContext context = frame.get_javascript_global_context(); + try { + execute_script( + context, "geary.remoteImageLoadBlocked();", int.parse("__LINE__") +@@ -123,8 +121,7 @@ public class GearyWebExtension : Object { + private void selection_changed(WebKit.WebPage page) { + WebKit.Frame frame = page.get_main_frame(); + // Explicit cast fixes build on s390x/ppc64. Bug 783882 +- JS.GlobalContext context = (JS.GlobalContext) +- frame.get_javascript_global_context(); ++ unowned JS.GlobalContext context = frame.get_javascript_global_context(); + try { + execute_script( + context, "geary.selectionChanged();", int.parse("__LINE__") +@@ -136,20 +133,18 @@ public class GearyWebExtension : Object { + + // Return type is nullable as a workaround for Bug 778046, it will + // never actually be null. +- private JS.Value? execute_script(JS.Context context, string script, int line) ++ private unowned JS.Value? execute_script(JS.Context context, string script, int line) + throws Geary.JS.Error { + JS.String js_script = new JS.String.create_with_utf8_cstring(script); + JS.String js_source = new JS.String.create_with_utf8_cstring("__FILE__"); + JS.Value? err = null; + try { +- JS.Value ret = context.evaluate_script( ++ unowned JS.Value ret = context.evaluate_script( + js_script, null, js_source, line, out err + ); + Geary.JS.check_exception(context, err); + return ret; + } finally { +- js_script.release(); +- js_source.release(); + } + } + +diff --git a/src/engine/util/util-js.vala b/src/engine/util/util-js.vala +index 4d22429..a98d798 100644 +--- a/src/engine/util/util-js.vala ++++ b/src/engine/util/util-js.vala +@@ -10,6 +10,16 @@ + */ + namespace Geary.JS { + ++#if !VALA_0_42 ++ // Workaround broken version of this in the vala bindings. See Bug ++ // 788113. ++ [CCode (cname = "JSStringGetUTF8CString")] ++ private extern size_t js_string_get_utf8_cstring( ++ global::JS.String js, ++ [CCode (array_length_type = "gsize")] char[] buffer ++ ); ++#endif ++ + /** + * Errors produced by functions in {@link Geary.JS}. + */ +@@ -72,7 +82,7 @@ namespace Geary.JS { + global::JS.String js_str = value.to_string_copy(context, out err); + Geary.JS.check_exception(context, err); + +- return Geary.JS.to_string_released(js_str); ++ return to_native_string(js_str); + } + + /** +@@ -101,12 +111,15 @@ namespace Geary.JS { + /** + * Returns a JSC {@link JS.String} as a Vala {@link string}. + */ +- public inline string to_string_released(global::JS.String js) { +- int len = js.get_maximum_utf8_cstring_size(); +- string str = string.nfill(len, 0); +- js.get_utf8_cstring(str, len); +- js.release(); +- return str; ++ public inline string to_native_string(global::JS.String js) { ++ size_t len = js.get_maximum_utf8_cstring_size(); ++ uint8[] str = new uint8[len]; ++#if VALA_0_42 ++ js.get_utf8_cstring(str); ++#else ++ js_string_get_utf8_cstring(js, (char[]) str); ++#endif ++ return (string) str; + } + + /** +@@ -125,11 +138,8 @@ namespace Geary.JS { + global::JS.String js_name = new global::JS.String.create_with_utf8_cstring(name); + global::JS.Value? err = null; + global::JS.Value prop = object.get_property(context, js_name, out err); +- try { +- Geary.JS.check_exception(context, err); +- } finally { +- js_name.release(); +- } ++ Geary.JS.check_exception(context, err); ++ + return prop; + } + +@@ -157,7 +167,7 @@ namespace Geary.JS { + + throw new Error.EXCEPTION( + "JS exception thrown [%s]: %s" +- .printf(err_type.to_string(), to_string_released(err_str)) ++ .printf(err_type.to_string(), to_native_string(err_str)) + ); + } + } +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index afcca95..7517b3d 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -56,7 +56,7 @@ set(TEST_PACKAGES + glib-2.0 + gmime-2.6 + gtk+-3.0 +- javascriptcore-4.0 ++ javascriptcoregtk-4.0 + libsoup-2.4 + webkit2gtk-4.0 + ) diff --git a/mail-client/geary/geary-0.12.3.ebuild b/mail-client/geary/geary-0.12.4.ebuild index 832bb862d28f..57f5e70d95ab 100644 --- a/mail-client/geary/geary-0.12.3.ebuild +++ b/mail-client/geary/geary-0.12.4.ebuild @@ -1,7 +1,8 @@ -# Copyright 1999-2018 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=6 +VALA_MIN_API_VERSION="0.40" # Keep cmake-utils at the end inherit gnome2 vala cmake-utils @@ -10,7 +11,7 @@ HOMEPAGE="https://wiki.gnome.org/Apps/Geary" LICENSE="LGPL-2.1+ BSD-2 CC-BY-3.0 CC-BY-SA-3.0" # code is LGPL-2.1+, BSD-2 for bundled snowball-stemmer, CC licenses for some icons SLOT="0" -KEYWORDS="amd64 x86" +KEYWORDS="~amd64 ~x86" DEPEND=" >=dev-libs/glib-2.42:2 @@ -36,6 +37,7 @@ RDEPEND="${DEPEND} # gnome-doc-utils for xml2po for TRANSLATE_HELP option DEPEND="${DEPEND} sys-devel/gettext + dev-util/intltool app-text/gnome-doc-utils dev-util/desktop-file-utils virtual/pkgconfig @@ -43,6 +45,9 @@ DEPEND="${DEPEND} " src_prepare() { + eapply "${FILESDIR}"/geary-0.12-libdir.patch + eapply "${FILESDIR}"/geary-0.12-use-upstream-jsc.patch + eapply "${FILESDIR}"/${PV}-fix-cancellable.patch # https://bugzilla.gnome.org/show_bug.cgi?id=751557 sed -i -e 's/vapigen --library/${VAPIGEN} --library/' src/CMakeLists.txt || die |