Merge pull request #15246 from joachifm/bittorrentSync-generic

Bittorrent sync: refactor & update

+53 -78
+6 -39
pkgs/applications/networking/bittorrentsync/1.4.x.nix
··· 1 - { stdenv, fetchurl, patchelf }: 2 - 3 - let 4 - arch = if stdenv.system == "x86_64-linux" then "x64" 5 - else if stdenv.system == "i686-linux" then "i386" 6 - else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; 7 - 8 - sha256 = if stdenv.system == "x86_64-linux" then "0bw3ds3ndcnkry5mpv645z2bfi5z387bh0f7b35blxq1yv93r83f" 9 - else if stdenv.system == "i686-linux" then "1qwaj7l7nsd4afx7ksb4b1c22mki9qa40803v9x1a8bhbdfhkczk" 10 - else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; 1 + { stdenv, fetchurl, ... } @ args: 11 2 12 - libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; 13 - in 14 - stdenv.mkDerivation rec { 15 - name = "btsync-${version}"; 3 + import ./generic.nix (args // { 16 4 version = "1.4.111"; 17 - 18 - src = fetchurl { 19 - url = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz"; 20 - inherit sha256; 5 + sha256s = { 6 + "x86_64-linux" = "0bw3ds3ndcnkry5mpv645z2bfi5z387bh0f7b35blxq1yv93r83f"; 7 + "i686-linux" = "1qwaj7l7nsd4afx7ksb4b1c22mki9qa40803v9x1a8bhbdfhkczk"; 21 8 }; 22 - 23 - dontStrip = true; # Don't strip, otherwise patching the rpaths breaks 24 - sourceRoot = "."; 25 - buildInputs = [ patchelf ]; 26 - 27 - installPhase = '' 28 - mkdir -p "$out/bin/" 29 - cp -r "btsync" "$out/bin/" 30 - 31 - patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 32 - --set-rpath ${libPath} "$out/bin/btsync" 33 - ''; 34 - 35 - meta = { 36 - description = "Automatically sync files via secure, distributed technology"; 37 - homepage = "http://www.bittorrent.com/sync"; 38 - license = stdenv.lib.licenses.unfreeRedistributable; 39 - platforms = stdenv.lib.platforms.linux; 40 - maintainers = with stdenv.lib.maintainers; [ iElectric thoughtpolice ]; 41 - }; 42 - } 9 + })
+7 -39
pkgs/applications/networking/bittorrentsync/2.0.x.nix
··· 1 - { stdenv, fetchurl }: 2 - 3 - let 4 - arch = if stdenv.system == "x86_64-linux" then "x64" 5 - else if stdenv.system == "i686-linux" then "i386" 6 - else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; 7 - 8 - sha256 = if stdenv.system == "x86_64-linux" then "01yrligi61gxcixh7z6gi427ga0sx97wnmkv08p9ykd4b90hvj7s" 9 - else if stdenv.system == "i686-linux" then "119dll7f4w7h8nrrafmrj1d0lddjzwg5l8hnf74xdjg6g7rhrmd7" 10 - else throw "Bittorrent Sync for: ${stdenv.system} not supported!"; 11 - 12 - libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; 13 - in 14 - stdenv.mkDerivation rec { 15 - name = "btsync-${version}"; 16 - version = "2.3.6"; 17 - 18 - src = fetchurl { 19 - url = "https://download-cdn.getsync.com/${version}/linux-${arch}/BitTorrent-Sync_${arch}.tar.gz"; 20 - inherit sha256; 21 - }; 22 - 23 - dontStrip = true; # Don't strip, otherwise patching the rpaths breaks 24 - sourceRoot = "."; 25 - 26 - installPhase = '' 27 - mkdir -p "$out/bin/" 28 - cp -r "btsync" "$out/bin/" 1 + { stdenv, fetchurl, ... } @ args: 29 2 30 - patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 31 - --set-rpath ${libPath} "$out/bin/btsync" 32 - ''; 33 - 34 - meta = { 35 - description = "Automatically sync files via secure, distributed technology"; 36 - homepage = https://www.getsync.com/; 37 - license = stdenv.lib.licenses.unfreeRedistributable; 38 - platforms = stdenv.lib.platforms.linux; 39 - maintainers = with stdenv.lib.maintainers; [ iElectric thoughtpolice cwoac ]; 3 + import ./generic.nix (args // { 4 + version = "2.3.7"; 5 + sha256s = { 6 + "x86_64-linux" = "1hnw6bv60xrnc733gm1ilywc0y93k2g6bmwgnww9qk7ivbvi6pd1"; 7 + "i686-linux" = "0hj8nbq6mava15m1hxaqq371fqk0whdx5iqsbnppyci0jjnr4qv1"; 40 8 }; 41 - } 9 + })
+40
pkgs/applications/networking/bittorrentsync/generic.nix
··· 1 + { stdenv, fetchurl, version, sha256s, ... } @ args: 2 + 3 + let 4 + arch = { 5 + "x86_64-linux" = "x64"; 6 + "i686-linux" = "i386"; 7 + }.${stdenv.system}; 8 + libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; 9 + in 10 + 11 + stdenv.mkDerivation rec { 12 + name = "btsync-${version}"; 13 + inherit version; 14 + 15 + src = fetchurl { 16 + # annoyingly, downloads for 1.4 and 2.3 do not follow the same URL layout; this is 17 + # a simple work-around, in place of overriding the url in the caller. 18 + urls = [ 19 + "https://download-cdn.getsync.com/${version}/linux-${arch}/BitTorrent-Sync_${arch}.tar.gz" 20 + "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz" 21 + ]; 22 + sha256 = sha256s.${stdenv.system}; 23 + }; 24 + 25 + dontStrip = true; # Don't strip, otherwise patching the rpaths breaks 26 + sourceRoot = "."; 27 + 28 + installPhase = '' 29 + install -D btsync "$out/bin/btsync" 30 + patchelf --interpreter "$(< $NIX_CC/nix-support/dynamic-linker)" --set-rpath ${libPath} "$out/bin/btsync" 31 + ''; 32 + 33 + meta = { 34 + description = "Automatically sync files via secure, distributed technology"; 35 + homepage = https://www.getsync.com/; 36 + license = stdenv.lib.licenses.unfreeRedistributable; 37 + platforms = stdenv.lib.platforms.linux; 38 + maintainers = with stdenv.lib.maintainers; [ iElectric thoughtpolice cwoac ]; 39 + }; 40 + }