summary refs log tree commit diff
path: root/pkgs/servers/tautulli
diff options
context:
space:
mode:
authorfreezeboy <freezeboy@users.noreply.github.com>2020-11-21 15:50:37 +0100
committerfreezeboy <freezeboy@users.noreply.github.com>2020-11-26 20:04:07 +0100
commitfdad84f0922febe425659d4357072eb354378b59 (patch)
treee6930bd117d079f41ae600e35e58d68c1483af6d /pkgs/servers/tautulli
parent186c1e760b5498962872b303d60856a17fc1b0b1 (diff)
downloadnixpkgs-fdad84f0922febe425659d4357072eb354378b59.tar
nixpkgs-fdad84f0922febe425659d4357072eb354378b59.tar.gz
nixpkgs-fdad84f0922febe425659d4357072eb354378b59.tar.bz2
nixpkgs-fdad84f0922febe425659d4357072eb354378b59.tar.lz
nixpkgs-fdad84f0922febe425659d4357072eb354378b59.tar.xz
nixpkgs-fdad84f0922febe425659d4357072eb354378b59.tar.zst
nixpkgs-fdad84f0922febe425659d4357072eb354378b59.zip
tautulli: 2.2.4 -> 2.6.1
Diffstat (limited to 'pkgs/servers/tautulli')
-rw-r--r--pkgs/servers/tautulli/default.nix48
1 files changed, 21 insertions, 27 deletions
diff --git a/pkgs/servers/tautulli/default.nix b/pkgs/servers/tautulli/default.nix
index 1fbf94beb18..c7e88eb0c46 100644
--- a/pkgs/servers/tautulli/default.nix
+++ b/pkgs/servers/tautulli/default.nix
@@ -1,54 +1,48 @@
-{stdenv, fetchFromGitHub, python }:
+{ lib, fetchFromGitHub, python, buildPythonApplication, bash, setuptools, wrapPython, makeWrapper }:
 
-stdenv.mkDerivation rec {
-  version = "2.2.4";
+buildPythonApplication rec {
   pname = "Tautulli";
+  version = "2.6.1";
+  format = "other";
 
-  pythonPath = [ python.pkgs.setuptools ];
-  buildInputs = [ python.pkgs.setuptools ];
-  nativeBuildInputs = [ python.pkgs.wrapPython ];
+  pythonPath = [ setuptools ];
+  nativeBuildInputs = [ wrapPython makeWrapper ];
 
   src = fetchFromGitHub {
     owner = "Tautulli";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0yg7r7yscx6jbs1lnl9nbax3v9r6ppvhr4igdm3gbvd2803j8fs7";
+    sha256 = "QHpVIOtGFzNqAEcBCv48YWO4pYatbTe/CWwcwjbj+34=";
   };
 
-  buildPhase = ":";
+  doBuild = false;
 
   installPhase = ''
-    mkdir -p $out
-    cp -R * $out/
+    mkdir -p $out/bin $out/libexec/tautulli
+    cp -R contrib data lib plexpy Tautulli.py $out/libexec/tautulli
 
-    # Remove the PlexPy.py compatibility file as it won't work after wrapping.
-    # We still have the plexpy executable in bin for compatibility.
-    rm $out/PlexPy.py
-
-    # Remove superfluous Python checks from main script;
-    # prepend shebang
-    echo "#!${python.interpreter}" > $out/Tautulli.py
-    tail -n +7 Tautulli.py >> $out/Tautulli.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/tautulli
-    echo "$out/Tautulli.py \$*" >> $out/bin/tautulli
-    chmod +x $out/bin/tautulli
+    makeWrapper $out/libexec/tautulli/Tautulli.py $out/bin/tautulli
+    wrapPythonProgramsIn "$out/libexec/tautulli" "$pythonPath"
 
     # Creat backwards compatibility symlink to bin/plexpy
     ln -s $out/bin/tautulli $out/bin/plexpy
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    $out/bin/tautulli --help
 
-    wrapPythonProgramsIn "$out" "$out $pythonPath"
+    runHook postCheck
   '';
 
-  meta  = with stdenv.lib; {
+  meta  = with lib; {
     description = "A Python based monitoring and tracking tool for Plex Media Server";
     homepage = "https://tautulli.com/";
     license = licenses.gpl3;
     platforms = platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ csingley ];
+    maintainers = with maintainers; [ csingley ];
   };
 }