This directory contains the Flatpak Manifest and other build utilities.
The modules/python-*.json
files contain Flatpak modules to install Python dependencies.
These files are (sometimes partially, see below) auto-generated. Here is how to generate it:
- Obtain an up-to-date copy of flatpak-builder-tools.
- Make sure you have a Python virtualenv activated with the dependencies for the
pip
generator from the repo above. - Run
python3 <...>/flatpak-builder-tools/pip/flatpak-pip-generator <package> -o modules/python-<package> --build-isolation
You will notice that Workbench will not build after auto-generating these files as described above. This is due to these issues:
This means that the generated JSON file now needs its build dependencies manually added. Check the build dependencies of the package and their dependencies and add them to the JSON as well. Brute-forcing the build to obtain missing packages may help as does referencing old commits of the file. You can also use the generator command to generate dependencies for them and then merge it into the file by hand, but note that you will also need to manually collect their build dependencies too.
In some cases you may also need to manually remove some packages the generator adds (such as packaging
with rope
,
as the SDK and Runtime already contain a version of these packages that can not be replaced. Make sure the package
you want to install is actually compatible with the version of that dependency in the SDK/Runtime.
Python packages with Maturin as build system need some additional manual steps to get working. You will have to have
Rust enabled for compilation and pull in additional dependencies. See modules/python-ruff.json
for example.
You can generate Maturin's dependencies with another generator provided by the Flatpak Builder Tools. Clone
the Maturin repo in the corresponding version you need and run:
python3 <...>/flatpak-builder-tools/cargo/flatpak-cargo-generator.py <...>/Cargo.lock -o modules/cargo-sources-maturin.json