1{stdenv, fetchFromGitHub, python}:
2
3stdenv.mkDerivation rec {
4 version = "1.4.25";
5 pname = "plexpy";
6 name = "${pname}-${version}";
7
8 src = fetchFromGitHub {
9 owner = "JonnyWong16";
10 repo = pname;
11 rev = "v${version}";
12 sha256 = "0a4ynrfamlwkgqil4n61v47p21czxpjdzg0mias4kdjam2nnwnjx";
13 };
14
15 buildPhase = ":";
16
17 installPhase = ''
18 mkdir -p $out
19 cp -R * $out/
20
21 # Remove superfluous Python checks from main script;
22 # prepend shebang
23 echo "#!${python.interpreter}" > $out/PlexPy.py
24 tail -n +7 PlexPy.py >> $out/PlexPy.py
25
26 mkdir $out/bin
27 # Can't just symlink to the main script, since it uses __file__ to
28 # import bundled packages and manage the service
29 echo "#!/bin/bash" > $out/bin/plexpy
30 echo "$out/PlexPy.py \$*" >> $out/bin/plexpy
31 chmod +x $out/bin/plexpy
32 '';
33
34 meta = with stdenv.lib; {
35 description = "A Python based monitoring and tracking tool for Plex Media Server.";
36 homepage = http://jonnywong16.github.io/plexpy/;
37 license = licenses.gpl3;
38 platforms = platforms.linux;
39 maintainers = with stdenv.lib.maintainers; [ csingley ];
40 };
41}