2013-04-27 18:43:43 +02:00
|
|
|
{ stdenv, fetchurl, patchelf }:
|
|
|
|
|
|
|
|
let
|
|
|
|
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!";
|
|
|
|
|
2014-05-18 23:33:33 +02:00
|
|
|
sha256 = if stdenv.system == "x86_64-linux" then "1xba0wv45w4kg84i5sywkfk44vj9wxkr7f1vga2mpz86j8vq25iy"
|
|
|
|
else if stdenv.system == "i686-linux" then "10ml1wclix9236zcb4mh60hdm9vvfaarlb62z7fdrwk6ikqbm7fk"
|
2013-04-27 18:43:43 +02:00
|
|
|
else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
|
|
|
|
|
2014-04-01 10:47:27 +02:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.libc ];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "btsync-${version}";
|
2014-05-18 22:28:23 +02:00
|
|
|
version = "1.3.94";
|
2014-04-01 10:47:27 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-04-01 13:25:48 +02:00
|
|
|
url = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz";
|
2013-04-27 18:43:43 +02:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2014-04-01 10:47:27 +02:00
|
|
|
dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
|
|
|
|
sourceRoot = ".";
|
|
|
|
buildInputs = [ patchelf ];
|
2013-04-27 18:43:43 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
ensureDir "$out/bin/"
|
|
|
|
cp -r "btsync" "$out/bin/"
|
|
|
|
|
2014-04-01 10:47:27 +02:00
|
|
|
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath ${libPath} "$out/bin/btsync"
|
2013-04-27 18:43:43 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-10-05 16:22:46 +02:00
|
|
|
description = "Automatically sync files via secure, distributed technology";
|
2014-04-01 10:47:27 +02:00
|
|
|
homepage = "http://www.bittorrent.com/sync";
|
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ iElectric thoughtpolice ];
|
2013-04-27 18:43:43 +02:00
|
|
|
};
|
|
|
|
}
|