diff --git a/installed-tests/fixtures/backend.js b/installed-tests/fixtures/backend.js index cec523a21..d7eec1932 100644 --- a/installed-tests/fixtures/backend.js +++ b/installed-tests/fixtures/backend.js @@ -5,13 +5,23 @@ 'use strict'; const Gio = imports.gi.Gio; -const GioUnix = imports.gi.GioUnix; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; const Config = imports.config; const Core = imports.service.core; +// Retain compatibility with GLib < 2.80, which lacks GioUnix +let GioUnix; +try { + GioUnix = imports.gi.GioUnix; +} catch (e) { + GioUnix = { + InputStream: Gio.UnixInputStream, + OutputStream: Gio.UnixOutputStream, + }; +} + /** * TCP Port Constants diff --git a/src/service/backends/lan.js b/src/service/backends/lan.js index b6526b8d3..4d321f7ff 100644 --- a/src/service/backends/lan.js +++ b/src/service/backends/lan.js @@ -5,13 +5,22 @@ 'use strict'; const Gio = imports.gi.Gio; -const GioUnix = imports.gi.GioUnix; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; const Config = imports.config; const Core = imports.service.core; +// Retain compatibility with GLib < 2.80, which lacks GioUnix +let GioUnix; +try { + GioUnix = imports.gi.GioUnix; +} catch (e) { + GioUnix = { + InputStream: Gio.UnixInputStream, + OutputStream: Gio.UnixOutputStream, + }; +} /** * TCP Port Constants diff --git a/src/service/nativeMessagingHost.js b/src/service/nativeMessagingHost.js index f06d33e51..c7711b754 100755 --- a/src/service/nativeMessagingHost.js +++ b/src/service/nativeMessagingHost.js @@ -12,11 +12,21 @@ imports.gi.versions.GLib = '2.0'; imports.gi.versions.GObject = '2.0'; const Gio = imports.gi.Gio; -const GioUnix = imports.gi.GioUnix; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; const System = imports.system; +// Retain compatibility with GLib < 2.80, which lacks GioUnix +let GioUnix; +try { + GioUnix = imports.gi.GioUnix; +} catch (e) { + GioUnix = { + InputStream: Gio.UnixInputStream, + OutputStream: Gio.UnixOutputStream, + }; +} + const NativeMessagingHost = GObject.registerClass({ GTypeName: 'GSConnectNativeMessagingHost',