summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/__init__.py
AgeCommit message (Collapse)Author
2025-12-22modules: rust: add package.override_dependency methodPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-22modules: rust: invoke subprojects automatically from dependencies()Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-22modules: allow passing an array for dependency versionsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-22modules: rust: implement workspace.subproject() and package.dependency()Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29modules: Fix state.project_name valueXavier Claessens
It was the name of root project instead of current subproject. This is only used by pkgconfig generator. While at it, simplify the way we get the project version.
2025-10-15revert local_program()Eli Schwartz
This reverts https://github.com/mesonbuild/meson/pull/15107 Explicit objections regarding the design were raised and not answered, so it shouldn't have been merged. It needs to be discussed and revisited.
2025-10-15Replace OverrideExecutable and OverrideProgram with LocalProgramXavier Claessens
2025-10-15Add support for LocalProgram to override_find_program()Xavier Claessens
2025-08-20Revert "gnome: support generate_gir on cross builds"Jussi Pakkanen
This reverts commit 5e627c9b421a4cebb0e112af6a432fec66640c28.
2025-08-01gnome: support generate_gir on cross buildsFlorian "sp1rit"​
This requires g-ir-scanner >=1.85.0, if this isn't the case we'll just fail.
2025-05-22support .version() for overridden executablesFlorian "sp1rit"​
Also ensure that .get_version() can be called on the output of _find_tool by the modules (kind of required for #14422).
2025-03-10coredata: replace get_option with optstore.get_value_forDylan Baker
This is an old method, that is now just a wrapper around the OptionStore method, that doesn't add any value. It's also an option related method attached to the CoreData instead of the OptionStore, so useless and a layering violation.
2025-02-27use ElementaryOptionValues instead of open coding... againDylan Baker
2024-11-15interpreter: remove current_linenoDylan Baker
This was only used in a couple of places, and requires extra tracking to ensure it is correct, while we already have `current_node.lineno`, which is always accurate and up to date. I have also fixed a potential strict-null issue by using a sentinel node for `current_node`
2024-09-11Fix typosspaette
2024-07-17Remove module type from OptionKey.Jussi Pakkanen
2024-07-17Remove language (AKA compiler) type from OptionKey.Jussi Pakkanen
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-05-19Pass wrapmode value around as a string. (#13229)Jussi Pakkanen
2024-02-23modules: fix find_program.wantedDylan Baker
Which should be `str | list[str]`, not `str | None`.
2024-02-08find_tool: fix error message interpolationOle André Vadla Ravnås
2024-01-11Vala: fixes to gresource handling (#12418)Valeri
* Vala: depend on gresources Valac uses gresource at compile time to look up .ui files * Automatically pass `--gresourcesdir` to valac * gnome.compile_resources: clean up duplicate paths better * Add a test for improved gresouce handling
2023-12-22modules: get rid of the .*machine variablesDylan Baker
They're hardly used, and can be gotten directly from the Environment instead
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-11-05gnome module: fix invalid find_tool variable contents causing crashEli Schwartz
If a tool that is looked up in a .pc file is supposed to be there and has a pkg-config variable entry, but the value is incorrect, we can't actually use it. Since commit ab3d02066c91974922948f8b8b0fc944875d1a90 we actually do run the ExternalProgram search procedure on it though -- which caused it to go wonky and return a None if it doesn't exist, instead of containing a path to a program that does not exist and fails at build time. This is better in the case where searching helps resolve .exe file extensions -- and worse in the case where patches to the dependency means nothing we do is ever enough to actually find what is expected, since now we crash. Raise an explicit error in such a case, pointing out that the dependency itself is broken and needs a distributor-side resolution. Fixes #12412
2023-09-30find_tool: don't assume the pkgconfig variable is a valid commandChristoph Reiter
ExternalProgram currently assumes that if a command is passed it exists and can be used as is. In case we extract the path from pkgconfig the path might not exist, on Windows it might be missing the ".exe" suffix. By passing the variables as a name ExternalProgram will validate that the command exists at configure time and will fail if not, and it will try to fixup the command by appending .exe etc. Fixes #12271
2023-08-29gnome: Fix crash in gtkdoc and generate_gir in C++ projectsXavier Claessens
gtkdoc() and generate_gir() methods assumes there is a C compiler, but pure C++ projects might not add it explicitly. Fixes: #12162
2023-08-24find_program: Fallback if version mismatchXavier Claessens
Fixes: #11797
2023-07-19fix implicit_reexport issues and enforce them going forwardEli Schwartz
This detects cases where module A imports a function from B, and C imports that same function from A instead of B. It's not part of the API contract of A, and causes innocent refactoring to break things.
2023-06-26Revert "modules: move gnome targets into gnome module"Eli Schwartz
This reverts commit a2def550c586aeba4269588e79a1a308467f2582. This results in a 2k line file being unconditionally imported at startup, and transitively loading two more (for a total cost of 2759 lines of code), and it's not clear it was ever needed to begin with...
2023-05-02update the devenv module hooks to support generic modifications to BuildEli Schwartz
We may want to do things like update install scripts as well, which have to happen before generating the backend. Instead of adding one module method per thing to do, use a single function that allows for modifying the Build object directly.
2023-01-10modules: add type annotations to the `__init__` moduleDylan Baker
2022-12-05modules: Add a method to the state object for include_dirsDylan Baker
The Interpreter has a method for this, and the module state just wraps it.
2022-11-30pylint: enable the set_membership pluginDylan Baker
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
2022-09-12i18n: Fix source root in Gettext targets for subprojectsDavid Ward
Gettext should search for input files relative to the (sub)project source root, not the global source root. This change exposes a root_subdir member in ModuleState.
2022-08-17modules: Add stabilization information to ModuleInfoDylan Baker
We're going to do more with this in the next commit, but this just adds the information for now. This allows the next commit have 100% mv changes for some of the modules, which makes review easier
2022-08-17modules: use module level information about new and deprecationDylan Baker
Instead of using FeatureNew/FeatureDeprecated in the module. The goal here is to be able to handle information about modules in a single place, instead of having to handle it separately. Each module simply defines some metadata, and then the interpreter handles the rest.
2022-07-03move various unused typing-only imports into type-checking blocksEli Schwartz
2022-06-10wayland: Lookup for wayland-scanner using pkgconfigXavier Claessens
Just like some of glib tools, wayland-scanner can be defined in the pkgconfig dependency variables. Share code between gnome and wayland modules into ModuleState.
2022-06-01modules: move gnome targets into gnome moduleDylan Baker
They're not used outside of the gnome module anyway, and they create some annoying potentials for dependency loops
2022-04-07Revert "wayland: Also lookup scanner in pkgconfig"Eli Schwartz
This reverts commit 7954a4c9cbf8355d8c8ea9b3d98df45d9f96f66e.
2022-04-04wayland: Also lookup scanner in pkgconfigXavier Claessens
This moves generally useful logic from GNOME module's _get_native_binary() into find_program() implementation. We could decide later to expose it as public API.
2022-02-28Add API for modules that wants to define their devenvXavier Claessens
2022-02-28modules: Make ExtensionModule inherit from NewExtensionModuleXavier Claessens
It reduces duplicated code.
2022-02-27modules/wayland: Add unstable_wayland moduleMark Bolhuis
2022-02-22modules: add ModuleState API to check whether an option was user-specifiedEli Schwartz
Needed to check exclusivity of module options.
2022-01-27fix some flake8 violations for unused importsEli Schwartz
And one undefined T.cast name in a file that isn't yet mypy-ready anyway.
2022-01-10fix broken module tests which caused gtkdoc-check to traceback on assertEli Schwartz
Regression in commit 566c2c9a9c98d13f85ccef624e9ac584f64c6a4a. The interpreter details are a bit of black magic. Functions expect tuples, but they receive lists and then the type-checking decorators convert those to tuples. So, directly manhandling a self._interpreter.func_*() but passing it the tuple it nominally expected, actually explodes in your face by way of failing an assert, then dumping 'ERROR: Unhandled python exception'. Fixes use of gnome.gtkdoc(..., check: true), for example when building glib.
2021-12-20modules: let the proxy state find_program do silent lookupsEli Schwartz
2021-11-01modules: use IncludeDirs.to_string_list instead of open codingDylan Baker
This both allows more cod re-use, and simplifies the code.