main
 1{
 2  lib,
 3  python3,
 4  fetchFromGitHub,
 5  makeWrapper,
 6}:
 7
 8python3.pkgs.buildPythonApplication rec {
 9  pname = "jellyfin-auto-collections";
10  version = "unstable-2024-01-01";
11
12  format = "other"; # No setup.py or pyproject.toml
13
14  src = fetchFromGitHub {
15    owner = "ghomasHudson";
16    repo = "Jellyfin-Auto-Collections";
17    rev = "master";
18    hash = "sha256-4dfpOgZ6mCbyzFKeP53ZQpfjK1dOp45rsclQzoQjzeQ=";
19  };
20
21  nativeBuildInputs = [ makeWrapper ];
22
23  propagatedBuildInputs = with python3.pkgs; [
24    apscheduler
25    beautifulsoup4
26    certifi
27    charset-normalizer
28    loguru
29    pluginlib
30    pyaml-env
31    pytz
32    pyyaml
33    requests
34    requests-cache
35    setuptools
36    six
37    soupsieve
38    tzlocal
39    urllib3
40    url-normalize
41    numpy
42    packaging
43    pillow
44    pyparsing
45    python-dateutil
46    attrs
47    cattrs
48    platformdirs
49  ];
50
51  dontBuild = true;
52  dontCheck = true;
53
54  installPhase = ''
55    runHook preInstall
56
57    mkdir -p $out/bin $out/lib/jellyfin-auto-collections
58    cp -r * $out/lib/jellyfin-auto-collections/
59
60    # Create wrapper script with proper PYTHONPATH
61    makeWrapper ${python3}/bin/python $out/bin/jellyfin-auto-collections \
62      --add-flags "$out/lib/jellyfin-auto-collections/main.py" \
63      --prefix PYTHONPATH : "$PYTHONPATH:$out/lib/jellyfin-auto-collections"
64
65    runHook postInstall
66  '';
67
68  meta = with lib; {
69    description = "Automatically make jellyfin collections from IMDB, Letterboxd lists and more";
70    homepage = "https://github.com/ghomasHudson/Jellyfin-Auto-Collections";
71    license = licenses.mit;
72    maintainers = [ ];
73    mainProgram = "jellyfin-auto-collections";
74  };
75}