nixpkgs/pkgs/applications/networking/bittorrentsync/default.nix

43 lines
1.4 KiB
Nix
Raw Normal View History

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