aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
AgeCommit message (Collapse)AuthorFilesLines
2021-05-12gnome: Fix gtkdoc generationXavier Claessens1-8/+7
install_scripts used to replace @BUILD_ROOT@ and @SOURCE_ROOT@ but it was not documented and got removed in Meson 0.58.0. gnome.gtkdoc() was relying on that behaviour, but it has always been broken in the case the source or build directory contains spaces. Fix this by changing get_include_args() to substitue paths directly which will then get escaped correctly. Add a unit test that builds GObject documentation which is where this issue has been spotted. Fixes: #8744
2021-05-08gnome: improve dependency lookup of G-IRoss Burton1-4/+4
Cross-compiling and generating gobject-introspection isn't trivial, but with wrapper scripts that call qemu-user it's perfectly doable[1]. Currently looking up the gobject-introspection pkgconfig is done as a native dependency, which means in cross-compilation environments this is not the right paths (wrong library path, for example). Solve this by generalisiing _get_native_dep() to _get_dep(native) and asking for the host gobject-introspection instead. [1] https://git.yoctoproject.org/cgit.cgi/poky/tree/meta/recipes-gnome/gobject-introspection/
2021-03-23devenv: Set GI_TYPELIB_PATH and LD_LIBRARY_PATH (#8548)Xavier Claessens1-5/+14
2021-03-19Move OverrideProgram to programsDylan Baker1-2/+2
2021-03-19split program related classes and functions out of dependenciesDylan Baker1-1/+2
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-17/+17
performed by running "pyupgrade --py36-plus" and committing the results
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens1-1/+1
By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen1-4/+4
run_target: Add env kwarg
2021-02-05run_target: Add env kwargXavier Claessens1-4/+4
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-02-05gnome: Add post_install() methodXavier Claessens1-18/+67
Various GNOME projects have scripts that does similar task, better do it directly in meson. This ensures it's done correctly regarding usage of subprojects and pkg-config. See for example this gtk bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/3626. Fixes: #8268
2021-01-30Fix executable as script on WindowsXavier Claessens1-2/+2
On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
2021-01-13build/interperter: Add annotations and move input validation to interpreterDylan Baker1-1/+1
This moves the user input validation to the interpreter, instead of being in the build module, and adds type annotations.
2021-01-04Use a single coredata dictionary for optionsDylan Baker1-6/+6
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2021-01-04use OptionKey for builtin and base optionsDylan Baker1-5/+9
I would have prefered to do these seperatately, but they are combined in some cases, so it was much easier to convert them together. this eliminates the builtins_per_machine dict, as it's duplicated with the OptionKey's machine parameter.
2020-11-17gnome: Drop use of volatile in GLib type functionsPhilip Withnall1-1/+1
See https://gitlab.gnome.org/GNOME/glib/-/issues/600 `volatile` was previously mistakenly used in GLib to indicate that a variable was accessed atomically or otherwise multi-threaded. It’s not meant for that, and up to date compilers (like gcc-11) will rightly warn about it. Drop the `volatile` qualifiers. Based on a patch by Jeff Law. See also http://isvolatileusefulwiththreads.in/c/. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-13gnome: Handle libraries that are not in the current build dirSam Thursfield1-5/+6
The generate_gir() function previously assumed all library inputs were in the current build dir. This would fail if they weren't.
2020-11-01gnome: Tweak error messageSam Thursfield1-1/+2
It's an easy mistake to do this: gir1 = gnome.generate_gir(...) gir2 = gnome.generate_gir(... includes: ['GObject-2.0', gir1]) This fails with an error: ERROR: Gir includes must be str, GirTarget, or list of them. The issue is that the 'gir1[0]' should be passed instead of 'gir1'. To make the problem slightly clearly, tweak the error message to be: ERROR: Gir includes must be str, GirTarget, or list of them. Got TypelibTarget.
2020-10-17Fix gnome.compile_resources() when glib is a subprojectXavier Claessens1-33/+38
When glib is a subproject we should use glib-compile-resources it overrides using find_program() in the case it is not installed on the build machine. With old glib version we have to run glib-compile-resources at configure time to generate the list of dependencies, but not when glib is recent enough.
2020-10-15gnome: generate cpp gresource source in cpp projectsmimi899991-2/+8
Closes #7839
2020-06-16Update mesonbuild/modules/gnome.pyXavier Claessens1-1/+1
Co-authored-by: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
2020-06-16Update mesonbuild/modules/gnome.pyXavier Claessens1-1/+1
Co-authored-by: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
2020-06-16gnome: Add fatal_warnings kwarg to generate_gir()Xavier Claessens1-2/+11
Fixes: #7130
2020-05-14interpreter: Replace some uses of mlog.deprecation with FeatureDeprecatedDylan Baker1-6/+3
This gives the version that the feature was deprecated in, and doesn't print the warning if the project supports versions of meson in which the project wasn't deprecated.
2020-05-14gnome.generate_gir: Fix missing include directoriesXavier Claessens1-6/+4
This revert a part of #7020 because it was using gir_inc_dirs before it is set. Properly fix typelib_includes instead that was working only when g-i is a pkgconfig dependency.
2020-05-07Allow overriding g-ir-scanner and g-ir-compiler binaries.James Hilliard1-2/+10
This is useful when one needs to force meson to use wrappers for cross compilation. Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-04-30gnome: Print proper error when 'nsversion' or 'namespace' are missingXavier Claessens1-2/+6
2020-04-28gnome: Fix usage of gobject-introspection as subprojectXavier Claessens1-59/+37
2020-03-29Report an errror if glib-compile-resources is missingJon Turney1-1/+4
Produce a diagnostic if we try to use gnome.compile_resources() when glib-compile-resources isn't present, rather than a python backtrace.
2020-03-23gtkdoc: Add missing permitted kwargXavier Claessens1-1/+1
The 'check' kwarg was added in Meson 0.52.0.
2020-03-05Make use of unholderDylan Baker1-28/+11
We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
2020-03-05remove ability to pass multiple keys to extract_as_listDylan Baker1-1/+1
This makes the typing annotations basically impossible to get right, but if we only have one key then it's easy. Fortunately python provides comprehensions, so we don't even need the ability to pass multiple keys, we can just [extract_as_list(kwargs, c) for c in ('a', 'b', 'c')] and get the same result.
2020-03-05Remove some uses of mesonlib.run_onceDylan Baker1-2/+2
These are basically doing what mlog.log(..., once=True) does, so lets just use that. The once argument to mlog is newer, so these probably should have been changed already.
2020-03-05mesonlib: Replace unholder argument to listifyDylan Baker1-3/+3
listify shouldn't be unholdering, it's a function to turn scalar values into lists, or flatten lists. Having a separate function is clearer, easier to understand, and can be run recursively if necessary.
2020-02-26mesonbuild/modules/gnome.py: Fix giscanner and gicompiler logicAdam Duskett1-0/+4
Currently, giscanner and the gicompiler paths are only scanned via pkg-config if they are first found in the host path. Add a else statement to fix this oversite.
2020-02-25gobject-introspection: determine g-ir-scanner and g-ir-compiler paths from ↔Adam Duskett1-3/+18
pkgconfig Currently, meson hard codes the paths of these binaries which results in cross-compiled environments to run the host versions of these tools. However, GObject-introspection provides the appropriate paths to these utilities via pkg-config find_program is needed in the case g-i is built as a subproject. If g-ir-scanner or g-ir-compiler are in the build or source directory use those. If they aren't found in the source directory, use the results from pkg-config.
2020-01-09dependencies: Add ability to set arbitrary variables onDylan Baker1-1/+1
declare_dependencies This allows dependencies declared in subprojects to set variables, and for those variables to be accessed via the get_variable method, just like those from pkg-config and cmake. This makes it easier to use projects from subprojects in a polymorphic manner, lowering the distinction between a subproject and an external dependency every further.
2019-11-06Fix typos found by codespellWolfgang Stöggl1-1/+1
- Typos were found by codespell v1.16.0
2019-09-25Use functools cache instead of open-coded implementationZbigniew Jędrzejewski-Szmek1-11/+4
Functional behaviour is not identical, because the cache not set when an exception is thrown. I hope this doesn't matter in practice.
2019-09-25Drop unused variableZbigniew Jędrzejewski-Szmek1-1/+0
2019-09-25Add helper to print warnings onceZbigniew Jędrzejewski-Szmek1-16/+10
The helper is general, although in this patch it is only used for warnings. No functional change intended.
2019-09-05mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy1-6/+5
2019-08-17gnome: Handle overriden g-ir-scannerThibault Saunier1-2/+8
When g-ir-scanner is overriden, we can't call it at configure time but we know what options are avalaible (as it started using meson after checked options where added) so do not try to call it to retrieve the version as it will fail. Also see https://github.com/mesonbuild/meson/issues/3442
2019-08-13Revert "gnome: Use find_program() to get glib-compile-resources"Xavier Claessens1-5/+4
This reverts commit 0ab3d97566e8876532ecaf31b948a9ae3337b564.
2019-08-12gnome: Use find_program() to get glib-compile-resourcesXavier Claessens1-4/+5
GLib does not currently use override_find_program() for this tool because it is compiled and would not work in cross build. But this prepares Meson for when/if GLib will rewrite it in Python. See https://gitlab.gnome.org/GNOME/glib/issues/1859.
2019-08-04gtkdoc: Use find_program() to get gtkdoc toolsXavier Claessens1-0/+5
This will allow using gtk-doc as a subproject instead of having to install it on the system. It also has the side effect of failing at configuration time with a proper message if gtkdoc is not installed, instead of failing at build time with a python backtrace.
2019-07-23compilers: pull sanitzier args into compiler classesDylan Baker1-3/+2
This simplifies and cleans things up.
2019-07-16gtkdoc: Add 'check' kwarg (#5591)Xavier Claessens1-2/+19
* gtkdoc: Add 'check' kwarg This runs gtkdoc-check in meson tests. Also reorganize the gtkdoc test because we cannot reliably build multiple doc into the same directory. Not all files generated by gtk-doc are prefixed with the target name.
2019-06-27gnome.py: correctly pick the compiler for gtk-doc buildsAlexander Kanavin1-4/+1
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson1-1/+1
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-05-28gnome: make sure the target build directory is passed first for linkingChristoph Reiter1-8/+8
determine_rpath_dirs() can return paths to external dependencies not in the build dir and passing them first as a link path leads to g-ir-scanner for example linking against the already installed library instead of the just built one. This was reported in g-i: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/272 and comes up quite often when a library adds some new symbols which aren't present in the system library, which then makes linking fail. The first place where the order is changed is _scan_gir_targets(), which looks like an unintentional change in the refactoring in 8377ea45aa61efbe8e1a75b74 The second place in _get_link_args() has always been that way and only the rpath order is changed, but it looks to me as if the same rules should apply here too.