Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
templates/ | H | 25-Apr-2025 | - | 488 | 463 | |
.gitignore | H A D | 25-Apr-2025 | 6 | 2 | 1 | |
README.md | H A D | 25-Apr-2025 | 1.7 KiB | 43 | 28 | |
__init__.py | H A D | 25-Apr-2025 | 1.1 KiB | 23 | 19 | |
aosp.toml | H A D | 25-Apr-2025 | 3 KiB | 139 | 114 | |
build-android-turnip.sh | H A D | 25-Apr-2025 | 700 | 36 | 24 | |
build-fuchsia-turnip.sh | H A D | 25-Apr-2025 | 1.8 KiB | 58 | 43 | |
fuchsia.toml | H A D | 25-Apr-2025 | 1.1 KiB | 61 | 50 | |
generate_python_build.py | H A D | 25-Apr-2025 | 4.7 KiB | 142 | 108 | |
lint.sh | H A D | 25-Apr-2025 | 380 | 12 | 8 | |
meson2python.py | H A D | 25-Apr-2025 | 12.3 KiB | 344 | 295 | |
meson_build_state.py | H A D | 25-Apr-2025 | 9.3 KiB | 296 | 233 | |
meson_common.py | H A D | 25-Apr-2025 | 7.5 KiB | 338 | 268 | |
meson_impl.py | H A D | 25-Apr-2025 | 20.1 KiB | 791 | 582 | |
meson_to_hermetic.py | H A D | 25-Apr-2025 | 47.5 KiB | 1,387 | 1,140 | |
requirements.txt | H A D | 25-Apr-2025 | 64 | 6 | 5 | |
setup-venv.sh | H A D | 25-Apr-2025 | 538 | 17 | 15 |
README.md
1# meson_to_hermetic: automated build system generation 2 3Goal: ease the integration of Mesa as a component inside larger projects like 4Android (AOSP). 5 6How: parse the meson build tree into a python build script, which can be used 7together with configuration and options to generate other kinds of build scripts. 8 9Status: useful, but rough. Supports Android (Soong) and Fuchsia (Bazel). 10 11## Python Dependencies 12- Python 3.11+ 13 - See `requirements.txt` 14 - [](https://github.com/astral-sh/ruff) 15 16## Environment Setup 17 181. Open a terminal within `mesa3d/meson_to_hermetic` 192. Run the `setup-venv.sh` file to automatically create a python3 venv and install dependencies. 20 21## Linting the code 221. Before pushing code for review; run `lint.sh` to automatically lint all of the python scripts. 23 - IMPORTANT: Run the lint.sh from the `meson_to_hermetic` directory. 24 25## 1 - Generate python from meson 26 27generate_python_build.py: reads meson.build files (following subdir() commands) 28and uses meson2python to transform the meson into python. 29 30meson2python.py: passes meson.build input and the meson grammar to 31[python lark](https://github.com/lark-parser/lark) to perform lexing and parsing; then 32transforms the parse tree into valid python. The result is one large python script. 33 34## 2 - Generate Android.bp from python 35 36meson_android.py defines the meson API entry points and emits Android.bp build 37constructs. A config file is read to determine some build parameters such as 38`cpu_family` (similar to meson's cross file). 39 40## Limitations 41 42Meson build options must be set by modifying the defaults in meson_options.txt. 43