about summary refs log tree commit diff
path: root/pkgs/applications/networking/bittorrentsync
diff options
context:
space:
mode:
authorDomen Kozar <domen@dev.si>2013-04-27 18:43:43 +0200
committerDomen Kozar <domen@dev.si>2013-04-27 18:43:43 +0200
commit197ca4d67745a9bc83cd3d9ed86f70ea930166dd (patch)
tree413b7947fc097f2b690c6fc3d0baedbd5f0356d6 /pkgs/applications/networking/bittorrentsync
parent319ac481b8f5c939b26d7ac8df22e5d55d92643f (diff)
downloadnixlib-197ca4d67745a9bc83cd3d9ed86f70ea930166dd.tar
nixlib-197ca4d67745a9bc83cd3d9ed86f70ea930166dd.tar.gz
nixlib-197ca4d67745a9bc83cd3d9ed86f70ea930166dd.tar.bz2
nixlib-197ca4d67745a9bc83cd3d9ed86f70ea930166dd.tar.lz
nixlib-197ca4d67745a9bc83cd3d9ed86f70ea930166dd.tar.xz
nixlib-197ca4d67745a9bc83cd3d9ed86f70ea930166dd.tar.zst
nixlib-197ca4d67745a9bc83cd3d9ed86f70ea930166dd.zip
add bittorrent sync
Diffstat (limited to 'pkgs/applications/networking/bittorrentsync')
-rw-r--r--pkgs/applications/networking/bittorrentsync/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/applications/networking/bittorrentsync/default.nix b/pkgs/applications/networking/bittorrentsync/default.nix
new file mode 100644
index 000000000000..65a60b88477e
--- /dev/null
+++ b/pkgs/applications/networking/bittorrentsync/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, patchelf }:
+
+# this package contains the daemon version of bittorrent sync
+
+# it's unfortunately closed source.
+
+let
+  # TODO: arm, ppc, osx
+
+  arch = if stdenv.system == "x86_64-linux" then "x64"
+    else if stdenv.system == "i686-linux" then "i386"
+    else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
+    
+  interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
+    else if stdenv.system == "i686-linux" then "ld-linux.so.2"
+    else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
+
+  version = "1.0.116";
+  sha256 = if stdenv.system == "x86_64-linux" then "108c11x8lp0a4irq88raclz3zfvmkxsqymxx3y8amc1lc6kc3n8i"
+    else if stdenv.system == "i686-linux" then "0kkxi04rggq6lrvn7g1xjay2nskqn7z4qkm0h0lcra7h2jz09mf1"
+    else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
+
+in stdenv.mkDerivation {
+  name = "btsync-bin-${version}";
+  src = fetchurl {
+    # TODO: using version-specific URL: http://forum.bittorrent.com/topic/18070-versioned-binary-downloads/#entry45868
+    url = "http://btsync.s3-website-us-east-1.amazonaws.com/btsync_${arch}.tar.gz";
+    inherit sha256;
+  };
+
+  sourceRoot = ".";
+
+  installPhase = ''
+    ensureDir "$out/bin/"
+    cp -r "btsync" "$out/bin/"
+
+    patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
+      "$out/bin/btsync"
+  '';
+
+  buildInputs = [ patchelf ];
+
+  meta = {
+    homepage = "http://labs.bittorrent.com/experiments/sync.html";
+    description = "Automatically sync files via secure, distributed technology.";
+    license = stdenv.lib.licenses.unfreeRedistributable;
+    maintainers = [ stdenv.lib.maintainers.iElectric ];
+  };
+}