1{ lib, fetchFromGitHub, buildPythonApplication, setuptools, wrapPython, makeWrapper }:
2
3buildPythonApplication rec {
4 pname = "Tautulli";
5 version = "2.12.4";
6 format = "other";
7
8 pythonPath = [ setuptools ];
9 nativeBuildInputs = [ wrapPython makeWrapper ];
10
11 src = fetchFromGitHub {
12 owner = "Tautulli";
13 repo = pname;
14 rev = "v${version}";
15 sha256 = "sha256-9E2qEdPfxnvx7WCHE/I2rP6Qk9CtsVrisQbq202+2uE=";
16 };
17
18 installPhase = ''
19 runHook preInstall
20
21 mkdir -p $out/bin $out/libexec/tautulli
22 cp -R contrib data lib plexpy Tautulli.py CHANGELOG.md $out/libexec/tautulli
23
24 echo "master" > $out/libexec/tautulli/branch.txt
25 echo "v${version}" > $out/libexec/tautulli/version.txt
26
27 # Can't just symlink to the main script, since it uses __file__ to
28 # import bundled packages and manage the service
29 makeWrapper $out/libexec/tautulli/Tautulli.py $out/bin/tautulli
30 wrapPythonProgramsIn "$out/libexec/tautulli" "$pythonPath"
31
32 # Creat backwards compatibility symlink to bin/plexpy
33 ln -s $out/bin/tautulli $out/bin/plexpy
34
35 runHook postInstall
36 '';
37
38 checkPhase = ''
39 runHook preCheck
40
41 $out/bin/tautulli --help
42
43 runHook postCheck
44 '';
45
46 meta = with lib; {
47 description = "A Python based monitoring and tracking tool for Plex Media Server";
48 homepage = "https://tautulli.com/";
49 license = licenses.gpl3Plus;
50 platforms = platforms.linux;
51 maintainers = with maintainers; [ rhoriguchi ];
52 };
53}