aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)AuthorFilesLines
2021-05-19interpreter: Add docstring and fix types of source_strings_to_filesDylan Baker1-3/+4
2021-05-18pkgconfig: Do not escape custom variablesXavier Claessens1-5/+13
We need to escape space in variables that gets into cflags or libs because otherwise we cannot split compiler args when paths contains spaces. But custom variables are unlikely to be path that gets used in cflags/libs, and escaping them cause regression in GStreamer that use space as separator in a list variable.
2021-05-12gnome: Fix gtkdoc generationXavier Claessens5-42/+39
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-08modules/fs: support FileOrString argumentsFlorian Fischer1-26/+46
With this change File objects created with the builtin files() function can be used with the fs submodule like normal strings. All methods that seem reasonable support FileOrSting arguments. For example fs.exists() still only takes str arguments because meson already ensures that File objects do exist when creating them with files(). Each user facing function of the fs module has an additional FeatureNew check when used with File objects. The test cases for fs are extended appropriately with tests for File objects.
2021-05-08interpreter: 'embed' kwarg is only valid in python moduleXavier Claessens1-1/+1
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-05-08Fix python exception thrown for invalid resource pathNellie Zhang1-1/+1
If an invalid resource path is specified, then an uncaught python exception occurs, and a backtrace is shown. Throw a MesonException instead to produce a cleaner error message.
2021-04-26Update CUDA Toolkit driver version table.Olexa Bilaniuk1-0/+2
2021-04-19pkgconfig: Add support for CustomTarget objects in generatorXavier Claessens1-6/+18
Fixes: #8618.
2021-04-18pkgconfig: Fix broken paths in -uninstalled.pc on WindowsXavier Claessens1-11/+6
Fixes: #8668
2021-04-12interpreter: Split permitted_kwargs dictXavier Claessens2-4/+4
2021-04-01interpreter: Move to its own folder and split itXavier Claessens3-5/+5
2021-03-26pkgconfig: Allow setting prefix in dataonly pc fileXavier Claessens1-2/+4
Some variables are reserved because meson set them automatically. But we are not setting them for dataonly pc files, so there is no reason to reserve them. Fixes: #8583.
2021-03-26modules/external_project: use typed_pos_argsDylan Baker1-9/+5
2021-03-24Merge pull request #8568 from dcbaker/submit/qt-dependency-factoryJussi Pakkanen1-11/+64
QT: use a proper dependency factory
2021-03-23Refactor Qt Dependency into proper split classes with factoriesDylan Baker1-13/+9
Currently the Qt Dependencies still use the old "combined" method for dependencies with multiple ways to be found. This is problematic as it means that `get_variable()` and friends don't work, as the dependency can't implement any of those methods. The correct solution is to make use of multiple Dependency instances, and a factory to tie them together. This does that. To handle QMake, I've leveraged the existing config-tool mechanism, which allows us to save a good deal of code, and use well tested code instead of rolling more of our own code. The one thing this doesn't do, but we probably should, is expose the macOS ExtraFrameworks directly, instead of forcing them to be found through QMake. That is a problem for another series, and someone who cares more about macOS than I do.
2021-03-23devenv: Set GI_TYPELIB_PATH and LD_LIBRARY_PATH (#8548)Xavier Claessens1-5/+14
2021-03-22qt: move compilers_detect to the qt moduleDylan Baker1-2/+59
It's a method on the QtDependeny that exists purely for the consumption of the qt module (in the form, return some stuff the module makes into an instance variable). So put it where it actually belongs, and pass the qt dependency into it.
2021-03-19Move OverrideProgram to programsDylan Baker1-2/+2
2021-03-19split program related classes and functions out of dependenciesDylan Baker9-16/+19
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-16externalproject: Flatten configure_options kwargXavier Claessens1-8/+11
2021-03-16externalproject: Do not add --includedir by defaultXavier Claessens1-1/+3
Some projects (e.g. OpenSSL) does not support setting include directory at all.
2021-03-16externalproject: Fix error when used from main projectXavier Claessens1-1/+1
2021-03-05Port CUDA module to new API.Olexa Bilaniuk1-11/+23
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz14-81/+81
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz5-8/+8
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-03-04Simplify module APIXavier Claessens4-16/+54
- ModuleState is now a real class that will have methods in the future for actions modules needs, instead of using interpreter internal API. - New ModuleObject base class, similar to InterpreterObject, that should be used by all objects returned by modules. Its methods gets the ModuleState passed as first argument. It has a `methods` dictionary to define what is public API that can be called from build definition. - Method return value is not required to be a ModuleReturnValue any more, it can be any type that interpreter can holderify, including ModuleObject. - Legacy module API is maintained until we port all modules. In the future modules should be updated: - Use methods dict. - Remove snippets. - Custom objects returned by modules should all be subclass of ModuleObject to get the state iface in their methods. - Modules should never call into interpreter directly and instead state object should have wrapper API. - Stop using ModuleReturnValue in methods that just return simple objects like strings. Possibly remove ModuleReturnValue completely since all objects that needs to be processed by interpreter (e.g. CustomTarget) should be created through ModuleState API.
2021-03-03pkgconfig: Add missing permitted kwargsXavier Claessens1-1/+1
Fixes #8462
2021-03-02exernal_project: Fix default cross compile parametersLeif Middelschulte1-1/+1
The variable `{host}` cannot be successfully expanded. Using the `@HOST@` parameter, as suggested by the documentation, works.
2021-02-27install_man locale supportJason Woodward1-1/+4
Rather than having to manually build the locale aware man paths with `install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')` Support doing `install_man('foo.fr.1', locale: 'fr')`
2021-02-26modules/fs: Use typed_pos_argsDylan Baker1-75/+40
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens4-7/+8
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-16CUDA Toolkit 11.2.1 has been released, update version tableOlexa Bilaniuk1-1/+2
Strangely, the minimum version of CUDA Toolkit 11.2.0 has also been updated - downwards. We pick up this change as well.
2021-02-07Add Qt6 moduleLuca Weiss2-2/+28
2021-02-07Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen1-3/+77
Add a wrapper to the rust module for bindgen
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen2-7/+7
run_target: Add env kwarg
2021-02-06rust: Add a module wrapper for bindgenDylan Baker1-3/+77
This has a couple of advantages over rolling it by hand: 1. it correctly handles include_directories objects, which is always handy 2. it correctly generates a depfile for you, which makes it more reliable 3. it requires less typing
2021-02-06modules/rust: use typed_pos_argsDylan Baker1-10/+5
2021-02-05run_target: Add env kwargXavier Claessens2-7/+7
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-02-04Introduce `fs.read` to read a file as a stringLuke Drummond1-1/+64
Following #7890, this patch introduces the ability to read the contents of a file to the fs module. This patch introduces the ability to read files at configure time, but has some restrictions: - binary files are not supported (I don't think this will prove a problem, and if people are wanting to do something with binary files, they should probably be shelling out to their own script). - Only files outside the build directory allowed. This limitation should prevent build loops. Given that reading an arbitrary file at configure time can affect the configuration in almost arbitrary ways, meson should force a reconfigure when the given file changes. This is non-configurable, but this can easily be changed with a future keyword argument.
2021-02-02Quick update of table of CUDA Toolkit vs. NVIDIA driver versions.Olexa Bilaniuk1-0/+2
2021-01-30Merge pull request #8264 from xclaesse/ep-miscJussi Pakkanen1-14/+19
external_project: misc improvements
2021-01-30Fix executable as script on WindowsXavier Claessens3-9/+4
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-29external_project: Add default configure optionsXavier Claessens1-12/+12
2021-01-29external_project: Do not set LD in the envXavier Claessens1-1/+4
This was breaking some autotools projects such as libyaml.
2021-01-29external_project: Improve loggingXavier Claessens1-1/+3
Write output of 'make' and 'make install' into log files as well when not verbose.
2021-01-20external_project: Log configure commandXavier Claessens1-0/+4
2021-01-19Replace NinjaBackend is_rust_target with build.uses_rustDylan Baker1-1/+1
we have two functions to do the exact same thing, and they're basically implemented the same way. Instead, let's just use the BuildTarget one, as it's more generally available.
2021-01-17external_project: Write output in log files when not verboseXavier Claessens1-2/+7