Nonstandard build procedure for python app -- app-local module not found by python?

I’m trying to add the app Bubblejail to nixpkgs and it isn’t going very well.

See, bubblejail has a highly-customized meson build procedure that doesn’t seem to run properly when using buildPythonApplication with the meson-python build system. I’ve ended up having to use mkDerivation to just get a normal run of meson for build and install. The problem is, once I get a successful build, I find that python isn’t able to find any of the libraries that bubblejail uses:


I tried using buildPythonApplication with a postFixup that makes the binaries executable, but that just resulted in this:

This is especially puzzling because I set pythonImportsCheck = ["bubblejail"]; in my buildPythonApplication call

To make all of this worse, man page generation with scdoc is also failing, no matter what I seem to do.

I think my best bet is to stick to mkDerivation. My only question is: how do I get python to recognize the libraries that I’ve added?

Also, let me know if you have any ideas about the whole scdoc thing.

Edit 1

The author of bubblejail has helped me with the dependencies issue; there was an option that changed the directory to which libraries were being installed. By patching out this option, I no longer have trouble with the dependencies.

However, I’m now dealing with “No module named ‘bubblejail’” in my mkDerivation implementation. What’s going on here?

Edit 2

This was actually quite simple: bubblejail puts most of its code into a module placed in lib, which its entrypoint scripts depend upon. The issue is that this library isn’t included in the $PYTHONPATH at runtime. I’m going to try and separate the library and executables of bubblejail into two different packages, allowing me to include python3.pkgs.bubblejail in the buildInputs of bubblejail.