[gnome-builder: 97/139] jhbuild: port to libide-foundry



commit c720137e93963fb92282eb052a55ab63c22fadff
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 17:28:11 2019 -0800

    jhbuild: port to libide-foundry

 src/plugins/jhbuild/jhbuild.plugin    |  9 +++++----
 src/plugins/jhbuild/jhbuild_plugin.py | 18 +++++++++++-------
 src/plugins/jhbuild/meson.build       |  4 ++--
 3 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/src/plugins/jhbuild/jhbuild.plugin b/src/plugins/jhbuild/jhbuild.plugin
index 0a7068d29..5388e6002 100644
--- a/src/plugins/jhbuild/jhbuild.plugin
+++ b/src/plugins/jhbuild/jhbuild.plugin
@@ -1,8 +1,9 @@
 [Plugin]
-Module=jhbuild_plugin
-Name=JHBuild
-Description=Provides support for building with JHBuild
 Authors=Patrick Griffis <tingping tingping se>
+Builtin=true
 Copyright=Copyright © 2016 Patrick Griffis
+Description=Provides support for building with JHBuild
 Loader=python3
-Builtin=true
+Module=jhbuild_plugin
+Name=JHBuild
+X-Builder-ABI=@PACKAGE_ABI@
diff --git a/src/plugins/jhbuild/jhbuild_plugin.py b/src/plugins/jhbuild/jhbuild_plugin.py
index ad4568c8b..5c8271e4c 100644
--- a/src/plugins/jhbuild/jhbuild_plugin.py
+++ b/src/plugins/jhbuild/jhbuild_plugin.py
@@ -16,18 +16,20 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
 
-import gi
 import os
 
-gi.require_version('Ide', '1.0')
-
 from gi.repository import GLib
 from gi.repository import GObject
 from gi.repository import Gio
 from gi.repository import Ide
 
+_ = Ide.gettext
+
 class JhbuildRuntime(Ide.Runtime):
+    __gtype_name__ = 'JhbuildRuntime'
 
     def __init__(self, *args, **kwargs):
         self.jhbuild_path = kwargs.get('executable_path', None)
@@ -86,7 +88,8 @@ class JhbuildRuntime(Ide.Runtime):
         except GLib.Error:
             return False
 
-class JhbuildRuntimeProvider(GObject.Object, Ide.RuntimeProvider):
+class JhbuildRuntimeProvider(Ide.Object, Ide.RuntimeProvider):
+    __gtype_name__ = 'JhbuildRuntimeProvider'
 
     def __init__(self, *args, **kwargs):
         super().__init__(self, *args, **kwargs)
@@ -115,15 +118,16 @@ class JhbuildRuntimeProvider(GObject.Object, Ide.RuntimeProvider):
     def do_load(self, manager):
         jhbuild_path = self._get_jhbuild_path()
         if jhbuild_path is not None:
-            context = manager.get_context()
-            runtime = JhbuildRuntime(context=context,
-                                     id='jhbuild',
+            runtime = JhbuildRuntime(id='jhbuild',
+                                     category=_('Host System'),
                                      display_name='JHBuild',
                                      executable_path=jhbuild_path)
+            self.append(runtime)
             manager.add(runtime)
             self.runtimes.append(runtime)
 
     def do_unload(self, manager):
         for runtime in self.runtimes:
             manager.remove(runtime)
+            runtime.destroy()
         self.runtimes = []
diff --git a/src/plugins/jhbuild/meson.build b/src/plugins/jhbuild/meson.build
index 2c44a355d..35e3f9d8c 100644
--- a/src/plugins/jhbuild/meson.build
+++ b/src/plugins/jhbuild/meson.build
@@ -1,11 +1,11 @@
-if get_option('with_jhbuild')
+if get_option('plugin_jhbuild')
 
 install_data('jhbuild_plugin.py', install_dir: plugindir)
 
 configure_file(
           input: 'jhbuild.plugin',
          output: 'jhbuild.plugin',
-           copy: true,
+  configuration: config_h,
         install: true,
     install_dir: plugindir,
 )


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