@@ -0,0 +1,35 @@
1+{ stdenv, pkgs, fetchurl, runCommand, makeWrapper, node_webkit_0_9
2+}:
3+
4+let
5+ node-webkit = node_webkit_0_9;
6+ version = "0.3.7.2";
7+ popcorntimePackage = stdenv.mkDerivation rec {
8+ name = "popcorntime-package-${version}";
9+ src = fetchurl {
10+ url = "https://get.popcorntime.io/build/Popcorn-Time-${version}-Linux64.tar.xz";
11+ sha256 = "0lm9k4fr73a9p00i3xj2ywa4wvjf9csadm0pcz8d6imwwq44sa8b";
12+ };
13+ sourceRoot = ".";
14+ installPhase = ''
15+ mkdir -p $out
16+ cp -r *.so *.pak $out/
17+ cat ${node-webkit}/bin/nw package.nw > $out/Popcorn-Time
18+ chmod 555 $out/Popcorn-Time
19+ '';
20+ };
21+in
22+ runCommand "popcorntime-${version}" {
23+ buildInputs = [ makeWrapper ];
24+ meta = with stdenv.lib; {
25+ homepage = http://popcorntime.io/;
26+ description = "An application that streams movies and TV shows from torrents";
27+ license = stdenv.lib.licenses.gpl3;
28+ platforms = platforms.linux;
29+ maintainers = with maintainers; [ bobvanderlinden ];
30+ };
31+ }
32+ ''
33+ mkdir -p $out/bin
34+ makeWrapper ${popcorntimePackage}/Popcorn-Time $out/bin/popcorntime
35+ ''