Name Date Size #Lines LOC

..--

templates/H25-Apr-2025-488463

.gitignoreH A D25-Apr-20256 21

README.mdH A D25-Apr-20251.7 KiB4328

__init__.pyH A D25-Apr-20251.1 KiB2319

aosp.tomlH A D25-Apr-20253 KiB139114

build-android-turnip.shH A D25-Apr-2025700 3624

build-fuchsia-turnip.shH A D25-Apr-20251.8 KiB5843

fuchsia.tomlH A D25-Apr-20251.1 KiB6150

generate_python_build.pyH A D25-Apr-20254.7 KiB142108

lint.shH A D25-Apr-2025380 128

meson2python.pyH A D25-Apr-202512.3 KiB344295

meson_build_state.pyH A D25-Apr-20259.3 KiB296233

meson_common.pyH A D25-Apr-20257.5 KiB338268

meson_impl.pyH A D25-Apr-202520.1 KiB791582

meson_to_hermetic.pyH A D25-Apr-202547.5 KiB1,3871,140

requirements.txtH A D25-Apr-202564 65

setup-venv.shH A D25-Apr-2025538 1715

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  - [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](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