summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
AgeCommit message (Collapse)Author
2025-12-16review get_subdir vs get_builddirPaolo Bonzini
Comparing the implementation of build_subdir with https://github.com/mesonbuild/meson/pull/12258, both of them introduced a similar separation between srcdir and builddir. There were some differences in the choices of srcdir vs builddir; this commit tries to identify which are bugs in which implementation, and get the best of both worlds.
2025-11-19compilers: Remove Environment parameter from Compiler.sanitizer_argsDylan Baker
2025-11-12compilers: pass target and env to sanitizer_*_argsPaolo Bonzini
The Rust compiler will need these to check the rust_nightly option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-20interpreter: port dependency required to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency native to typed_kwargsDylan Baker
2025-10-20dependency: Use a TypedDict to describe the keyword arguments to DependencyDylan Baker
This allows us to check that all of the keyword arguments are of the correct type.
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-10-14Make use of build TypeAliasesDylan Baker
There are a lot of spelled out unions for these types, lets reduce that number
2025-10-06options: replace get_value with get_value_forPaolo Bonzini
The two methods are identical. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-09-04gnome: Add missing install tag for vapi .deps fileThomas Mühlbacher
2025-08-20Revert "gnome: support generate_gir on cross builds"Jussi Pakkanen
This reverts commit 5e627c9b421a4cebb0e112af6a432fec66640c28.
2025-08-17gnome: Restore dependency of g-ir-scanner on gobject-introspectionL. E. Segovia
g-ir-scanner is a pair of Python script + pymod, and the latter must be available at any time the script is executed. The changes in the below commit removed the ordering guarantee, breaking GStreamer introspection building on Windows when using the monorepo. This reverts commit ab57be75148c2faac67dba7877167772410ca5ef. Fixes #14908
2025-08-01move rpath functions from Backend to BuildTargetCharles Brunet
It is more logical, since those functions depend on a build target, and do not require anything specific to the backend. Furthermore, it will allow us to call determine_rpath_dirs from the linker in a following commit, without the need to depend on the backend.
2025-08-01gnome: make ToolType an alias and use itFlorian "sp1rit"​
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2025-08-01gnome: early exit from _gir_has_option if g-ir-scanner is executableFlorian "sp1rit"​
_gir_has_option runs g-ir-scanner --help | grep <option> to determine if the current version of g-ir-scanner supports a particular option. This already early exists if g-ir-scanner is a OverrideProgram, as it cannot be executed if it is (technically OverridePrograms can actually be executed during configure time, but not g-ir-scanner; as it depends on native modules). Do the same in case g-ir-scanner is an executable (it currently isn't but I might want to move it into one, as to avoid the rule-dependency issue with the aforementioned native module)
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-08-01gnome: Provide fallback for legacy gi-scanner without --versionFlorian "sp1rit"​
The --version argument was only added in g-ir-scanner 1.58, but the bionic ci still uses g-ir-scanner 1.56. Don't fail if that is the case and assume the version comparison is void.
2025-08-01gnome: Don't rely on gobject-introspection-1.0 anymoreFlorian "sp1rit"​
There isn't really any point in doing this, given that it doesn't provide any headers & libraries by itself and means projects that conditionally build introspection behind a feature only need to check for the existence of g-ir-scanner, not gobject-introspection-1.0 anymore.
2025-06-21gnome.generate_gir: Use rspfiles on Windows when possibleL. E. Segovia
I ran into GStreamer's CI being overwhelmed by a 5k long command line to g-ir-scanner. This will help bypass the limitation. See https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/532 See #6710
2025-06-09modules/gnome: Allow to generate markdown and reStructuredText dbus docCorentin Noël
gdbus-docgen supports reStructuredText output since 2.71.1 and markdown since 2.75.2, allow to simply generate it.
2025-05-23gnome: initialize CFLAGS environment variable to linker argumentsPaolo Bonzini
The CFLAGS environment variable is used for g-ir-scanner's linking pass, It is emptied since commit 237513dff ("modules/gnome, modules/Python: Allow injecting RPATH flags through LDFLAGS if needed", 2025-04-09); which could even be considered a bugfix if it didn't break Fedora quite badly. I could not write a testcase, but the culprit seems to be the -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 that Fedora places in CFLAGS. The file contains *cc1_options: + %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} and the lack of -fPIE option upsets the linker. Fix by priming the contents of the CFLAGS variable with the c_link_args being used for the build. Fixes: #14631 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-23gnome: fix typo in creating gir flagsPaolo Bonzini
Append to scan_env_ldflags instead of overwriting it. Fixes: #14631 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-22gnome.mkenums: Use rspfiles on Windows when possibleL. E. Segovia
Fixes #6710
2025-04-09modules/gnome, modules/Python: Allow injecting RPATH flags through LDFLAGS ↵L. E. Segovia
if needed Fixes communicating the RPATH to g-i-scanner in macOS. See #14169
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-03-09compilers: convert `b_sanitize` to a free-form array optionPatrick Steinhardt
In the preceding commit we have started to perform compiler checks for the value of `b_sanitize`, which allows us to detect sanitizers that aren't supported by the compiler toolchain. But we haven't yet loosened the option itself to accept arbitrary values, so until now it's still only possible to pass sanitizer combinations known by Meson, which is quite restrictive. Lift that restriction by adapting the `b_sanitize` option to become a free-form array. Like this, users can pass whatever combination of comma-separated sanitizers to Meson, which will then figure out whether that combination is supported via the compiler checks. This lifts a couple of restrictions and makes the supporting infrastructure way more future proof. A couple of notes regarding backwards compatibility: - All previous values of `b_sanitize` will remain valid as the syntax for free-form array values and valid combo choices is the same. We also treat 'none' specially so that we know to convert it into an empty array. - Even though the option has been converted into a free-form array, callers of `get_option('b_sanitize')` continue to get a string as value. We may eventually want to introduce a kwarg to alter this behaviour, but for now it is expected to be good enough for most use cases. Fixes #8283 Fixes #7761 Fixes #5154 Fixes #1582 Co-authored-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Patrick Steinhardt <ps@pks.im>
2025-03-01modules/gnome: Allow to specify the doc-format argumentCorentin Noël
Add the support for the doc-format argument if g-ir-scanner supports it. Ignore the argument otherwise as this is a no-op in such cases.
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2024-09-04modules/gnome: Make 'gnome.yelp()' install actual media with symlinkssid
In cases, when localized media files are provided by some languages, we need to use 'gnome.yelp ()' with 'symlink_media: false' which copies all files from 'C' locale in addition to the localized media. This wastes storage space. The alternative is to use 'symlink_media: true' which symlinks entirely to 'C' media files ignoring localized media files. As a middle ground, if the localized media file exists in the source tree for a language, we use that file rather than symlinking to 'C' media with the same filename even when 'symlink_media: true'. This saves storage space. If there are no localized media files in non-C language, the existing behaviour is maintained.
2024-07-19modules/gnome: gnome.compile_resources() must have 'install_dir' if installingRaviRahar
Since they do not implement a default install dir like BuildTargets do. gnome.compile_resources() would result in an unhandled python exception when missing install_dir argument together with providing following arguments: gresource_bundle: true install: true closes: https://github.com/mesonbuild/meson/issues/13447 Signed-off-by: RaviRahar <ravirahar33@gmail.com>
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen
2024-05-19pylint: fix false positive for variable defined in different copies of ↵Eli Schwartz
conditional We do: ``` if is_thing: assignme = value if_is_thing: ... else: assignme = [] ``` It is always defined on both sides, but there was no particular reason we had to assign it in the later copy. pylint reported it as a false positive, and it may prove confusing in general, and it's harmless to move, so do so.
2024-04-23Pass --quiet to glib-genmarshalTristan Partin
No need to spam about reading the input file. Fixes: #13119
2024-04-08gnome: Fix indentation of mkenums_simple generated codeMatthijs Velsink
Commit 83facb39593fbfa4d9cd68e86f5f56f86f1fe1eb switched to using `textwrap.dedent` for the code templates for `gnome.mkenums_simple`. That changed indentation, however, making the generated code harder to understand. We improve this by properly indenting the multiline strings before dedenting them. For optional parameters `decl_decorator` and `header_prefix`, we add a newline if they are set to keep separation between generated code blocks.
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-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-10-04interpreter: rename SOURCE_KW to DEPENDENCY_SOURCES_KWDylan Baker
Since that's what this actually is.
2023-09-18pkgconfig: Set PKG_CONFIG in env for devenv and g-ir-scannerXavier Claessens
2023-09-09gnome.mkenum_simple(): Fix include path when header is in subdirXavier Claessens
It was generating #include with the basename of every header file. That assumes that every directory where there are headers are also included into search path when compiling the .c file. Change to use path relative to current subdir, which can be both in build or source directory. That means that we assume that when the .c file is compiled, the target has a include_directories pointing to the directory where gnome.mkenum_simple() has been called, which is generally '.' and added automatically. Also fix type annotation to only allow str and File sources, other types have never been working, it would require to iterate over custom target outputs, etc. Fixes: #7582
2023-09-07gnome: Fix glib tool lookup consistencyXavier Claessens
It was not always using the pkg-config file.
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-18Add more descriptive description to CustomTargetCharles Brunet
Allow modules using CustomTarget to modify the command description used by ninja backend. This result in more precise logs when building a project.
2023-08-03PkgConfigDependency: Move CLI handling into its own abstractionXavier Claessens
This makes the code cleaner and will allow to have other implementations in the future.
2023-07-19avoid module indirection in name resolution for imported objectsEli Schwartz
We already import a bunch of objects directly from ..build but don't use them nearly as much as we can. This resulted both in longer lines and s minor performance difference since python has to resolve the name binding the long way. There's no reason not to rewrite these names to use the direct imports. Found while investigating the fact that Executable was imported but never used. It's easier to just use it.
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-07-19add better comments for mypy suppressionsEli Schwartz