Kodi plugin with Python library dependency

Hello,

I am trying to package a Kodi plugin with Python dependencies, but fail to do so. The Kodi addon correctly finds other Kodi addons that it depends on, but does not find any other Python dependencies. The addon code looks like so at the moment:

{ fetchzip
, kodiPackages
, lib

  # Local kodi packages.
, future
, simplejson
}:

kodiPackages.buildKodiAddon rec {
  pname = "orftvthek";
  namespace = "plugin.video.orftvthek";
  version = "0.12.3+matrix.1";

  src = fetchzip {
    url = "https://mirrors.kodi.tv/addons/matrix/${namespace}/${namespace}-${version}.zip";
    hash = "sha256-CaQ8RMJ7OeZbEhegOOzDElGirp/1jfiXb3WY3wkcyBs=";
  };

  propagatedBuildInputs = [
    kodiPackages.inputstreamhelper
    kodiPackages.kodi-six
    kodiPackages.requests
    future
    simplejson
  ];

  meta = with lib; {
    homepage = "https://github.com/s0faking/${namespace}";
    description = "ORF TVThek";
    license = licenses.gpl2;
    maintainers = teams.kodi.members;
  };
}

The future and simplejson are actually simple Python libraries (but they also come bundled as Kodi addons). I tried both, using pkgs.python3.pkgs.future and packaging the Kodi addon future and providing it as a dependency (same for simplejson), but it did not work.

I see that Kodi is wrapped with Nixpkgs/pkgs/applications/video/kodi/wrapper.nix. I would need to add Python dependencies there, specifically at the line

  requiredPythonPath = with kodi.pythonPackages; makePythonPath ([ pillow pycryptodome ]);

Any ideas?

EDIT: I should say that I use Kodi like so:

myKodi = pkgs.kodi-gbm.withPackages (kodiPkgs: with kodiPkgs; [
    orftvthek
  ]);

Please test this PR: kodi.packages.orftvthek: init at 0.12.3-1 by aanderse · Pull Request #153245 · NixOS/nixpkgs · GitHub

pkgs.kodi-gbm.withPackages (p: with p; [ orftvthek ])

1 Like

Thank you very much!