nixpkgs/pkgs/applications/networking/bittorrentsync/default.nix
Austin Seipp 178ecc1515 nixpkgs: btsync 1.4.93 -> 1.4.103
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-12-05 21:56:52 -06:00

43 lines
1.4 KiB
Nix

{ 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!";
sha256 = if stdenv.system == "x86_64-linux" then "0hiapq24y02pm7zi0jvqj4jxwdn5k74yxq9n1jpv8jmgir3iwznn"
else if stdenv.system == "i686-linux" then "0jv3zg0jhdzsc56kkpylwihvhsz73gsl2i2pjmqk3r3x4gwjk8xx"
else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.libc ];
in
stdenv.mkDerivation rec {
name = "btsync-${version}";
version = "1.4.103";
src = fetchurl {
url = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz";
inherit sha256;
};
dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
sourceRoot = ".";
buildInputs = [ patchelf ];
installPhase = ''
mkdir -p "$out/bin/"
cp -r "btsync" "$out/bin/"
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath ${libPath} "$out/bin/btsync"
'';
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 ];
};
}