Commit Graph

188 Commits

Author SHA1 Message Date
Iñigo Martínez f022cb3a40 gnome.gtkdoc: Add dependencies over generated targets
The gtkdoc function can also use generated targets to create
documentation. However, the dependencies over these generated files
are missing, so these must be also included in the run target.
2017-12-22 20:58:13 +01:00
Iñigo Martínez f92d117bec gnome.gtkdoc: Add support for non string based content files
gnome's gtkdoc function does not support content files which are
not strings. However, there are situations where files generated
by other targets might be needed.
2017-12-19 17:45:58 +01:00
Michael James Gratton 93c988b453 Enable re-compilation of GNOME gschema files if they have changed.
* mesonbuild/modules/gnome.py (GnomeModule.compile_schemas): Allow the
  depend_files kwarg.

* docs/markdown/Gnome-module.md: Add docs for new kwarg (and the only
  other one that is permitted).
2017-12-13 21:31:32 +02:00
Jussi Pakkanen 018deb48fe
Merge pull request #2663 from inigomartinez/pkg-config-define-variable
dependencies: Allow pkg-config to define variables
2017-12-03 22:53:44 +02:00
Iñigo Martínez 44dd429ee5 dependencies: Fix pkg-config variable definition
In a previous commit variable definition was added in pkg-config.
However, this commit was not complete.

This fixes the missing parts of that commit.
2017-12-01 13:49:01 +01:00
Nirbheek Chauhan e1bdc098ca gnome.compile_resources: Prefer generated files over source files
We should always prefer generated files over onces in the source tree
else if the same file also exists in the source tree we get strange
behaviour where we ignore dependencies and the project has to be
built twice to be fully up-to-date.

See: https://bugzilla.gnome.org/show_bug.cgi?id=787677

Closes https://github.com/mesonbuild/meson/issues/2686
2017-11-30 23:15:19 +02:00
Patrick Griffis 643d3a4976 gnome.gtkdoc: Fix missing permitted kwargs
Found by https://bugzilla.gnome.org/show_bug.cgi?id=790998
2017-11-29 12:36:11 -05:00
Xavier Claessens 9e2d078948 gnome: Add include_directories parameter to gtkdoc() 2017-11-10 18:23:47 +02:00
Martin Kelly 02bea7d5bf namespace run_targets by subproject
Currently, run_target does not get namespaced for each subproject,
unlike executable and others. This means that two subprojects sharing
the same run_target name cause meson to crash.

Fix this by moving the subproject namespacing logic from the BuildTarget
class to the Target class.
2017-10-31 01:04:38 +02:00
Patrick Griffis f220a5dd86 gnome: Fix compile_schemas() using path sep in target name 2017-10-25 21:01:16 +03:00
Corentin Noël fd860482e5 Allow to give source files to GtkDoc by respecting the File class 2017-10-18 00:39:39 +03:00
Rico Tzschichholz 8b8e1ee620 gnome: g-ir-scanner accepts multiple symbol-prefix arguments 2017-10-08 14:04:34 +03:00
Jussi Pakkanen 357b34f915 Merge pull request #2375 from centricular/gnome-gir-fixes
Fix GNOME gir generation with lists of dependency lists
2017-10-02 00:04:18 +03:00
Patrick Griffis 893d101fff gnome: Add header kwarg to generate_gir()
This is a commonly used flag so lets make it more obvious.
2017-10-01 20:15:21 +03:00
Nirbheek Chauhan bb0e18b738 Use listify and extract_as_list everywhere
They now flatten by default and unhold objects if required

Includes unit tests.
2017-10-01 22:27:48 +05:30
Nirbheek Chauhan 26dada3797 gnome: Flatten and unholder all dependencies
Otherwise lists-of-lists get ignored instead
2017-10-01 12:07:04 +05:30
Dylan Baker dda5e8cadb Allow CustomTarget's to be indexed
This allows a CustomTarget to be indexed, and the resulting indexed
value (a CustomTargetIndex type), to be used as a source in other
targets. This will confer a dependency on the original target, but only
inserts the source file returning by index the original target's
outputs. This can allow a CustomTarget that creates both a header and a
code file to have it's outputs split, for example.

Fixes #1470
2017-09-27 22:01:24 +03:00
Luke Shumaker 4dbbb4884c flake8: Clean up complained-about unused imports
This also adds a "# noqa: F401" comment on an unused "import lzma",
which we are using it in a try/except block that is being used to
check if the lzma module is importable; of course it is unused.

