2021-06-03 19:55:15 +03:00
|
|
|
{ lib, fetchFromGitHub, buildPythonApplication, setuptools, wrapPython, makeWrapper }:
|
2019-02-28 21:07:00 +03:00
|
|
|
|
2020-11-21 17:50:37 +03:00
|
|
|
buildPythonApplication rec {
|
2019-02-28 21:07:00 +03:00
|
|
|
pname = "Tautulli";
|
2022-12-23 00:46:17 +03:00
|
|
|
version = "2.11.1";
|
2020-11-21 17:50:37 +03:00
|
|
|
format = "other";
|
2019-02-28 21:07:00 +03:00
|
|
|
|
2020-11-21 17:50:37 +03:00
|
|
|
pythonPath = [ setuptools ];
|
|
|
|
nativeBuildInputs = [ wrapPython makeWrapper ];
|
2019-02-28 21:07:00 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Tautulli";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-12-23 00:46:17 +03:00
|
|
|
sha256 = "sha256-9hWTnBi8t3ZJzrDvvViQ/jYDdbNCabVAion9E9sjqRQ=";
|
2019-02-28 21:07:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
2022-01-08 18:41:10 +03:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-11-21 17:50:37 +03:00
|
|
|
mkdir -p $out/bin $out/libexec/tautulli
|
2022-01-08 18:41:10 +03:00
|
|
|
cp -R contrib data lib plexpy Tautulli.py CHANGELOG.md $out/libexec/tautulli
|
|
|
|
|
|
|
|
echo "master" > $out/libexec/tautulli/branch.txt
|
|
|
|
echo "v${version}" > $out/libexec/tautulli/version.txt
|
2019-02-28 21:07:00 +03:00
|
|
|
|
|
|
|
# Can't just symlink to the main script, since it uses __file__ to
|
|
|
|
# import bundled packages and manage the service
|
2020-11-21 17:50:37 +03:00
|
|
|
makeWrapper $out/libexec/tautulli/Tautulli.py $out/bin/tautulli
|
|
|
|
wrapPythonProgramsIn "$out/libexec/tautulli" "$pythonPath"
|
2019-02-28 21:07:00 +03:00
|
|
|
|
|
|
|
# Creat backwards compatibility symlink to bin/plexpy
|
|
|
|
ln -s $out/bin/tautulli $out/bin/plexpy
|
2022-01-08 18:41:10 +03:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-11-21 17:50:37 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
$out/bin/tautulli --help
|
2019-02-28 21:07:00 +03:00
|
|
|
|
2020-11-21 17:50:37 +03:00
|
|
|
runHook postCheck
|
2019-02-28 21:07:00 +03:00
|
|
|
'';
|
|
|
|
|
2020-11-21 17:50:37 +03:00
|
|
|
meta = with lib; {
|
2020-10-11 08:55:05 +03:00
|
|
|
description = "A Python based monitoring and tracking tool for Plex Media Server";
|
2020-03-12 12:23:24 +03:00
|
|
|
homepage = "https://tautulli.com/";
|
2022-01-08 18:41:10 +03:00
|
|
|
license = licenses.gpl3Plus;
|
2019-02-28 21:07:00 +03:00
|
|
|
platforms = platforms.linux;
|
2022-11-08 20:01:40 +03:00
|
|
|
maintainers = with maintainers; [ csingley rhoriguchi ];
|
2019-02-28 21:07:00 +03:00
|
|
|
};
|
|
|
|
}
|