@@ -0,0 +1,83 @@
1+{ stdenv, fetchurl, meson, ninja, pkgconfig, vala_0_38, gettext
2+, gnome3, libnotify, intltool, itstool, glib, gtk3, libxml2
3+, coreutils, libsecret, pcre, libxkbcommon, wrapGAppsHook
4+, libpthreadstubs, libXdmcp, epoxy, at_spi2_core, dbus, libgpgerror
5+, appstream-glib, desktop_file_utils, atk, pango, duplicity
6+}:
7+
8+stdenv.mkDerivation rec {
9+ name = "deja-dup-${version}";
10+ version = "36.1";
11+
12+ src = fetchurl {
13+ url = "https://launchpad.net/deja-dup/36/${version}/+download/deja-dup-${version}.tar.xz";
14+ sha256 = "1s48k2sxrpwkzp37s4x7934lyg5194c47nv9ks15rksd5s0alnld";
15+ };
16+
17+ patches = [
18+ ./fix-paths.patch
19+ ];
20+
21+ postPatch = ''
22+ substituteInPlace libdeja/tools/duplicity/DuplicityInstance.vala --replace \
23+ "/bin/rm" \
24+ "${coreutils}/bin/rm"
25+ '';
26+
27+ # couldn't find gio/gdesktopappinfo.h
28+ NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
29+
30+ nativeBuildInputs = [
31+ meson ninja pkgconfig vala_0_38 gettext intltool itstool
32+ appstream-glib desktop_file_utils libxml2 wrapGAppsHook
33+ ];
34+
35+ buildInputs = [
36+ libnotify gnome3.libpeas glib gtk3 libsecret
37+ pcre libxkbcommon libpthreadstubs libXdmcp epoxy gnome3.nautilus
38+ at_spi2_core dbus gnome3.gnome_online_accounts libgpgerror
39+ ];
40+
41+ propagatedUserEnvPkgs = [ duplicity ];
42+
43+ postInstall = ''
44+ glib-compile-schemas $out/share/glib-2.0/schemas
45+ '';
46+
47+ # Manual rpath definition until https://github.com/mesonbuild/meson/issues/314 is fixed
48+ postFixup =
49+ let
50+ rpath = stdenv.lib.makeLibraryPath [
51+ glib
52+ gtk3
53+ gnome3.gnome_online_accounts
54+ gnome3.libpeas
55+ gnome3.nautilus
56+ libgpgerror
57+ libsecret
58+ # Transitive
59+ atk
60+ pango
61+ ];
62+ in ''
63+ # Unwrap accidentally wrapped library
64+ mv $out/libexec/deja-dup/tools/.libduplicity.so-wrapped $out/libexec/deja-dup/tools/libduplicity.so
65+
66+ for elf in "$out"/bin/.*-wrapped "$out"/libexec/deja-dup/.deja-dup-monitor-wrapped "$out"/libexec/deja-dup/tools/*.so "$out"/lib/deja-dup/*.so "$out"/lib/nautilus/extensions-3.0/*.so; do
67+ patchelf --set-rpath '${rpath}':"$out/lib/deja-dup" "$elf"
68+ done
69+ '';
70+
71+ meta = with stdenv.lib; {
72+ description = "A simple backup tool";
73+ longDescription = ''
74+ Déjà Dup is a simple backup tool. It hides the complexity \
75+ of backing up the Right Way (encrypted, off-site, and regular) \
76+ and uses duplicity as the backend.
77+ '';
78+ homepage = https://launchpad.net/deja-dup;
79+ license = with licenses; gpl3;
80+ maintainers = with maintainers; [ jtojnar ];
81+ platforms = with platforms; linux;
82+ };
83+}