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