Merge pull request #2091 from thoughtpolice/btsync

btsync: 1.2.91 -> 1.3.77
This commit is contained in:
Peter Simons 2014-04-01 11:07:58 +02:00
commit 866c3a329d

View File

@ -1,47 +1,43 @@
{ stdenv, fetchurl, patchelf }: { stdenv, fetchurl, patchelf }:
# this package contains the daemon version of bittorrent sync
# it's unfortunately closed source.
let let
# TODO: arm, ppc, osx
arch = if stdenv.system == "x86_64-linux" then "x64" arch = if stdenv.system == "x86_64-linux" then "x64"
else if stdenv.system == "i686-linux" then "i386" else if stdenv.system == "i686-linux" then "i386"
else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" sha256 = if stdenv.system == "x86_64-linux" then "1x95pag8ncjx3svm4424fjk5nmbdg8m87fsxy9sc63ba3qs9645j"
else if stdenv.system == "i686-linux" then "ld-linux.so.2" else if stdenv.system == "i686-linux" then "0l8d85ib6kbpz5sh9v0qga03i4xph61iiy9xlhazm9h30d5a6l8v"
else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
version = "1.2.91"; libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.libc ];
sha256 = if stdenv.system == "x86_64-linux" then "1rx5mmk3ffkh6dbm0m33nyx6spsxqjw9djclcf9x9bs3zfyzgmnd" in
else if stdenv.system == "i686-linux" then "1566mp01149gsb57dv87420w1vq2f3adp6g1c90xdxjxzd67yqpw" stdenv.mkDerivation rec {
else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; name = "btsync-${version}";
version = "1.3.77";
in stdenv.mkDerivation {
name = "btsync-bin-${version}";
src = fetchurl { src = fetchurl {
url = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz"; url = "http://download-lb.utorrent.com/endpoint/btsync/os/linux-${arch}/track/stable";
name = "btsync-${arch}-${version}.tar.gz";
inherit sha256; inherit sha256;
}; };
dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
sourceRoot = "."; sourceRoot = ".";
buildInputs = [ patchelf ];
installPhase = '' installPhase = ''
ensureDir "$out/bin/" ensureDir "$out/bin/"
cp -r "btsync" "$out/bin/" cp -r "btsync" "$out/bin/"
patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \ patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
"$out/bin/btsync" --set-rpath ${libPath} "$out/bin/btsync"
''; '';
buildInputs = [ patchelf ];
meta = { meta = {
homepage = "http://labs.bittorrent.com/experiments/sync.html";
description = "Automatically sync files via secure, distributed technology"; description = "Automatically sync files via secure, distributed technology";
license = stdenv.lib.licenses.unfree; homepage = "http://www.bittorrent.com/sync";
maintainers = [ stdenv.lib.maintainers.iElectric ]; license = stdenv.lib.licenses.unfreeRedistributable;
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [ iElectric thoughtpolice ];
}; };
} }