v2: This turned out to be a little tricky.

    mesonbuild/modules/__init__.py had the "unused" import:

        from ..interpreterbase import permittedKwargs, noKwargs

    However, that meant that the various modules could do things like:

        from . import noKwargs # "." is "mesonbuild.modules"

    Which breaks when you remove __init__.py's "unused" import.  I
    could have tagged that import with "# noqa: F401", but instead I
    chose to have each of the module import directly from
    "..interpreterbase" instead of ".".
2017-09-21 13:41:03 -04:00
Luke Shumaker bb25260f00 flake8: Perform suggested whitespace/formatting changes
This only touches newlines, spaces, and (occaisionally) commas.  Anything
else is left for another commit.
2017-09-21 11:59:03 -04:00
Alexis Jeandet e553d0807b Last round with listify function refactoring.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-09-18 22:25:34 +02:00
Alexis Jeandet bf64cf569b Gnome, pkgconfig, Qt4, Qt5 and windows modules slightly refactored.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-09-18 22:21:22 +02:00
Jussi Pakkanen 19e22ac88a Merge pull request #2216 from ebassi/yelp-linguas
Support LINGUAS for gnome.yelp() languages
2017-09-14 21:35:50 +03:00
Emmanuele Bassi 6f1d7e3d0a Add deprecation warning for gnome.yelp() argument
The 'languages' argument is deprecated; the LINGUAS file supercedes it
as the canonical source of translations.
2017-09-12 21:45:04 +01:00
Iñigo Martínez 540c928e30 gnome: Docbook generation for gdbus_codegen()
Add new 'docbook' argument which generates Docbook documentation for
each D-Bus interface. The docbook argument will be used as prefix
in `PREFIX`-NAME.xml pattern, and NAME will be replaced by the D-Bus
interfaces.
2017-09-12 20:29:24 +03:00
Emmanuele Bassi 2cabcb39c9 gnome: Flatten the sources for generate_gir()
If we don't do that, the traversal of the sources list to generate the
sources file for g-ir-scanner is going to explode with a Python
backtrace like this one:

  File "/usr/lib/python3.5/site-packages/mesonbuild/modules/gnome.py", line 463, in generate_gir
    gir_filelist.write(os.path.join(srcdir, s) + '\n')
  File "/usr/lib/python3.5/posixpath.py", line 89, in join
    genericpath._check_arg_types('join', a, *p)
  File "/usr/lib/python3.5/genericpath.py", line 143, in _check_arg_types
    (funcname, s.__class__.__name__)) from None

if the sources list contains a list.
2017-09-04 23:26:53 +03:00
Patrick Griffis 04b2c67b7d gnome.gdbus_codegen(): Add annotations keyword
Fixes #2123
2017-09-04 19:26:04 +03:00
Elliott Sales de Andrade 7fb1973cac Use include-uninstalled for internal gir deps.
This stops g-ir-scanner from trying to search for the pkg-config file
for an internal gir, which won't be available.
2017-08-31 22:15:15 +03:00
Chun-wei Fan aeaefce81e modules/gnome.py: Use a filelist for generate_gir()
On Windows, one will face the issue of the 8192-character limit for each
command line, so this will cause an issue when one is building items
like GTK+ with introspection, because the g-ir-scanner command line will
likely get too long, which will clearly break the build.  This will
affect all Windows builds.

Make use of the --filelist option that is already in g-ir-scanner, and
generate such a file list from the sources that are fed to
generate_gir(), named as
$(builddir)/$(target_id)/<NameSpace>_<NameSpaceVersion>_gir_filelist
and using it during the build.
2017-08-31 21:39:47 +03:00
Matthias Klumpp 5275548b5c gnome: Ensure gir always works with asan, even if used together with ubsan
This really resolves #1910 by making it also work in cases where asan
and ubsan are used together via "-Db_sanitize=address,undefined".
2017-08-29 18:38:51 +03:00
Matthias Klumpp d49eeb243f gnome: Fix typo in gtkdoc_html_dir, so it returns the correct path 2017-08-29 18:38:07 +03:00
Thibault Saunier f2a60b87cb gnome: Fix g-ir-scanner linking args for all code paths
We were fixing them up only in the dependency code path and not
in the InternalDependency one. Just make sure to do it once for all.
2017-08-23 15:00:19 -03:00
Jussi Pakkanen 50fb7d37ab Make all functionality invokable via the main Meson binary,
which can be a Windows .exe file.
2017-08-18 12:08:20 +03:00
Marinus Schraal c8e61f112d gnome: use VAPIGEN from the environment if set
Allow setting the vapigen binary by passing it as an environment
variable.
2017-08-14 20:28:53 +03:00
Tim-Philipp Müller 4e476c82f3 gnome: add mkenums_simple()
99% of all mkenums uses in C libraries use the same basic template,
so add a mkenums_simple() function that takes care of everything for
us based on that template.

