What is actually defined here varies wildly on different python-versions
for different platforms.
On my python2.7 on Windows len(sysconfig.get_config_vars()) returns 17,
whereas in my Ubuntu that number is 517!
Hence it is useful to be able to check which keys are available, as
well as allowing specifying a default option.
* gnome: If pkg-config is not found, assume glib is 2.0
Checking the pkg-config file to confirm tool versions is a hack, and
should eventually be replaced with checking the actual versions of the
tools.
* gnome: Actually assume glib version is 2.54 if not found
It is actually not possible to build most projects with the GNOME
module if your glib is older, particularly genmarshal and
gdbus-codegen generate unusable output without newer arguments that
were added for Meson.
The fix for Requires generation in #3406 missed a second code path with the same
problem.
Passing a pkgconfig dependency to requires would produce Q, t, 5, C, o,r, e'
instead of 'Qt5Core'.
This was introduced in 8efd940.
The `install` parameter that is present in the `permittedKwargs`
annotation is wrong. The correct parameter name, which is also
consistent with the rest of functions in the `gnome` module, is
`install_dir`.
Previously pkg-config files generated by the pkgconfig modules for static libraries
with dependencies could only be used in a dependencies with `static: true`.
This was caused by the dependencies only appearing in Libs.private even
if they are needed in the default linking mode. But a user of a
dependency should not have to know if the default linking mode is static
or dynamic; A dependency('somelib') call should always pull in all
needed pieces into the build.
Now for meson build static libraries passed via `libraries` to the generate
method automatically promote dependencies to public.
The `ct` variable used in the ModuleReturnValue is created only for
versions earlier than 2.55.2. However, in newer versions that
variable does not exist.
The development version of `glib` (2.55.2) has acquired support for
generating gdbus header and source code files separately. This
allows dependencies to be more fine grained on those targets
depending only on the header.
* Never install the glib-mkenums generated C source
When using gnome.mkenums_simple() we end up installing the generated
C source file alongside the C header file, if `install_header` is set
to True. This is caused by mkenums_simple() acting as a wrapper for
mkenums() without template files; mkenums() won't be able to know if
we're generating the header or the source, and will use the presence
of `install_header` as the deciding factor as to whether the generated
file should be installed.
When generating the C source file, we should always unset the
`install_header` option to False, just like mkenums() expects.
Closes#3373
* Verify that mkenums_simple() does not install C sources
When asked to installed the generated C header file.
Since relative path in qrc files are always relative to qrc file
itself then we just need to check that normpath(qrc file + resource)
doesn't start with build dir path, this would mean that the resource is
generated.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
When several qrc files are given all qrc files dependencies were mixed.
Fixed non working use case:
When user try to guess build dir layout and add use a relative
path between a generated qrc file and a generated resource.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
It is weird and inconsistent to have different pc file depending on
default_library value when using library() or build_target(). We should
skip dependencies only when user explicitly want shared library only.
In order to handle generated resources embedded in qrc file, we
need to be able to detect if files pointed from qrc are in build
directory or not.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Whilst working on the Reproducible Builds effort [0], we noticed
that meson creates non-reproducible pkgconfig files as it relies
on Python set ordering.
This was originally filed in Debian as #892515 [1].
[0] https://reproducible-builds.org/
[1] https://bugs.debian.org/892515
$ flake8 | grep -E 'F841'
./run_unittests.py:1987:13: F841 local variable 'objc' is assigned to but never used
./run_unittests.py:1988:13: F841 local variable 'objcpp' is assigned to but never used
./mesonbuild/minit.py:272:5: F841 local variable 'uppercase_token' is assigned to but never used
./mesonbuild/minit.py:307:5: F841 local variable 'uppercase_token' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:36:9: F841 local variable 'result' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:78:9: F841 local variable 'up_target' is assigned to but never used
./mesonbuild/modules/unstable_icestorm.py:81:9: F841 local variable 'time_target' is assigned to but never used
./msi/createmsi.py:226:17: F841 local variable 'file_source' is assigned to but never used