2016-03-16 21:54:00 +01:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, nwjs, zip }:
|
2015-06-08 19:33:23 +02:00
|
|
|
|
|
|
|
let
|
2016-03-16 21:54:00 +01:00
|
|
|
arch = if stdenv.system == "x86_64-linux" then "64"
|
|
|
|
else if stdenv.system == "i686-linux" then "32"
|
|
|
|
else throw "Unsupported system ${stdenv.system}";
|
2015-06-19 23:18:05 +02:00
|
|
|
|
2016-03-16 21:54:00 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "popcorntime-${version}";
|
|
|
|
version = "0.3.9";
|
2015-09-05 00:09:34 +02:00
|
|
|
|
2016-03-16 21:54:00 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://get.popcorntime.sh/build/Popcorn-Time-${version}-Linux-${arch}.tar.xz";
|
|
|
|
sha256 =
|
|
|
|
if arch == "64"
|
|
|
|
then "0qaqdz45frgiy440jyz6hikhklx2yp08qp94z82r03dkbf4a2hvx"
|
|
|
|
else "0y08a42pm681s97lkczdq5dblxl2jbr850hnl85hknl3ynag9kq4";
|
|
|
|
};
|
2015-09-05 00:09:34 +02:00
|
|
|
|
2016-03-16 21:54:00 +01:00
|
|
|
dontPatchELF = true;
|
|
|
|
sourceRoot = "linux${arch}";
|
|
|
|
buildInputs = [ zip makeWrapper ];
|
2015-09-05 00:09:34 +02:00
|
|
|
|
2016-03-16 21:54:00 +01:00
|
|
|
buildPhase = ''
|
|
|
|
rm Popcorn-Time
|
|
|
|
cat ${nwjs}/bin/nw nw.pak > Popcorn-Time
|
|
|
|
chmod 555 Popcorn-Time
|
|
|
|
'';
|
2015-09-05 00:09:34 +02:00
|
|
|
|
2016-03-16 21:54:00 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -r * $out/
|
|
|
|
makeWrapper $out/Popcorn-Time $out/bin/popcorntime
|
|
|
|
'';
|
2015-09-05 00:09:34 +02:00
|
|
|
|
2016-03-16 21:54:00 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://popcorntime.sh/;
|
|
|
|
description = "An application that streams movies and TV shows from torrents";
|
|
|
|
license = stdenv.lib.licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ bobvanderlinden rnhmjoj ];
|
2015-06-08 19:33:23 +02:00
|
|
|
};
|
2016-03-16 21:54:00 +01:00
|
|
|
}
|