about summary refs log tree commit diff
path: root/pkgs/applications/networking/sync
diff options
context:
space:
mode:
authorDamien Cassou <damien.cassou@gmail.com>2014-08-31 18:04:51 +0200
committerDamien Cassou <damien.cassou@gmail.com>2014-08-31 18:04:51 +0200
commit242ae9c38c8f4a44692fed6ed64d57ae866b901f (patch)
treee73473051a553727246fd881696a91c4a102c79a /pkgs/applications/networking/sync
parent7327e3f808a5e2fa2eb239947580c5892f5f75e3 (diff)
downloadnixlib-242ae9c38c8f4a44692fed6ed64d57ae866b901f.tar
nixlib-242ae9c38c8f4a44692fed6ed64d57ae866b901f.tar.gz
nixlib-242ae9c38c8f4a44692fed6ed64d57ae866b901f.tar.bz2
nixlib-242ae9c38c8f4a44692fed6ed64d57ae866b901f.tar.lz
nixlib-242ae9c38c8f4a44692fed6ed64d57ae866b901f.tar.xz
nixlib-242ae9c38c8f4a44692fed6ed64d57ae866b901f.tar.zst
nixlib-242ae9c38c8f4a44692fed6ed64d57ae866b901f.zip
backintime: Definition improvement
Diffstat (limited to 'pkgs/applications/networking/sync')
-rw-r--r--pkgs/applications/networking/sync/backintime/common.nix46
-rw-r--r--pkgs/applications/networking/sync/backintime/default.nix78
-rw-r--r--pkgs/applications/networking/sync/backintime/gnome.nix37
3 files changed, 83 insertions, 78 deletions
diff --git a/pkgs/applications/networking/sync/backintime/common.nix b/pkgs/applications/networking/sync/backintime/common.nix
new file mode 100644
index 000000000000..fa722747e5fb
--- /dev/null
+++ b/pkgs/applications/networking/sync/backintime/common.nix
@@ -0,0 +1,46 @@
+{stdenv, fetchurl, makeWrapper, gettext, python2, python2Packages }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.36";
+
+  name = "backintime-common-${version}";
+
+  src = fetchurl {
+    url = "https://launchpad.net/backintime/1.0/${version}/+download/backintime-${version}.tar.gz";
+    md5 = "28630bc7bd5f663ba8fcfb9ca6a742d8";
+  };
+
+  # because upstream tarball has no top-level directory.
+  # https://bugs.launchpad.net/backintime/+bug/1359076
+  sourceRoot = ".";
+
+  buildInputs = [ makeWrapper gettext python2 python2Packages.dbus ];
+
+  installFlags = [ "DEST=$(out)" ];
+
+  preConfigure = "cd common";
+
+  dontAddPrefix = true;
+
+  preFixup =
+    ''
+    substituteInPlace "$out/bin/backintime" \
+      --replace "=\"/usr/share" "=\"$prefix/share"
+    wrapProgram "$out/bin/backintime" \
+      --prefix PYTHONPATH : "$PYTHONPATH" \
+      --prefix PATH : "$prefix/bin:$PATH"
+    '';
+
+  meta = {
+    homepage = https://launchpad.net/backintime;
+    description = "Simple backup tool for Linux";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [ stdenv.lib.maintainers.DamienCassou ];
+    platforms = stdenv.lib.platforms.all;
+    longDescription = ''
+      Back In Time is a simple backup tool (on top of rsync) for Linux
+      inspired from “flyback project” and “TimeVault”. The backup is
+      done by taking snapshots of a specified set of directories.
+    '';
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/networking/sync/backintime/default.nix b/pkgs/applications/networking/sync/backintime/default.nix
deleted file mode 100644
index 9b9e355f8281..000000000000
--- a/pkgs/applications/networking/sync/backintime/default.nix
+++ /dev/null
@@ -1,78 +0,0 @@
-{stdenv, fetchurl, makeWrapper, gettext, python2, python2Packages, gnome2, pkgconfig, pygobject, glib, libtool }:
-
-let
-  version = "1.0.36";
-
-  src = fetchurl {
-    url = "https://launchpad.net/backintime/1.0/${version}/+download/backintime-${version}.tar.gz";
-    md5 = "28630bc7bd5f663ba8fcfb9ca6a742d8";
-  };
-
-  # because upstream tarball has no top-level directory.
-  # https://bugs.launchpad.net/backintime/+bug/1359076
-  sourceRoot = ".";
-
-  genericBuildInputs = [ makeWrapper gettext python2 python2Packages.dbus ];
-
-  installFlagsArray = [ "DEST=$(out)" ];
-
-  meta = {
-    homepage = https://launchpad.net/backintime;
-    description = "Simple backup tool for Linux";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.DamienCassou ];
-    platforms = stdenv.lib.platforms.linux;
-    longDescription = ''
-      Back In Time is a simple backup tool (on top of rsync) for Linux
-      inspired from “flyback project” and “TimeVault”. The backup is
-      done by taking snapshots of a specified set of directories.
-    '';
-  };
-
-  common = stdenv.mkDerivation rec {
-    inherit version src sourceRoot installFlagsArray meta;
-
-    name = "backintime-common-${version}";
-
-    buildInputs = genericBuildInputs;
-
-    preConfigure = "cd common";
-
-    dontAddPrefix = true;
-
-    preFixup =
-      ''
-      substituteInPlace "$out/bin/backintime" \
-        --replace "=\"/usr/share" "=\"$prefix/share"
-      wrapProgram "$out/bin/backintime" \
-        --prefix PYTHONPATH : "$PYTHONPATH"
-    '';
-  };
-
-in
-stdenv.mkDerivation rec {
-  inherit version src sourceRoot installFlagsArray meta;
-
-  name = "backintime-gnome-${version}";
-
-  buildInputs = genericBuildInputs ++ [ common python2Packages.pygtk python2Packages.notify gnome2.gnome_python ];
-
-  preConfigure = "cd gnome";
-  configureFlagsArray = [ "--no-check" ];
-
-  preFixup =
-      ''
-      substituteInPlace "$out/share/backintime/gnome/app.py" \
-         --replace "glade_file = os.path.join(self.config.get_app_path()," \
-                   "glade_file = os.path.join('$prefix/share/backintime',"
-      substituteInPlace "$out/share/backintime/gnome/settingsdialog.py" \
-        --replace "glade_file = os.path.join(self.config.get_app_path()," \
-                  "glade_file = os.path.join('$prefix/share/backintime',"
-      substituteInPlace "$out/bin/backintime-gnome" \
-        --replace "=\"/usr/share" "=\"$prefix/share"
-      wrapProgram "$out/bin/backintime-gnome" \
-        --prefix PYTHONPATH : "${gnome2.gnome_python}/lib/python2.7/site-packages/gtk-2.0:${common}/share/backintime/common:$PYTHONPATH" \
-        --prefix PATH : "$PATH"
-    '';
-
-}
diff --git a/pkgs/applications/networking/sync/backintime/gnome.nix b/pkgs/applications/networking/sync/backintime/gnome.nix
new file mode 100644
index 000000000000..56d0f6c5481b
--- /dev/null
+++ b/pkgs/applications/networking/sync/backintime/gnome.nix
@@ -0,0 +1,37 @@
+{stdenv, fetchurl, makeWrapper, gettext, python2, python2Packages, gnome2, pkgconfig, pygobject, glib, libtool, backintime-common }:
+
+stdenv.mkDerivation rec {
+  inherit (backintime-common) version src sourceRoot installFlags meta;
+
+  name = "backintime-gnome-${version}";
+
+  buildInputs = [ makeWrapper gettext python2 python2Packages.dbus backintime-common python2Packages.pygtk python2Packages.notify gnome2.gnome_python ];
+
+  preConfigure = "cd gnome";
+  configureFlags = [ "--no-check" ];
+
+  preFixup =
+      ''
+      # Make sure all Python files refer to $prefix/share/backintime
+      # instead of config.get_app_path() which returns the path of the
+      # 'common' module, not the path of the 'gnome' module.
+      filelist=$(mktemp)
+      find "$out/share/backintime/gnome" -name "*.py" -print0 > $filelist
+      while IFS="" read -r -d "" file <&9; do
+      substituteInPlace "$file" \
+         --replace "glade_file = os.path.join(config.get_app_path()," \
+                   "glade_file = os.path.join('$prefix/share/backintime'," \
+         --replace "glade_file = os.path.join(self.config.get_app_path()," \
+                   "glade_file = os.path.join('$prefix/share/backintime',"
+      done 9< "$filelist"
+      rm "$filelist"
+
+      substituteInPlace "$out/bin/backintime-gnome" \
+        --replace "=\"/usr/share" "=\"$prefix/share"
+
+      wrapProgram "$out/bin/backintime-gnome" \
+        --prefix PYTHONPATH : "${gnome2.gnome_python}/lib/python2.7/site-packages/gtk-2.0:${backintime-common}/share/backintime/common:$PYTHONPATH" \
+        --prefix PATH : "${backintime-common}/bin:$PATH"
+    '';
+
+}