nixpkgs/pkgs/applications/video/popcorntime/default.nix

54 lines
1.6 KiB
Nix
Raw Normal View History

2015-09-04 23:09:34 +01:00
{ lib, stdenv, fetchurl, runCommand, makeWrapper, nwjs, zip }:
2015-06-08 18:33:23 +01:00
let
2015-09-04 23:09:34 +01:00
version = "0.3.8-3";
popcorntimePackage = stdenv.mkDerivation rec {
2015-09-04 23:09:34 +01: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 18:33:23 +01:00
sourceRoot = ".";
2015-09-04 23:09:34 +01: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 18:33:23 +01:00
installPhase = ''
mkdir -p $out
2015-09-04 23:09:34 +01:00
cp -r * $out/
2015-06-08 18:33:23 +01:00
'';
2015-09-04 23:09:34 +01:00
dontPatchELF = true;
2015-06-08 18:33:23 +01: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 18:44:09 +00:00
broken = true; # popcorntime.io is dead
2015-06-08 18:33:23 +01:00
};
}
''
mkdir -p $out/bin
makeWrapper ${popcorntimePackage}/Popcorn-Time $out/bin/popcorntime
''