2018-07-20 20:54:05 +01:00
|
|
|
{ stdenv, fetchurl, version, sha256s, ... }:
|
2016-05-05 23:55:32 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
arch = {
|
|
|
|
"x86_64-linux" = "x64";
|
|
|
|
"i686-linux" = "i386";
|
2017-12-05 23:06:43 +00:00
|
|
|
}.${stdenv.system} or throwSystem;
|
2016-05-05 23:55:32 +01:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ];
|
2017-12-05 23:06:43 +00:00
|
|
|
throwSystem = throw "Unsupported system: ${stdenv.system}";
|
2016-05-05 23:55:32 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "btsync-${version}";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
# annoyingly, downloads for 1.4 and 2.3 do not follow the same URL layout; this is
|
|
|
|
# a simple work-around, in place of overriding the url in the caller.
|
|
|
|
urls = [
|
|
|
|
"https://download-cdn.getsync.com/${version}/linux-${arch}/BitTorrent-Sync_${arch}.tar.gz"
|
|
|
|
"http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz"
|
|
|
|
];
|
2017-12-05 23:06:43 +00:00
|
|
|
sha256 = sha256s.${stdenv.system} or throwSystem;
|
2016-05-05 23:55:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D btsync "$out/bin/btsync"
|
|
|
|
patchelf --interpreter "$(< $NIX_CC/nix-support/dynamic-linker)" --set-rpath ${libPath} "$out/bin/btsync"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Automatically sync files via secure, distributed technology";
|
|
|
|
homepage = https://www.getsync.com/;
|
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2016-05-17 12:57:28 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ domenkozar thoughtpolice cwoac ];
|
2016-05-05 23:55:32 +01:00
|
|
|
};
|
|
|
|
}
|