2013-04-27 17:43:43 +01: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-09-19 12:47:31 +01:00
|
|
|
sha256 = if stdenv.system == "x86_64-linux" then "115xsbi5z8ll0z07vx4rzzsgr6qba43f3z3nzx33pva5dpdr3ci9"
|
|
|
|
else if stdenv.system == "i686-linux" then "110k6cq6l3nr1gak2ri6i1kwis78r3zc1ilbipgcccdczf9fnx7p"
|
2013-04-27 17:43:43 +01:00
|
|
|
else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
|
|
|
|
|
2014-04-01 09:47:27 +01:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.libc ];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "btsync-${version}";
|
2014-09-19 12:47:31 +01:00
|
|
|
version = "1.4.82";
|
2014-04-01 09:47:27 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-04-01 12:25:48 +01:00
|
|
|
url = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz";
|
2013-04-27 17:43:43 +01:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2014-04-01 09:47:27 +01:00
|
|
|
dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
|
|
|
|
sourceRoot = ".";
|
|
|
|
buildInputs = [ patchelf ];
|
2013-04-27 17:43:43 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p "$out/bin/"
|
2013-04-27 17:43:43 +01:00
|
|
|
cp -r "btsync" "$out/bin/"
|
|
|
|
|
2014-04-01 09:47:27 +01:00
|
|
|
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath ${libPath} "$out/bin/btsync"
|
2013-04-27 17:43:43 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-10-05 15:22:46 +01:00
|
|
|
description = "Automatically sync files via secure, distributed technology";
|
2014-04-01 09:47:27 +01: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 17:43:43 +01:00
|
|
|
};
|
|
|
|
}
|