Features:
 - optional function declaration decorator such as GLIB_AVAILABLE
 - optional extra header prefix (e.g. for include needed for decorator)
 - optional extra body prefix (e.g. for additional includes)
 - optional function name prefix (e.g. to add leading underscores)

Fixes issue #1384
2017-08-14 19:40:36 +03:00
Nirbheek Chauhan 556966003e gnome: Allow passing build_by_default: to some functions
Closes https://github.com/mesonbuild/meson/issues/2174
2017-08-13 21:17:47 +03:00
Tim-Philipp Müller 60b83a5f0a gnome: add 'ignore_headers' to permitted kwarg list for gnome.gtkdoc() 2017-08-13 21:17:04 +03:00
Nirbheek Chauhan 7aed29e2c3 gnome: Fix parsing of resource custom target files
gnome.compile_resources() was not parsing custom target sources
properly. It was using the custom target name as the output of the
custom target instead of looking at the list of outputs.

Also modify the GNOME framework test to expose this.
2017-08-13 21:13:28 +03:00
Florian Müllner 691ad706ad gnome: Only translate -l flags to --extra-library
Other linker arguments may contain '-l' as well, for instance
'-L/usr/lib/x86_64-linux-gnu/foo' with Debian-style multiarch.
2017-08-13 21:12:43 +03:00
Jussi Pakkanen d335a84b9e A few more lgtm fixes. 2017-08-04 12:54:31 +03:00
Florian Müllner 00a3d1ac4f gnome: Fix translation of -l to --extra-library args
We prefer to use the --extra-library parameter for passing -l arguments
to g-ir-scanner, however we need to be careful to only replace the first
'-l' occurrence to not translate
  '-lfoo-lib'
to
  '--extra-library=foo--extra-library=ib'
2017-08-02 21:45:50 +03:00
Emmanuele Bassi de45352d9d gnome: Support new glib-genmarshal arguments
The glib-genmarshal tool was rewritten in GLib 2.53.3, and now supports
more command line arguments, such as:

  "--pragma-once": emits a "#pragma once" instead of the old header
    guards when generating the header file
  "--prototypes": emits the marshallers prototype when generating the
    source file
  "-D,-U": defines and undefines pre-processor symbols
  "--include-header": emits an "#include" directive when generating the
    source file for the specified header file

Meson should take advantage of these new options, as they can be used to
replace most of the ad hoc build rules that projects are currently using
to implement the same thing.

Instead of mapping each option to a named argument, I used the same
approach as the compile_resources() and generate_gir() methods; the
genmarshal() method now has an 'extra_args' argument that can be used to
pass extra arguments to the glib-genmarshal tool.
2017-07-23 16:30:34 +01:00
Nicolas Dufresne 12be4b6644 gnome: Fix wrong include path
When dealing with the SharedLibrary or StaticLibrary include
directories, we where not taking into acount that path are relative to
the source tree. With proper helper, this works now. This fixues issue
where the gir may be generated bug from headers found in the prefix.
2017-07-21 20:16:50 +03:00
Patrick Griffis 9683082c4c gnome.genmarshal(): Include generated header in generated source
This silences any strict-prototype warnings if enabled.
2017-07-20 12:27:38 +03:00
Nirbheek Chauhan a0bd896b2f gnome module: Add -lfoo after -Lbar LDFLAGS
Otherwise they won't take effect
2017-07-17 12:41:54 +05:30
Jussi Pakkanen 9c02e57f88 Qapla' 2017-07-02 16:55:12 +03:00
Jussi Pakkanen ecde592b86 Fix custom target sources 2017-07-01 01:13:45 +03:00
Elliott Sales de Andrade 241790f72d Fix typo in generate_gir keyword name. 2017-06-30 11:16:49 -04:00
Jussi Pakkanen 3262be23dc Fixed issues raised in review. 2017-06-26 23:29:42 +03:00
Jussi Pakkanen 80d665e8de Converted some modules. 2017-06-26 21:10:27 +03:00
Jussi Pakkanen 080307dd71 Merge pull request #1948 from mesonbuild/tingping/gnome-sanitize-fixes
Fix gnome.generate_gir() with address sanitizer
2017-06-22 06:19:29 -04:00