Bundle of third parties stuff

Hello,
I plan to build a flatpak application for voice recognition. This application uses pieces from different sources:

  • vosk python bindings, available on pypi.org
  • nerd-dictation, a python script using vosk bindings
  • parec for voice capture
  • xdotool for simulate keyboard
  • elograf for adding an entry in systray, using PyQt5.

I have build something in a whole which I can install locally.
I’m the author of only elograf.
Is there recommendations about the way to package, i.e. has some pieces to be split or is the whole be acceptable?

I find it hard to answer your question, because I’m unsure of your definitions of “split” and “whole”.
Could you please explain in more detail what you mean?

Typically I would say that you would want to use separate modules for each component that you need. Also please refer to the licenses of the dependencies to see if there are any special requirements there.

Since the sandbox cannot access the internet during the build process (except for setting up the environment), you might need to build some dependencies as you cannot just install them using pip.

See: Python — Flatpak documentation for more information.

I know the packaging with rpm, thus in such case, we would have a package for python-vosk-api, one for xdotool, one for parec, one for nerd-dictation. At last, elograf would provide its code and requires all other pieces. This is what I name the split form.
All these pieces are open source projects.

Which sandbox do you refer to in this case? I know that a sand box is used at run time on the final user machine, but you refer to a build time.

Yes so typically these would be separate modules in the manifest. If there are subdependencies then there is a good chance they also need to be bundled. Please see the link to the documentation.

So except for downloading the sources of a module during builds you cannot access the network, so in a way your also building the flatpak in a sandboxed environment.

it the same sandbox, flatpak-builder will run the build in the same sandbox (WITH the sdk) as the resulting package. Development support is provided by the SDK which is a superset of the platform. There is no network access during the build phase.

As for python you might want to look at GitHub - flatpak/flatpak-builder-tools: Various helper tools for flatpak-builder that contains tooling to generate manifests for python dependencies.