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!";
|
|
|
|
|
2015-04-23 14:52:54 +02:00
|
|
|
sha256 = if stdenv.system == "x86_64-linux" then "9e1427b7a6c6e960a378b97ac458ad53c445457ed0e5c8bf693f446597377b78"
|
|
|
|
else if stdenv.system == "i686-linux" then "4d446255ff6332da9a244737d6c20e7dcd32d24a8eaabffbaf73147e5898ed8f"
|
2013-04-27 18:43:43 +02:00
|
|
|
else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
|
|
|
|
|
2014-12-17 19:11:30 +01:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ];
|
2014-04-01 10:47:27 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "btsync-${version}";
|
2015-04-23 14:52:54 +02:00
|
|
|
version = "2.0.105";
|
2014-04-01 10:47:27 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-04-23 14:52:54 +02:00
|
|
|
url = "https://download-cdn.getsyncapp.com/${version}/linux-${arch}/BitTorrent-Sync_${arch}.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 = ''
|
2014-06-30 14:56:10 +02:00
|
|
|
mkdir -p "$out/bin/"
|
2013-04-27 18:43:43 +02:00
|
|
|
cp -r "btsync" "$out/bin/"
|
|
|
|
|
2014-12-17 19:11:30 +01:00
|
|
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2014-04-01 10:47:27 +02:00
|
|
|
--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;
|
2015-04-06 17:31:40 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ iElectric thoughtpolice cwoac ];
|
2013-04-27 18:43:43 +02:00
|
|
|
};
|
|
|
|
}
|