[gnome-builder: 56/139] webkit: add libide-webkit static library



commit 6f9a0ab12b58d09692fc4febd6a49907b993fda2
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 16:54:10 2019 -0800

    webkit: add libide-webkit static library
    
    Adds a libide-webkit static library for other plugins and Builder to use.
    We now require webkit on all platforms.

 .../webkit/{ide-webkit.c => ide-webkit-plugin.c}   | 11 ++++--
 src/libide/webkit/libide-webkit.gresource.xml      |  6 +++
 src/libide/webkit/meson.build                      | 45 ++++++++++++++++++++++
 src/libide/webkit/webkit.plugin                    |  2 +-
 4 files changed, 60 insertions(+), 4 deletions(-)
---
diff --git a/src/libide/webkit/ide-webkit.c b/src/libide/webkit/ide-webkit-plugin.c
similarity index 74%
rename from src/libide/webkit/ide-webkit.c
rename to src/libide/webkit/ide-webkit-plugin.c
index 4f5e9eac9..3892af24c 100644
--- a/src/libide/webkit/ide-webkit.c
+++ b/src/libide/webkit/ide-webkit-plugin.c
@@ -1,4 +1,4 @@
-/* ide-webkit.c
+/* ide-webkit-plugin.c
  *
  * Copyright 2016-2019 Christian Hergert <chergert redhat com>
  *
@@ -18,14 +18,19 @@
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
+#define G_LOG_DOMAIN "ide-webkit-plugin"
+
 #include "config.h"
 
+#include <libpeas/peas.h>
 #include <webkit2/webkit2.h>
+#include <girepository.h>
 
-#include "object-modules.h"
+_IDE_EXTERN void _ide_webkit_register_types (PeasObjectModule *module);
 
 void
-ide_webkit_register_types (PeasObjectModule *module)
+_ide_webkit_register_types (PeasObjectModule *module)
 {
   g_type_ensure (WEBKIT_TYPE_WEB_VIEW);
+  g_irepository_require (NULL, "WebKit2", "4.0", 0, NULL);
 }
diff --git a/src/libide/webkit/libide-webkit.gresource.xml b/src/libide/webkit/libide-webkit.gresource.xml
new file mode 100644
index 000000000..f1621dbaa
--- /dev/null
+++ b/src/libide/webkit/libide-webkit.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/plugins/webkit">
+    <file>webkit.plugin</file>
+  </gresource>
+</gresources>
diff --git a/src/libide/webkit/meson.build b/src/libide/webkit/meson.build
new file mode 100644
index 000000000..d92786c26
--- /dev/null
+++ b/src/libide/webkit/meson.build
@@ -0,0 +1,45 @@
+
+#
+# Sources
+#
+
+libide_webkit_sources = [
+  'ide-webkit-plugin.c',
+]
+
+#
+# Generated Resource Files
+#
+
+libide_webkit_resources = gnome.compile_resources(
+  'ide-webkit-resources',
+  'libide-webkit.gresource.xml',
+  c_name: 'ide_webkit',
+)
+libide_webkit_generated_headers = [libide_webkit_resources[1]]
+libide_webkit_sources += libide_webkit_resources[0]
+
+#
+# Dependencies
+#
+
+libide_webkit_deps = [
+  libwebkit_dep,
+  libpeas_dep,
+]
+
+#
+# Library Definitions
+#
+
+libide_webkit = static_library('ide-webkit-' + libide_api_version, libide_webkit_sources,
+   dependencies: libide_webkit_deps,
+         c_args: libide_args + release_args + ['-DIDE_WEBKIT_COMPILATION'],
+)
+
+libide_webkit_dep = declare_dependency(
+         dependencies: libide_webkit_deps,
+           link_whole: libide_webkit,
+  include_directories: include_directories('.'),
+              sources: libide_webkit_generated_headers,
+)
diff --git a/src/libide/webkit/webkit.plugin b/src/libide/webkit/webkit.plugin
index 67b6a03ad..ea68c01be 100644
--- a/src/libide/webkit/webkit.plugin
+++ b/src/libide/webkit/webkit.plugin
@@ -6,4 +6,4 @@ Authors=Christian Hergert <christian hergert me>
 Copyright=Copyright © 2016 Christian Hergert
 Builtin=true
 Hidden=true
-Embedded=ide_webkit_register_types
+Embedded=_ide_webkit_register_types


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