Commit Graph

404 Commits

Author SHA1 Message Date
Xavier Claessens b3f74b9c3a Windows: Fix exception when windres is not found
If rescomp is not found its command is None and that make meson print
backtrace instead of displaying the error message.
2018-05-21 23:29:06 +03:00
Nirbheek Chauhan 86cc4f2707 gdbus_codegen: Guess the output list for docbook generation
We were setting it to a file list that would always be wrong, and
always out of date since it would never exist.

However, the output list is not predictable. It usually has a 1-1
relationship with the input XML files, but it may not.

This must be fixed later with API for users to provide the output
names.

See: https://github.com/mesonbuild/meson/pull/3539
2018-05-09 21:04:55 +05:30
Nirbheek Chauhan 7ca2b8caca gtkdoc: Fix typo that made xml_files an array of arrays 2018-05-09 21:04:19 +05:30
Nirbheek Chauhan c1f275bfa6 gnome.gtkdoc: Allow passing file objects as xml_files
If we pass a source files() object, we will look for it in the build
directory, which is wrong. If we pass a build files() object (from
configure_file()), we will find it in the build directory, and then
try to copy it on top of itself in gtkdochelper.py getting a
SameFileError.

Add a test for it, and also properly iterate custom target outputs
when adding to content files.
2018-05-06 20:25:16 +05:30
Nirbheek Chauhan c5865c50c4 gnome: Use the header basename for #include in mkenums_simple
Otherwise, when you use a File target, the value will be the full path
to the header from the build root, which is not what anyone wants.
2018-05-05 17:33:29 +02:00
Nirbheek Chauhan 45aa57f660 gnome: Update minimum glib version for gdbus-codegen
The fix has landed upstream, and will be in the next glib stable
release. I have verified that it fixes the problem described in #3488
and that the 'frameworks/7 gnome' test passes now.
2018-05-05 11:36:46 +03:00
Nirbheek Chauhan 2e0485bb9b gnome: Disable usage of new --body and --header args
The new --body and --header args are broken because they do not allow
the use of --output-directory to set the correct `#include "foo.h"`
line in `foo.c`. The changes in the gdbus test case show this.

Disabled till this can be fixed in glib.

Closes https://github.com/mesonbuild/meson/issues/3488
2018-05-04 23:00:23 +03:00
Mathieu Duponchelle f1c92d7c9c Interpreter: don't flatten the arguments of various methods
this fixes eg set_variable('foo', ['bar', 'baz']), which
was previously erroring out complaining about the number
of arguments.

Closes #1481
2018-05-04 15:24:21 +00:00
Mathieu Duponchelle 8bda86faab python module: make it work with pypy
pypy installations don't usuallyy ship with pkg-config files,
we thus need to replicate what their version of distutils does.

In addition, we also try our best to build against other
pythons that do not have pkg-config files.
2018-05-03 18:50:40 +05:30
Nirbheek Chauhan badbfa125c pkgconfig: Don't expose internal libraries in .pc files
Libraries that have been linked with link_whole: are internal
implementation details and should never be exposed to the outside
world in either Libs: or Libs.private:

