2015-09-05 00:09:34 +02:00
|
|
|
{ lib, stdenv, fetchurl, runCommand, makeWrapper, nwjs, zip }:
|
2015-06-08 19:33:23 +02:00
|
|
|
|
|
|
|
let
|
2015-09-05 00:09:34 +02:00
|
|
|
version = "0.3.8-3";
|
2015-06-19 23:18:05 +02:00
|
|
|
|
|
|
|
popcorntimePackage = stdenv.mkDerivation rec {
|
2015-09-05 00:09:34 +02:00
|
|
|
name = "popcorntime-${version}";
|
|
|
|
src = if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
|
|
|
url = "http://get.popcorntime.io/build/Popcorn-Time-${version}-Linux-64.tar.xz";
|
|
|
|
sha256 = "0q8c6m9majgv5a6hjl1b2ndmq4xx05zbarsydhqkivhh9aymvxgm";
|
|
|
|
}
|
|
|
|
else if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
|
|
|
url = "https://get.popcorntime.io/build/Popcorn-Time-${version}-Linux-32.tar.xz";
|
|
|
|
sha256 = "1dz1cp31qbwamm9pf8ydmzzhnb6d9z73bigdv3y74dgicz3dpr92";
|
|
|
|
}
|
|
|
|
else throw "Unsupported system ${stdenv.system}";
|
|
|
|
|
2015-06-08 19:33:23 +02:00
|
|
|
sourceRoot = ".";
|
2015-09-05 00:09:34 +02:00
|
|
|
|
|
|
|
buildInputs = [ zip ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
rm Popcorn-Time install
|
|
|
|
zip -r package.nw package.json src node_modules
|
|
|
|
cat ${nwjs}/bin/nw package.nw > Popcorn-Time
|
|
|
|
chmod 555 Popcorn-Time
|
|
|
|
'';
|
|
|
|
|
2015-06-08 19:33:23 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2015-09-05 00:09:34 +02:00
|
|
|
cp -r * $out/
|
2015-06-08 19:33:23 +02:00
|
|
|
'';
|
2015-09-05 00:09:34 +02:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
2015-06-08 19:33:23 +02:00
|
|
|
};
|
|
|
|
in
|
|
|
|
runCommand "popcorntime-${version}" {
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://popcorntime.io/;
|
|
|
|
description = "An application that streams movies and TV shows from torrents";
|
|
|
|
license = stdenv.lib.licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ bobvanderlinden ];
|
2015-11-09 19:44:09 +01:00
|
|
|
broken = true; # popcorntime.io is dead
|
2015-06-08 19:33:23 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
makeWrapper ${popcorntimePackage}/Popcorn-Time $out/bin/popcorntime
|
|
|
|
''
|