Commit 01ca1224 authored by Michael Terry's avatar Michael Terry

Drop libpeas dependency

We never really used the ability to support plugins. And I don't think
we want to. This reduces complexity and build requirements.
parent 83bd2f3a
# Next
- Drop libpeas dependency
# 38.3
- Allow restoring from paths with symlinks in more situations (including a fix
for a backup error when ~/.cache is a symlink)
......
......@@ -17,7 +17,6 @@ Build-Depends: appstream-util,
libgtk-3-dev (>= 3.22),
libnautilus-extension-dev (>= 3.0),
libpackagekit-glib2-dev,
libpeas-dev,
libsecret-1-dev,
meson (>= 0.38),
pkg-config,
......
......@@ -32,7 +32,7 @@ deja_dup = executable('deja-dup',
resources,
vala_args: common_vflags,
c_args: common_cflags,
dependencies: [gio_unix_dep, goa_dep, gtk_dep, packagekit_dep, peas_dep, secret_dep],
dependencies: [gio_unix_dep, goa_dep, gtk_dep, packagekit_dep, secret_dep],
link_with: [libdeja, libwidgets],
include_directories: [libdeja_inc, libwidgets_inc],
install: true,
......
......@@ -19,7 +19,7 @@
executable('deja-dup-monitor', ['monitor.vala'],
vala_args: common_vflags,
c_args: common_cflags,
dependencies: [gio_dep, goa_dep, peas_dep, secret_dep],
dependencies: [gio_dep, goa_dep, secret_dep],
link_with: [libdeja],
include_directories: [libdeja_inc],
install: true,
......
......@@ -43,7 +43,7 @@ libwidgets = shared_library('widgets',
'WidgetUtils.vala'],
vala_args: common_vflags + ['--pkg=uriutils'],
c_args: common_cflags,
dependencies: [goa_dep, goabackend_dep, gtk_dep, peas_dep, secret_dep],
dependencies: [goa_dep, goabackend_dep, gtk_dep, secret_dep],
link_with: [libdeja],
include_directories: [libdeja_inc],
install: true,
......
......@@ -46,13 +46,6 @@ modules:
tag: 3.28.0
- name: libpeas
sources:
- type: git
url: https://gitlab.gnome.org/GNOME/libpeas.git
tag: libpeas-1.22.0
- name: libgpg-error
sources:
- type: archive
......
......@@ -401,45 +401,12 @@ public ToolPlugin get_tool()
return tool;
}
void initialize_tool_plugin() throws Error
{
var engine = new Peas.Engine ();
// For testing, we'll often point to in-tree tools
string search_path = Environment.get_variable("DEJA_DUP_TOOLS_PATH");
if (search_path == null || search_path == "")
search_path = Path.build_filename(Config.PKG_LIBEXEC_DIR, "tools");
engine.add_search_path(search_path, null);
var info = engine.get_plugin_info("libduplicity.so");
if (info == null)
throw new SpawnError.FAILED(_("Could not find backup tool in %s. Your installation is incomplete.").printf(search_path));
if (!engine.try_load_plugin(info))
throw new SpawnError.FAILED(_("Could not load backup tool. Your installation is incomplete."));
var extset = new Peas.ExtensionSet(engine, typeof(Peas.Activatable));
var ext = extset.get_extension(info);
tool = ext as ToolPlugin;
if (tool == null)
throw new SpawnError.FAILED(_("Backup tool is broken. Your installation is incomplete."));
tool.activate();
}
public bool initialize(out string header, out string msg)
{
header = null;
msg = null;
// Get tool plugin to use
try {
initialize_tool_plugin();
}
catch (Error e) {
header = _("Could not start backup tool");
msg = e.message;
return false;
}
tool = new DuplicityPlugin();
migrate_settings();
......
......@@ -80,15 +80,8 @@ public abstract class ToolJob : Object
public string time {get; set;} // RESTORE
}
public abstract class ToolPlugin : Peas.ExtensionBase, Peas.Activatable
public abstract class ToolPlugin : Object
{
// Peas methods
public Object object {owned get; construct;}
public virtual void activate () {}
public virtual void deactivate () {}
public virtual void update_state () {}
// Deja Dup methods
public string name {get; protected set;}
public virtual string[] get_dependencies() {return {};} // list of what-provides hints
public abstract ToolJob create_job () throws Error;
......
......@@ -43,14 +43,23 @@ libdeja = shared_library('deja',
'RecursiveMove.vala',
'RecursiveOp.vala',
'ToolPlugin.vala',
'uriutils.c'],
'uriutils.c',
'tools/duplicity/DuplicityInstance.vala',
'tools/duplicity/DuplicityJob.vala',
'tools/duplicity/DuplicityPlugin.vala',
],
vala_args: common_vflags + ['--pkg=secret', '--pkg=uriutils'],
c_args: common_cflags,
dependencies: [gio_dep, gio_unix_dep, goa_dep, goabackend_dep, packagekit_dep, peas_dep, secret_dep],
dependencies: [gio_dep, gio_unix_dep, goa_dep, goabackend_dep, gpgerror_dep, packagekit_dep, secret_dep],
install: true,
install_dir: pkglibdir)
libdeja_inc = include_directories('.')
# This is used when running duplicity as root.
# See data/org.gnome.DejaDup.policy.in and DuplicityInstance.vala for more details.
install_data('tools/duplicity/duplicity',
install_dir: pkglibexecdir,
install_mode: 'rwxr-xr-x')
subdir('tests')
subdir('tools')
......@@ -19,7 +19,7 @@
test_runner = executable('test-runner', ['runner.vala'],
vala_args: common_vflags,
c_args: common_cflags,
dependencies: [gio_dep, goa_dep, peas_dep, secret_dep],
dependencies: [gio_dep, goa_dep, secret_dep],
link_with: [libdeja],
include_directories: [libdeja_inc])
......
......@@ -21,14 +21,6 @@ using GLib;
bool system_mode = false;
string get_top_builddir()
{
var builddir = Environment.get_variable("top_builddir");
if (builddir == null)
builddir = "../../builddir";
return builddir;
}
string get_top_srcdir()
{
var srcdir = Environment.get_variable("top_srcdir");
......@@ -73,9 +65,6 @@ void backup_setup()
var dir = Environment.get_variable("DEJA_DUP_TEST_HOME");
if (!system_mode)
Environment.set_variable("DEJA_DUP_TOOLS_PATH", "%s/libdeja/tools/duplicity".printf(get_top_builddir()), true);
Environment.set_variable("DEJA_DUP_TEST_MOCKSCRIPT", Path.build_filename(dir, "mockscript"), true);
Environment.set_variable("XDG_CACHE_HOME", Path.build_filename(dir, "cache"), true);
Environment.set_variable("PATH",
......
......@@ -19,7 +19,7 @@
unit_tests = executable('unit-tests', ['unit-tests.vala'],
vala_args: common_vflags,
c_args: common_cflags,
dependencies: [gio_dep, goa_dep, peas_dep, secret_dep],
dependencies: [gio_dep, goa_dep, secret_dep],
link_with: [libdeja],
include_directories: [libdeja_inc])
......@@ -33,6 +33,6 @@ test('unit-tests', dbus_run_session,
network_test = executable('network-test', ['network.vala'],
vala_args: common_vflags,
c_args: common_cflags,
dependencies: [gio_dep, goa_dep, peas_dep, secret_dep],
dependencies: [gio_dep, goa_dep, secret_dep],
link_with: [libdeja],
include_directories: [libdeja_inc])
......@@ -187,14 +187,6 @@ void migrate_file_local()
assert(local.get_string(DejaDup.LOCAL_FOLDER_KEY) == "/test/path");
}
string get_top_builddir()
{
var builddir = Environment.get_variable("top_builddir");
if (builddir == null)
builddir = Path.build_filename(get_top_srcdir(), "builddir");
return builddir;
}
string get_top_srcdir()
{
var srcdir = Environment.get_variable("top_srcdir");
......@@ -241,7 +233,6 @@ int main(string[] args)
Environment.get_variable("PATH"),
true);
Environment.set_variable("DEJA_DUP_LANGUAGE", "en", true);
Environment.set_variable("DEJA_DUP_TOOLS_PATH", Path.build_filename(get_top_builddir(), "libdeja/tools/duplicity"), true);
Environment.set_variable("GSETTINGS_BACKEND", "memory", true);
Test.bug_base("https://launchpad.net/bugs/%s");
......
......@@ -69,11 +69,3 @@ public class DuplicityPlugin : DejaDup.ToolPlugin
}
}
[ModuleInit]
public void peas_register_types (GLib.TypeModule module)
{
var objmodule = module as Peas.ObjectModule;
objmodule.register_extension_type (typeof (Peas.Activatable),
typeof (DuplicityPlugin));
}
[Plugin]
Loader=c
Module=libduplicity.so
Name=Duplicity Backend
Description=Backs up with duplicity
Authors=Michael Terry <mike@mterry.name>
Copyright=Copyright © 2012 Canonical Ltd
Website=https://wiki.gnome.org/Apps/DejaDup
# -*- Mode: Meson; indent-tabs-mode: nil; tab-width: 4 -*-
#
# This file is part of Déjà Dup.
# For copyright information, see AUTHORS.
#
# Déjà Dup is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Déjà Dup is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
shared_module('duplicity',
['DuplicityInstance.vala',
'DuplicityJob.vala',
'DuplicityPlugin.vala'],
vala_args: common_vflags,
c_args: common_cflags,
dependencies: [gio_dep, gio_unix_dep, goa_dep, gpgerror_dep, peas_dep, secret_dep],
link_with: [libdeja],
include_directories: [libdeja_inc],
install: true,
install_dir: toolsdir)
# Script tests would like to point at our builddir to use this plugin in-tree.
# So we copy it into builddir with configure_file() and install from there.
configure_file(
configuration: configuration_data(),
input: 'duplicity.plugin',
output: 'duplicity.plugin',
install_dir: toolsdir)
# This is used when running duplicity as root.
# See data/org.gnome.DejaDup.policy.in and DuplicityInstance.vala for more details.
install_data('duplicity',
install_dir: pkglibexecdir,
install_mode: 'rwxr-xr-x')
# -*- Mode: Meson; indent-tabs-mode: nil; tab-width: 4 -*-
#
# This file is part of Déjà Dup.
# For copyright information, see AUTHORS.
#
# Déjà Dup is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Déjà Dup is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
subdir('duplicity')
......@@ -54,12 +54,11 @@ goabackend_dep = dependency('goa-backend-1.0')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.22')
nautilus_dep = dependency('libnautilus-extension', required: false)
packagekit_dep = dependency('packagekit-glib2', version: '>=0.6.5', required: false)
peas_dep = dependency('libpeas-1.0')
secret_dep = dependency('libsecret-1')
# libgpg-error doesn't ship a pkg-config file
gpgerror_libs = run_command('gpg-error-config', '--libs').stdout().strip()
gpgerror_dep = declare_dependency(link_args: gpgerror_libs)
gpgerror_dep = declare_dependency(link_args: gpgerror_libs.split())
# Programs
appstream_util = find_program('appstream-util')
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: deja-dup\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-16 18:57-0500\n"
"POT-Creation-Date: 2019-01-26 12:25-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -61,9 +61,8 @@ msgstr ""
msgid "Integrates well into your GNOME desktop"
msgstr ""
#. Translators: "Backups" is a noun
#: data/org.gnome.DejaDup.desktop.in:5 deja-dup/main.vala:166
msgid "Backups"
#: data/org.gnome.DejaDup.desktop.in:5
msgid "Backups@name_suffix@"
msgstr ""
#: data/org.gnome.DejaDup.desktop.in:6
......@@ -416,7 +415,7 @@ msgid ""
"This is the Authentication URL, or keystone URL for the OpenStack service"
msgstr ""
#: data/org.gnome.DejaDup.policy.in:10 deja-dup/AssistantRestore.vala:70
#: data/org.gnome.DejaDup.policy.in:10 deja-dup/AssistantRestore.vala:66
msgid "Restore"
msgstr ""
......@@ -684,65 +683,65 @@ msgctxt "verb"
msgid "_Install"
msgstr ""
#: deja-dup/AssistantRestore.vala:74
#: deja-dup/AssistantRestore.vala:70
msgid "_Restore"
msgstr ""
#: deja-dup/AssistantRestore.vala:103
#: deja-dup/AssistantRestore.vala:99
msgid "_Backup location"
msgstr ""
#: deja-dup/AssistantRestore.vala:136
#: deja-dup/AssistantRestore.vala:132
msgid "Restore From Where?"
msgstr ""
#: deja-dup/AssistantRestore.vala:158
#: deja-dup/AssistantRestore.vala:154
msgid "_Date"
msgstr ""
#: deja-dup/AssistantRestore.vala:181
#: deja-dup/AssistantRestore.vala:177
msgid "Restore files to _original locations"
msgstr ""
#: deja-dup/AssistantRestore.vala:186
#: deja-dup/AssistantRestore.vala:182
msgid "Restore to _specific folder"
msgstr ""
#: deja-dup/AssistantRestore.vala:196
#: deja-dup/AssistantRestore.vala:192
msgid "Choose destination for restored files"
msgstr ""
#: deja-dup/AssistantRestore.vala:200
#: deja-dup/AssistantRestore.vala:196
msgid "Restore _folder"
msgstr ""
#: deja-dup/AssistantRestore.vala:234
#: deja-dup/AssistantRestore.vala:230
msgid "Backup location"
msgstr ""
#: deja-dup/AssistantRestore.vala:242
#: deja-dup/AssistantRestore.vala:238
msgid "Restore date"
msgstr ""
#: deja-dup/AssistantRestore.vala:250
#: deja-dup/AssistantRestore.vala:246
msgid "Restore folder"
msgstr ""
#: deja-dup/AssistantRestore.vala:276
#: deja-dup/AssistantRestore.vala:272
msgid "Checking for Backups…"
msgstr ""
#: deja-dup/AssistantRestore.vala:284
#: deja-dup/AssistantRestore.vala:280
msgid "Restore From When?"
msgstr ""
#: deja-dup/AssistantRestore.vala:292
#: deja-dup/AssistantRestore.vala:288
msgid "Restore to Where?"
msgstr ""
#. Translators: This is the word 'Restoring' in the phrase
#. "Restoring '%s'". %s is a filename.
#: deja-dup/AssistantRestore.vala:328
#: deja-dup/AssistantRestore.vala:324
msgid "Restoring:"
msgstr ""
......@@ -750,46 +749,46 @@ msgstr ""
#. This will be in a list with other strings that just have %x (the
#. current date). So make sure if you change this, it still makes
#. sense in that context.
#: deja-dup/AssistantRestore.vala:370
#: deja-dup/AssistantRestore.vala:366
#, c-format
msgid "%x %X"
msgstr ""
#. If we didn't see any dates... Must not be any backups on the backend
#: deja-dup/AssistantRestore.vala:383
#: deja-dup/AssistantRestore.vala:379
msgid "No backups to restore"
msgstr ""
#: deja-dup/AssistantRestore.vala:463
#: deja-dup/AssistantRestore.vala:459
msgid "Original location"
msgstr ""
#: deja-dup/AssistantRestore.vala:474
#: deja-dup/AssistantRestore.vala:470
msgid "File to restore"
msgid_plural "Files to restore"
msgstr[0] ""
msgstr[1] ""
#: deja-dup/AssistantRestore.vala:495
#: deja-dup/AssistantRestore.vala:491
msgid "Restore Failed"
msgstr ""
#: deja-dup/AssistantRestore.vala:497
#: deja-dup/AssistantRestore.vala:493
msgid "Restore Finished"
msgstr ""
#. if it *is* visible, a header will be set already
#: deja-dup/AssistantRestore.vala:500
#: deja-dup/AssistantRestore.vala:496
msgid "Your files were successfully restored."
msgstr ""
#: deja-dup/AssistantRestore.vala:503
#: deja-dup/AssistantRestore.vala:499
msgid "Your file was successfully restored."
msgid_plural "Your files were successfully restored."
msgstr[0] ""
msgstr[1] ""
#: deja-dup/AssistantRestore.vala:510 libdeja/Operation.vala:58
#: deja-dup/AssistantRestore.vala:506 libdeja/Operation.vala:58
msgid "Restoring…"
msgstr ""
......@@ -901,6 +900,11 @@ msgstr ""
msgid "You must provide a directory, not a file"
msgstr ""
#. Translators: "Backups" is a noun
#: deja-dup/main.vala:166
msgid "Backups"
msgstr ""
#: deja-dup/main.vala:183
msgid "Automatic backup"
msgstr ""
......@@ -1289,7 +1293,7 @@ msgstr ""
#. Translators: %2$s is the name of a removable drive, %1$s is a folder
#. on that removable drive.
#: libdeja/BackendDrive.vala:95 libdeja/CommonUtils.vala:537
#: libdeja/BackendDrive.vala:95 libdeja/CommonUtils.vala:504
#, c-format
msgid "%1$s on %2$s"
msgstr ""
......@@ -1415,36 +1419,19 @@ msgstr ""
msgid "_Remember secret access key"
msgstr ""
#: libdeja/CommonUtils.vala:416
#, c-format
msgid "Could not find backup tool in %s. Your installation is incomplete."
msgstr ""
#: libdeja/CommonUtils.vala:418
msgid "Could not load backup tool. Your installation is incomplete."
msgstr ""
#: libdeja/CommonUtils.vala:424
msgid "Backup tool is broken. Your installation is incomplete."
msgstr ""
#: libdeja/CommonUtils.vala:439
msgid "Could not start backup tool"
msgstr ""
#. Translators: this is the home folder and %s is the user's username
#: libdeja/CommonUtils.vala:588
#: libdeja/CommonUtils.vala:555
#, c-format
msgid "Home (%s)"
msgstr ""
#. Translators: this is the home folder
#: libdeja/CommonUtils.vala:593
#: libdeja/CommonUtils.vala:560
msgid "Home"
msgstr ""
#. Translators: this is the trash folder
#: libdeja/CommonUtils.vala:598
#: libdeja/CommonUtils.vala:565
msgid "Trash"
msgstr ""
......@@ -1452,7 +1439,7 @@ msgstr ""
msgid "Verifying backup…"
msgstr ""
#: libdeja/OperationRestore.vala:52
#: libdeja/OperationRestore.vala:48
msgid "Restoring files…"
msgstr ""
......
......@@ -69,7 +69,6 @@ if [ "$SHNAME" = "shell" ]; then
glib-compile-schemas "${ROOTDIR}/share/glib-2.0/schemas"
export XDG_DATA_DIRS="${ROOTDIR}/share:${XDG_DATA_DIRS}"
export DEJA_DUP_TOOLS_PATH="${BUILDDIR}/libdeja/tools/duplicity"
export PATH="${BUILDDIR}/deja-dup/monitor:${BUILDDIR}/deja-dup:${PATH}"
run_shell "sh $ROOTDIR/runscript.sh"
......@@ -116,7 +115,6 @@ if [ "$SHNAME" = "shell-local" ]; then
mkdir -p "${XDG_DATA_HOME}/Trash"
export DEJA_DUP_TOOLS_PATH="${BUILDDIR}/libdeja/tools/duplicity"
export PATH="${BUILDDIR}/deja-dup/monitor:${BUILDDIR}/deja-dup:${PATH}"
else
export DEJA_DUP_TEST_SYSTEM=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment