From 0539ed477151a3adfff5012cabff0527a9a8c0bb Mon Sep 17 00:00:00 2001 From: Oliver Matthews Date: Mon, 6 Apr 2015 15:31:40 +0000 Subject: Add support for btsync 2.x branch --- .../networking/bittorrentsync/1.4.x.nix | 42 ++++++++++++++++++++++ .../networking/bittorrentsync/2.0.x.nix | 42 ++++++++++++++++++++++ .../networking/bittorrentsync/default.nix | 42 ---------------------- pkgs/top-level/all-packages.nix | 4 ++- 4 files changed, 87 insertions(+), 43 deletions(-) create mode 100644 pkgs/applications/networking/bittorrentsync/1.4.x.nix create mode 100644 pkgs/applications/networking/bittorrentsync/2.0.x.nix delete mode 100644 pkgs/applications/networking/bittorrentsync/default.nix (limited to 'pkgs') diff --git a/pkgs/applications/networking/bittorrentsync/1.4.x.nix b/pkgs/applications/networking/bittorrentsync/1.4.x.nix new file mode 100644 index 000000000000..1b439daa853e --- /dev/null +++ b/pkgs/applications/networking/bittorrentsync/1.4.x.nix @@ -0,0 +1,42 @@ +{ 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 "1b9f6qxpvyrzf23l71hw42qyg4i27by3hs91sm34drm24z7m7fpd" + else if stdenv.system == "i686-linux" then "0caqwaxd6i8cap35kpzkwy5dknk7iaxf5fbfjy46cbwylgcpsc2x" + else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; + + libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; +in +stdenv.mkDerivation rec { + name = "btsync-${version}"; + version = "1.4.110"; + + 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_CC/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 ]; + }; +} diff --git a/pkgs/applications/networking/bittorrentsync/2.0.x.nix b/pkgs/applications/networking/bittorrentsync/2.0.x.nix new file mode 100644 index 000000000000..9a7c07c322ed --- /dev/null +++ b/pkgs/applications/networking/bittorrentsync/2.0.x.nix @@ -0,0 +1,42 @@ +{ 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 "cbce76f73f47c23d9073644504fa454976629450d008354bd8faef1bddf368fd" + else if stdenv.system == "i686-linux" then "d3e8583c8a54cbeb34ea3621daf0498316a959d944b30f24aa4e518a851ecdeb" + else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; + + libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; +in +stdenv.mkDerivation rec { + name = "btsync-${version}"; + version = "2.0.93"; + + 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_CC/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 cwoac ]; + }; +} diff --git a/pkgs/applications/networking/bittorrentsync/default.nix b/pkgs/applications/networking/bittorrentsync/default.nix deleted file mode 100644 index 1b439daa853e..000000000000 --- a/pkgs/applications/networking/bittorrentsync/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ 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 "1b9f6qxpvyrzf23l71hw42qyg4i27by3hs91sm34drm24z7m7fpd" - else if stdenv.system == "i686-linux" then "0caqwaxd6i8cap35kpzkwy5dknk7iaxf5fbfjy46cbwylgcpsc2x" - else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; - - libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; -in -stdenv.mkDerivation rec { - name = "btsync-${version}"; - version = "1.4.110"; - - 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_CC/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 ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c8ada7f2f27c..0a42b11c8507 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11743,7 +11743,9 @@ let sxiv = callPackage ../applications/graphics/sxiv { }; - bittorrentSync = callPackage ../applications/networking/bittorrentsync { }; + bittorrentSync = bittorrentSync14; + bittorrentSync14 = callPackage ../applications/networking/bittorrentsync/1.4.x.nix { }; + bittorrentSync20 = callPackage ../applications/networking/bittorrentsync/2.0.x.nix { }; copy-com = callPackage ../applications/networking/copy-com { }; -- cgit 1.4.1