From e697f10fc4e5343c9fc3c253efb910fecb6f84da Mon Sep 17 00:00:00 2001 From: Christopher Singley Date: Sun, 29 Oct 2017 19:28:16 -0500 Subject: [PATCH] PlexPy: init at 1.4.25 --- lib/maintainers.nix | 1 + pkgs/servers/plexpy/default.nix | 41 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 44 insertions(+) create mode 100644 pkgs/servers/plexpy/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 7c3a845c00c..dc2281401e0 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -136,6 +136,7 @@ cryptix = "Henry Bubert "; CrystalGamma = "Jona Stubbe "; cstrahan = "Charles Strahan "; + csingley = "Christopher Singley "; cwoac = "Oliver Matthews "; DamienCassou = "Damien Cassou "; danbst = "Danylo Hlynskyi "; diff --git a/pkgs/servers/plexpy/default.nix b/pkgs/servers/plexpy/default.nix new file mode 100644 index 00000000000..2875ecc5240 --- /dev/null +++ b/pkgs/servers/plexpy/default.nix @@ -0,0 +1,41 @@ +{stdenv, fetchFromGitHub, python}: + +stdenv.mkDerivation rec { + version = "1.4.25"; + pname = "plexpy"; + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "JonnyWong16"; + repo = pname; + rev = "v${version}"; + sha256 = "0a4ynrfamlwkgqil4n61v47p21czxpjdzg0mias4kdjam2nnwnjx"; + }; + + buildPhase = ":"; + + installPhase = '' + mkdir -p $out + cp -R * $out/ + + # Remove superfluous Python checks from main script; + # prepend shebang + echo "#!${python.interpreter}" > $out/PlexPy.py + tail -n +7 PlexPy.py >> $out/PlexPy.py + + mkdir $out/bin + # Can't just symlink to the main script, since it uses __file__ to + # import bundled packages and manage the service + echo "#!/bin/bash" > $out/bin/plexpy + echo "$out/PlexPy.py \$*" >> $out/bin/plexpy + chmod +x $out/bin/plexpy + ''; + + meta = with stdenv.lib; { + description = "A Python based monitoring and tracking tool for Plex Media Server."; + homepage = http://jonnywong16.github.io/plexpy/; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with stdenv.lib.maintainers; [ csingley ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 596051f4ea7..762f217fcbe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3966,6 +3966,8 @@ with pkgs; plex = callPackage ../servers/plex { enablePlexPass = config.plex.enablePlexPass or false; }; + plexpy = callPackage ../servers/plexpy { python = python2; }; + ploticus = callPackage ../tools/graphics/ploticus { libpng = libpng12; };