Closes https://github.com/mesonbuild/meson/issues/3509
2018-05-02 11:46:47 +00:00
Jussi Pakkanen 2b5766980b Keep separator spaces in pkg-config declarations. Closes #3479. 2018-05-02 11:46:47 +00:00
Jussi Pakkanen ccaf5711cd Install generated gdbus header with old glib version too. 2018-04-28 00:19:29 +03:00
Havard Graff 14db3861d8 modules/python: add some more options around path and config_vars
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.
2018-04-21 19:50:53 +02:00
Nirbheek Chauhan 74404db469 gnome: If pkg-config is not found, assume glib is 2.54 (#3443)
* 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.
2018-04-21 17:05:31 +03:00
Nirbheek Chauhan b5c919ebfe gnome: gdbus-codegen add a `sources:` kwarg
It accepts multiple XML files, not just one. For example, glib uses
it that way.
2018-04-20 18:24:18 +00:00
Martin Hostettler 247b1a598a regression: pkgconfig module: Fix Fix regression in Requires.private generation.
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.
2018-04-20 00:59:06 +03:00
Iñigo Martínez a52543cd1e gdbus_codegen: Fix install_dir parameter
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`.
2018-04-18 21:15:52 +03:00
Jussi Pakkanen 9790f2d500 Made Python module match the new init interface. 2018-04-18 00:20:52 +03:00
Jussi Pakkanen 3fc1ca8687
Merge pull request #3240 from MathieuDuponchelle/python_module
Implement a generic python module
2018-04-17 23:17:43 +03:00
Jussi Pakkanen 0e00470d8c
Merge pull request #3218 from mesonbuild/findoverrider
Make it possible to override find_program [skip ci]
2018-04-16 22:22:02 +03:00
Jussi Pakkanen 86f725c1e5
Merge pull request #3115 from makise-homura/e2k-lcc-support
Support lcc compiler for e2k (Elbrus) architecture
2018-04-15 17:18:44 +03:00
Nirbheek Chauhan 6cdd14fc4e find_program: Don't spam when called from a module
The user doesn't need to know whether or not the program was found,
especially not when it's spammed for every gnome.foo() function
2018-04-15 14:13:35 +05:30
Jussi Pakkanen 998892ed29 Updated all modules to work with the new API. 2018-04-15 13:32:38 +05:30
Jussi Pakkanen bdb57cf62a Convert Gnome module to use find_program from interpreter. 2018-04-15 13:32:38 +05:30
Martin Hostettler 3f7c6cf3d6 Improve generation of pkg-config files for static only libraries.
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.
2018-04-14 23:43:29 +03:00
Jussi Pakkanen 2a70327f1d
Merge pull request #2930 from inigomartinez/gdbus-targets
gnome: Split header and code targets in gdbus_codegen()
2018-04-14 22:35:01 +03:00
textshell 0535f38af9 pkgconfig module: Fix regression that Requires.private is generated as 'Q, t, 5, C, o, r, e' instead of Qt5Core. (#3406) 2018-04-14 21:57:12 +03:00
Iñigo Martínez 435cd8c922 gdbus_codegen: Fix new generated objects
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.
2018-04-12 08:18:07 +02:00
Iñigo Martínez e656b9c819 gdbus_codegen: Fix custom target name
The namebase which is used as the target name, also holds part of
the file names. This used in combination generates files with wrong
names.
2018-04-12 08:10:13 +02:00
Nirbheek Chauhan d7b401f7d7 gdbus_codegen: Return 2 targets when docbook is disabled
Also document this behaviour, test it, and fix the return value from
the module -- we create one target and return it thrice to the build
file
2018-04-11 21:30:47 +05:30
Iñigo Martínez b2636ceef9 gnome: Validate docbook parameter is a string
The `docbook` parameter used in `gdbus_codegen` should contain
the prefix string in `PREFIX-NAME.xml`. Therefore it has to be
validated as a string.
2018-04-11 17:22:20 +02:00
Iñigo Martínez 351b59f03a gnome: Split header and code targets in gdbus_codegen()
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.
2018-04-11 17:22:12 +02:00
Emmanuele Bassi e103675a39 Never install the glib-mkenums generated C source (#3374)
* 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.
2018-04-09 23:35:57 +03:00
Mathieu Duponchelle c3bc7873e9 [fixup]: various minor tweaks found while documenting 2018-04-09 15:46:06 +02:00
Mathieu Duponchelle 33abe0cf55 [fixup]: Rename find to find_installation 2018-04-09 15:43:25 +02:00
Mathieu Duponchelle dce770c0a7 [fixup]: Fix python2 detection and unit test 2018-04-09 02:06:22 +02:00
Jussi Pakkanen 269db40445
Merge pull request #3326 from jeandet/generated_qrc
[Qt module] Add File object support for generated or not qrc files
2018-04-08 18:42:24 +03:00
Xavier Claessens da0f0f02e5 pkgconfig generator: Remove duplicates in required versions 2018-04-07 21:35:47 -04:00
Xavier Claessens 142f51a7b5 pkgconfig generator: Fix crash when passing a SharedModule 2018-04-06 21:05:53 -04:00
Mathieu Duponchelle 5b13742ff4 [fixup]: trivial fix after rebase 2018-04-07 00:37:28 +02:00
Mathieu Duponchelle ad296976f0 [fixup]: extension_module: allow specifying install_dir OR subdir 2018-04-07 00:37:28 +02:00
Mathieu Duponchelle 423f2f5c92 [fixup]: Address PKG_CONFIG env vars comments 2018-04-07 00:37:28 +02:00
Mathieu Duponchelle e1b138a21b Implement a generic python module
With contributions from Håvard Graff
2018-04-06 22:43:35 +02:00
Jussi Pakkanen aef1a81b35
Merge pull request #2711 from xclaesse/both-library
Add both_library() to build both shared and static library
2018-04-04 22:47:59 +03:00
Iñigo Martínez c1fcc8ab3e gnome.gtkdoc: Fix generated files used as content files
The `gtkdoc` function in the `gnome` module is able to use generated
files as content files, but the path to these is wrong in the used
command line.
2018-04-04 22:47:10 +03:00
Alexis Jeandet 4b98898c7c [Qt module] refactor b4cd949c48
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>
2018-04-04 09:36:45 +02:00
Alexis Jeandet b4cd949c48 [Qt module] More qrc fixes
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>
2018-04-04 01:06:43 +02:00
Xavier Claessens 5eef325ab6 pkgconfig generator: Only skip dependencies when using shared_library()
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.
2018-04-03 15:20:19 -04:00
Xavier Claessens cf0e997167 Remove duplicated list of known kwargs for build targets 2018-04-03 15:20:19 -04:00
Alexis Jeandet ebeb248c07 [Qt module] Added generated resource test case + some fixes
Subdir is already in generated resource path.
Some PEP8 fixes.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-03-30 01:58:09 +02:00