aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
AgeCommit message (Collapse)AuthorFilesLines
2021-10-28modules/gnome: use `install_dir = []` instead of falseDylan Baker1-1/+1
2021-10-28modules/gnome: fix missing install_dir, again, harderDylan Baker1-8/+10
It turns out this could be missing in GResource*Target as well, due mostly to the same problem, side effects of mutating a shared dictionary; though it could also happen with a specific set of keywords given and other omitted. Fixes #9350
2021-10-27modules/gnome: ensure that `install_dir` is setDylan Baker1-8/+14
The `mkenums` functions can have this unset if, and only if, the c file only variant is called. Due to side effects if the header file is generated then `install_dir` is ensured to be set for the c file. I have removed this side effect so that our tests actually cover this case. Fixes #9472
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-2/+2
2021-10-08modules/gnome: Fix unset install_dirDylan Baker1-3/+2
install_dir needs to be set to something, because CustomTarget expects that. genmarshal still relies on CustomTarget setting it internally itself. Fixes #9350
2021-10-08modules/gnome: Fix case that could never be hit due to bad typesDylan Baker1-3/+3
It's impossible to get a Holder here, we'd get the unholdered build types. Mypy points this out for us.
2021-10-08modules/gnome: fix use of undefined variableDylan Baker1-1/+1
Theere is no 'output' key in the kwargs, so if this was it it would result in an exception. Mypy spotted this in a branch I'm working on full typing for gnome, but since that seems unlikely to be done before the 0.60 branchpoint I'd like to get this in sooner
2021-10-07modules/gnome: deprecate yelp variadic sourcesDylan Baker1-1/+7
Yelp currently can take sources two different ways, the first is via variadic arguments, the second is by a keyword argument. If the keyword is passed then the variadic arguments are silently ignored, which is obviously not ideal. Fortunately the variadic form was never documented, and is likely not in wide use. This patch fixes it by deprecating the variadic form, and warning if both are passed. It does not change behavior as someone may be relying on it.
2021-10-04f-stringsEli Schwartz1-21/+19
2021-10-04various python neatness cleanupsEli Schwartz1-1/+1
All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles.
2021-09-06mintro: add installed_planFilipe Laíns1-1/+1
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-08-29gnome: Prepend devenv, not appendTing-Wei Lan1-4/+4
Otherwise, if these environment variables already exist, they will override values we set for the developer environment.
2021-08-23gnome: don't let fortify defines into the g-ir-scanner after stripping -OEli Schwartz1-1/+3
The tool needs to run the preprocessor (but does not actually produce compiled outputs), and meanwhile ignores lots of flags it doesn't think it needs. In the case of -D_FORTIFY_SOURCE=... this is only valid if -O is there too, but otherwise spits out confusing warnings. The warnings are spurious and can be safely ignored, but in this case let's go the extra mile and fix g-ir-scanner's upstream bug by removing the fortify flag first. Fixes #9161
2021-08-17Add install tagsXavier Claessens1-1/+3
Fixes: #7007.
2021-08-09gnome: Filter all compiler and linker flagsEmmanuele Bassi1-7/+13
When sending them to the introspection scanner, we must always filter all compiler and linker flags, because g-ir-scanner does not accept any random argument but only a specific subset. Fixes: #8876
2021-08-06modules: Add API to add testXavier Claessens1-4/+2
This fix kwargs not going through typed_kwargs() decorator that sets defaults. Fixes: #9009
2021-07-18gnome: Always pass absolute -L paths to g-ir-scannerNirbheek Chauhan1-2/+6
g-ir-scanner does not convert relative -L paths to runtime paths which are added to -Wl,-rpath and LD_LIBRARY_PATH / DYLD_LIBRARY_PATH / PATH. This means that the local library will either not be found at runtime (while building introspection data), or the system-wide library will be picked instead. See: giscanner/ccompiler.py:get_internal_link_flags() in gobject-introspection for more details.
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger1-1/+1
2021-06-26refactor: Refactor BothLibraries logicDaniel Mensinger1-2/+0
This commit introduces a new type of `HoldableObject`: The `SecondLevelHolder`. The primary purpose of this class is to handle cases where two (or more) `HoldableObject`s are stored at the same time (with one default object). The best (and currently only) example here is the `BothLibraries` class.
2021-06-23gnome: add update_desktop_database to post_install()Xavier Claessens1-4/+18
2021-06-23gnome: Set GSETTINGS_SCHEMA_DIR in devenvXavier Claessens1-0/+1
2021-06-22fix: Handling BothLibraries objects (fixes #8907)Daniel Mensinger1-1/+3
2021-06-18holders: remove unholderDaniel Mensinger1-35/+35
2021-06-02add a couple more type annotationsDylan Baker1-1/+1
2021-05-28modules: Replace find_program_impl() by state.find_program()Xavier Claessens1-10/+10
2021-05-28modules: Add methods dict everywhereXavier Claessens1-0/+14
This fix calling random internal methods from meson.build as long as they were not prefixed by underscore.
2021-05-28modules: Stop using ModuleReturnValue where it's not neededXavier Claessens1-1/+1
It is only needed in functions that need to add targets to the interpreter.
2021-05-28modules/gnome: Correctly handle generated sources for generate_girDylan Baker1-6/+12
We need to pass any generated sources down the CustomTarget inititalizers so that they will generate a dependency correctly, otherwise we get race conditions.
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