Commit Graph

140 Commits

Author SHA1 Message Date
Nirbheek Chauhan 9bc07a0941 Fix several more lint errors
Found by Igor Gnatenko

************* Module mesonbuild.interpreter
E:1232,33: No value for argument 'interp' in constructor call (no-value-for-parameter)
************* Module mesonbuild.dependencies
E: 68, 4: An attribute defined in mesonbuild.dependencies line 39 hides this method (method-hidden)
************* Module mesonbuild.environment
E: 26, 0: class already defined line 19 (function-redefined)
E: 68,18: Undefined variable 'InterpreterException' (undefined-variable)
E:641,39: Undefined variable 'want_cross' (undefined-variable)
E:850,94: Undefined variable 'varname' (undefined-variable)
E:854,94: Undefined variable 'varname' (undefined-variable)
E:860,102: Undefined variable 'varname' (undefined-variable)
E:863,94: Undefined variable 'varname' (undefined-variable)
************* Module mesonbuild.modules.gnome
E:438,26: Undefined variable 'compilers' (undefined-variable)
2016-12-20 00:07:00 +02:00
Igor Gnatenko 139e020ede tree-wide: use proper 'not in' notation
Let's be more pythonic and 'not is' seems really weird.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 21:48:35 +01:00
Igor Gnatenko d5ccd20aac fix some of pylint's undefined-variable
************* Module mesonbuild.modules.rpm
E:106,29: Unsupported format character '{' (0x7b) at index 16 (bad-format-character)
************* Module mesonbuild.modules
E: 12,14: Undefined variable 'MesonException' (undefined-variable)
************* Module mesonbuild.modules.gnome
E:699,69: Undefined variable 'sargs' (undefined-variable)
************* Module mesonbuild.wrap.wrap
E:103,25: Undefined variable 'checkoutdir' (undefined-variable)
************* Module mesonbuild.backend.backends
E: 83,16: Undefined variable 'mlog' (undefined-variable)
************* Module mesonbuild.backend.ninjabackend
E:254,105: Undefined variable 't' (undefined-variable)

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 17:09:35 +02:00
Nirbheek Chauhan c693bd9bb4 Allow passing arguments to install scripts
Closes #1213
2016-12-18 18:30:47 +02:00
Nirbheek Chauhan 59b8f11e7e gnome: Re-use gobject-introspection-1.0 pkg-config dependency
Also don't use `dependencies` as a module name since it is commonly used
as a variable name too. Instead, directly import the classes that we use
from that module.
2016-12-17 17:53:52 +02:00
Nirbheek Chauhan 5e5b3f00d8 modules: Cache programs found by find_program
This avoids printing several 'Found:' messages during configure, and
also avoids doing several searches for the same binary. This is already
done by the interpreter for `find_program` calls from build files.

Also move it to the module-wide __init__.py file so it can be used by
other modules as-needed.

Also use it for g-ir-scanner where it was missed in one place, also fix
exception name in the same place.
2016-12-16 00:04:38 +05:30
Nirbheek Chauhan d5f7ba862b gnome.mkenums: Use absolute paths for all commandline args
Closes #973

test cases/vala/8 generated sources/ tests this.
2016-12-15 14:58:43 +05:30
Nirbheek Chauhan e6f48a03fc Allow all code to access module target classes
It is often useful to be able to check if a specific object is of a type
defined in a module. To that end, define all such targets in
modules/__init__.py so that everyone can refer to them without poking
into module-specific code.
2016-12-15 04:12:23 +05:30
Nirbheek Chauhan 79f6626867 Pass --gresources to valac for each compiled gresource
Without this, the user has to both compile the resource with
gnome.compile_resources, pass that to the target sources, and also
pass --gresources=/path/to/gres.xml to vala_args in the target.

With this, we will do that automatically.
2016-12-15 04:12:23 +05:30
Nirbheek Chauhan 7b3d00fee4 Use dict for self.build.compilers instead of list
Everywhere we use this object, we end up iterating over it and comparing
compiler.get_language() with something. Using a dict is the obvious
choice and simplifies a lot of code.
2016-12-13 09:20:34 +05:30
Patrick Griffis c42167dc6f gnome.gtkdoc(): Include builddir variant of include dirs also
This avoids the need for users to constantly join paths themselves
as this is commonly included.
2016-12-12 21:01:49 +02:00
Nirbheek Chauhan 60716fcd6d Use universal_newlines=True for all Popen calls
Instead of adding it everywhere manually, create a wrapper called
mesonlib.Popen_safe and use that everywhere that we call an executable
and extract its output.

This will also allow us to tweak it to do more/different things if
needed for some locales and/or systems.

Closes #1079
2016-12-11 01:59:58 +02:00
Patrick Griffis c75b5886da gnome.gtkdoc(): Include -rpath for gtkdoc-scangobj
Without libtool it is our job to ensure local libraries are picked up.
2016-12-10 01:05:26 +02:00
Jussi Pakkanen d1501e39d5 Merge pull request #1086 from Keruspe/master
Allow specifying some toolchain executables using env
2016-12-06 23:43:36 +02:00
Patrick Griffis e265887ac3 gnome.gtkdoc(): Add keyword to override the mode
I'm not entirely sure if you ever want to mix and match but
I can say that glib required none of them to be passed so
this allows for that.
2016-12-06 14:07:45 -05:00
Patrick Griffis d764c7dc91 gnome.gtkdoc(): Add namespace keyword 2016-12-06 13:23:58 -05:00
Patrick Griffis a626d1a7bc gnome.gtkdoc(): Allow passing multiple source dirs
This is valid and used by glib for example.
2016-12-06 12:23:29 -05:00
Marc-Antoine Perennou bb3b45a0ec gnome: use PkgConfigDependency to find gobject-introspection cflags
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-12-05 10:57:10 +01:00
Thibault Saunier 9c0997dafd gnome: Use g-ir-scanner --extra-library option when avalaible
When generating the .gir file we need g-ir-scanner to link the
introspector binary against the right dependencies, for that
we used to use the --library option but this has a special meaning
and the libs passed in there end up being the ones in the .gir file
itself, which is not what we want.

A new --extra-library option is beeing added in goject-introspection
(https://bugzilla.gnome.org/show_bug.cgi?id=774625) to handle our use case
(ie. not using libtool which allows g-ir-scanner to know about those)
and we should make use of it.

Closes #981
2016-12-03 23:07:00 +02:00
Jussi Pakkanen 8e8f75005d Merge pull request #1076 from mesonbuild/tingping/gresource-export
gnome.compile_resources(): Add export and install_header kwargs
2016-12-03 22:59:27 +02:00
Thibault Saunier e933bdd872 gnome: Properly search for programs
Otherwise it might just fail on windows and this way
we report a proper error message when not found.
2016-12-02 23:01:19 +02:00
Patrick Griffis 9a6db2eb2f gnome.compile_resources(): Add export and install_header kwargs
This defaults to not exporting resources as that is generally what
you want but that does make this a breaking change. Along with that
if you export your resources you would want to install the header.
2016-11-20 17:39:57 -05:00
Patrick Griffis 8dd32506f4 gnome.compile_resources(): Add ability to output gresource bundles
Closes #1061
2016-11-20 23:36:21 +01:00
Patrick Griffis 587a0bb3d1 gnome: Update required version for glib-compile-resources depfile fixes
Note that this version is not yet released
2016-11-20 23:01:26 +01:00
Jussi Pakkanen a01919976e Always specify installed data with a File object. Closes #858. 2016-11-18 17:37:35 -05:00
Elliott Sales de Andrade 996f4d89f3 Disallow some keyword arguments to gnome.mkenums.
The install argument is allowed for CustomTargets, but we use
install_header as the setting now. Also, setting a generic template when
specifying the more specific source or header template shouldn't be
allowed.
2016-11-18 15:30:56 -05:00
Jussi Pakkanen 8b05990c13 Disable gresource dependency generation as it breaks Ninja. 2016-11-14 11:43:24 -05:00
Jussi Pakkanen 59a414283c Merge pull request #1022 from centricular/fix-girtarget-deps-includes
gnome.generate_gir: Add gir deps and includes recursively
2016-11-12 18:01:28 -05:00
Jussi Pakkanen e1ecb95d1d Merged generate_gir fix. 2016-11-13 00:43:06 +02:00
Thibault Saunier 85a0cd7635 Add new add_project_[link]_args functions
Fixes 979
2016-11-12 17:34:06 -05:00
Nirbheek Chauhan 69dcbb6ec9 gnome.generate_gir: Add gir deps and includes recursively
Earlier, we were never adding dependencies on other GirTargets that we
need. The dependency would only be added indirectly through other
BuildTargets such as SharedLibrary. Now we add all GirTargets specified
in the `dependencies :` kwarg to the list of dependencies of the
GirTarget that we generate.

Also, we weren't adding include directories for the typelib generation
command recursively. We were only adding it for the GirTargets listed
under the `dependencies :` kwarg to gnome.generate_gir. Now we search
all link targets, find GirTargets, extract the include dir, and use it.

In summation, dependencies were completely broken.
2016-11-13 03:57:58 +05:30
Patrick Griffis c7226462a2 gnome: Improve dependency handling of compile_resources()
- Use depfile support on recent glib-compile-resources
- Don't pass dep files to header ever
- Pass depends for generated deps
- Avoid duplicate --sourcedir args
- Include correct subdir of generated deps
2016-11-09 17:40:42 +01:00
Nirbheek Chauhan a2262103fb Implement mlog.warning and use it everywhere for warnings
Prepends the string with 'WARNING:' in ANSI yellow.

Closes https://github.com/mesonbuild/meson/issues/961
2016-11-08 17:43:24 -05:00
Patrick Griffis fb7d9c7aef gnome: Mark helper functions as private 2016-11-06 00:02:53 -04:00
Matthew Waters b6971f2007 gnome: make generate_gir use the correct shared library
If building in a prefix with a version of the library that's already
installed with other dependencies already installed in that prefix,
then the installed library was being picked up to link with
for gir generation instead of the newly built library.
2016-11-04 01:35:29 +11:00
Jussi Pakkanen f1c909c41a Merge pull request #980 from ebassi/gtkdoc-fixes
Improvements for gnome.gtkdoc
2016-11-02 13:49:05 -07:00
Jussi Pakkanen 36a0d162cb Merge pull request #895 from mesonbuild/wip/tingping/gnome-vapi
gnome: Add generate_vapi function
2016-11-02 11:41:58 -07:00
Emmanuele Bassi e226d702bc gtkdoc: Add `ignore_headers` positional argument
Not all headers are public, or contain public types. GTK-Doc allows
adding headers to be ignored during the "scan" phase, by passing the
`--ignore-headers` command line argument to gtkdoc-scan.

Currently, you can do something like:

  ignored_headers = [ 'foo-private.h', 'bar-private.h', ]

  gnome.gtkdoc(...
               scan_args: [
                 '--ignore-headers=' + ' '.join(ignored_headers),
               ],
               ...)

But it does not guarantee escaping rules and it's definitely not nice.

We can add a simpler version of that mechanism through a new positional
argument, `ignore_headers`, which behaves like `content_files` or
`html_assets`, and takes an array of header files to ignore:

  gnome.gtkdoc(...
               ignore_headers: ignored_headers,
               ...)
2016-11-01 14:11:48 +00:00
Jussi Pakkanen 3c48bd2d88 Revert d9473095f2 because it broke GStreamer. 2016-10-24 12:16:28 -07:00
Patrick Griffis d9473095f2 gnome: Don't pass ldflags to g-ir-scanner
In this context -l refers to shared libraries that the gir
provides so you end up with a dozen unecessary libs in your
gir file.
2016-10-23 08:53:27 -07:00
Jussi Pakkanen b50f3e6976 Merge pull request #934 from mesonbuild/wip/tingping/gnome-yelp
gnome: Add yelp() function
2016-10-23 04:39:15 -07:00
Patrick Griffis ed3cc537cb gnome: Fix building gobject-introspection with sanitizer
Fixes #922
2016-10-22 15:04:16 -07:00
Patrick Griffis bae7d7b3d7 gnome: Add generate_vapi() function
This allows C projects to generate vapi bindings from
gir files and returns a dependency that can be used by
Vala.
2016-10-21 02:23:54 -04:00
Patrick Griffis 1781129740 gnome: Add yelp() function
Fixes #881
Mentioned in #295
2016-10-19 18:44:19 -04:00
Jussi Pakkanen e908910187 Can query pkg-config variables from the system. Closes #726. 2016-10-19 22:36:34 +03:00
Patrick Griffis 22debf6ffc gnome: Fix gresource warning incorrectly being shown on 2.50+ 2016-10-19 21:15:05 +03:00
Jussi Pakkanen a417efdf24 Merge pull request #793 from ssssam/sam/gresource-dependencies
gnome: allow use of generated files with compile_resources()
2016-10-16 17:47:39 +03:00
Patrick Griffis d7fdeb4d15 gnome: Avoid unhandled exception 2016-10-16 17:38:54 +03:00
Sam Thursfield 25f13067c2 gnome: allow use of generated files with compile_resources()
This commit adds a 'dependencies' keyword to the
gnome.compile_resources() function, which allows your resource blob
to depend on files generated at build-time from custom_target() or
configure_file() targets.

My current use case for this is source data that gets processed with Gettext
translation tools before being compiled into the resource blob.

This feature only works with GLib version 2.48.2 and above. So the
compile_resources() function now detects GLib version and raises an
error if the version of GLib being used is too old.

The compile_resources() test case is now split into two, so that the
existing one can continue to run on systems with old GLib versions (such
as Ubuntu Xenial, which the automated tests on travisci.org use), but
where new enough GLib is available we also test generating gresource
content.

The existing warning about glib-compile-resources is now only printed
if GLib version is older than 2.50.0 because
<https://bugzilla.gnome.org/show_bug.cgi?id=745754> is fixed in the
2.50.0 release.
2016-10-13 21:18:14 +01:00
Patrick Griffis 94b7b59546 gnome.generate_gir(): Also include current build dir
Continuation of 084b854ce0
2016-10-08 12:34:30 +02:00
Jussi Pakkanen f73c0a1098 Merge pull request #843 from mesonbuild/tingping/gir-dir
gnome.generate_gir(): Fix install_dir and add install_dir_gir and install_dir_typelib
2016-10-03 21:27:54 +03:00
Jussi Pakkanen 7256e109bf Merge pull request #718 from QuLogic/glib-mkenums-genmarshal
glib-mkenums and glib-genmarshal support
2016-10-03 19:07:42 +03:00
Patrick Griffis dd9dfa77fb gnome.generate_gir(): Add install_dir_gir and install_dir_typelib
A generic `install_dir` is less useful and didn't work so just ignore it
2016-10-03 02:34:33 -04:00
Patrick Griffis 084b854ce0 gnome: Consistently include current source dir
This is a common pattern so avoid the duplication
2016-10-02 12:16:22 -04:00
Elliott Sales de Andrade 2840539a08 Don't overwrite mkenums C file dependencies. 2016-09-28 18:32:56 -04:00
Elliott Sales de Andrade 8f024c0697 Allow running mkenums without templates. 2016-09-28 18:32:46 -04:00
Jussi Pakkanen d61b71fdc2 Converted mkenums to be single invocation. 2016-09-28 18:21:42 -04:00
Elliott Sales de Andrade 1033728c85 Fix mkenums and genmarshal argument names.
Dashes aren't allowed in keyword argument names.
2016-09-28 18:20:18 -04:00
Elliott Sales de Andrade ceee8bc6b2 Generate genmarshal header and body simultaneously.
This follows the same style as gnome.compile_resources, which produces
both files from one invocation.
2016-09-28 18:20:18 -04:00
Elliott Sales de Andrade 2a8a0727fc Add support for glib-genmarshal to gnome module. 2016-09-28 18:20:18 -04:00
Elliott Sales de Andrade ab004ab189 Add support for glib-mkenums to gnome module. 2016-09-28 18:20:17 -04:00
Thibault Saunier bb3823e6f4 gnome: Allow specifying gtkdoc where to install directory 2016-09-26 15:25:59 -03:00
Thibault Saunier f86fbf6ebf gnome: Run gtkdoc-scanobjs and add a way to get assets working
Allowing the object tree to be generated.

We need to add options to allow copying the ncesseary sources and
assets so the HTML generator can work with them (everything is
relative so we need to copy them in the build directory).

Until now the documentation was not generated from the user provided
main sgml file but it was using a generated one, which lead to a broken
documentation. Starting using it revealed the other bugs fixed in that
commit.
2016-09-26 15:25:59 -03:00
Thibault Saunier 68ae8e1ad0 gnome: Factor out a get_dependencies_flags method
And recurse to make sure that we build against all internal
dependencies dependencies.
2016-09-26 15:25:59 -03:00
Thibault Saunier 52a4b3302e gnome: Make all include paths absolute
The relative computation was broken when using
subprojects.
2016-09-26 15:25:59 -03:00
Jussi Pakkanen 8ab62a27b4 Merge pull request #739 from QuLogic/gir-include-paths
Update GIR include paths
2016-09-26 20:56:02 +03:00
TingPing 5b34e560e5 gnome: Print useful error if missing compile_resource arg (#811) 2016-09-25 19:02:41 +03:00
Elliott Sales de Andrade 28e1f3ba13 Fix pkgconfig libraries passed to GIR targets. 2016-09-14 16:59:53 -04:00
Elliott Sales de Andrade 7a6534e054 GIR: Handle all dependencies and internal libraries. 2016-09-14 16:57:40 -04:00
Elliott Sales de Andrade 68a2e5c9c9 Also add GIR include_directories to header search path. 2016-09-14 16:57:40 -04:00
Elliott Sales de Andrade 9009f8267e Allow GirTargets as includes for another GirTarget. 2016-09-14 16:57:40 -04:00
Elliott Sales de Andrade 3ae327a2ac Pull dependency directly from GIR's target library. 2016-09-14 16:57:38 -04:00
Elliott Sales de Andrade d0b6f0b7a4 Add dependency's include paths to GIR generation. 2016-09-14 16:55:07 -04:00
Elliott Sales de Andrade f2ccad64fc Determine GIR include paths like targets.
These paths are now generated similar to
NinjaBackend.generate_single_compile where IncludeDirs create includes
of both the build directory path and the source directory path.

This also fixes a bug with include_directories, where the path string
supplied to the IncludeDirs initializer was used for the search path,
instead of the actual location to which it referred. Often, this was a
'.', and not a really useful path.
2016-09-14 16:55:07 -04:00
Thibault Saunier 6c6c706bb8 gnome: Handle internal dependencies to generate gir files 2016-08-29 10:11:27 -03:00
Jussi Pakkanen fae8ad90a4 Consistent kwarg popping. 2016-08-21 15:04:44 +03:00
Jussi Pakkanen 4b3414cba0 Add extra_args kwarg to glib-compile-resources. Closes #698. 2016-08-21 15:00:02 +03:00
Igor Gnatenko bde123d70c Merge pull request #629 from wtay/master
gnome.py: typelib files should be installed in libdir
2016-08-14 20:07:43 +02:00
Nirbheek Chauhan e6c927d8ac gnome: Update RunTarget usage to new syntax
This was broken in 0733c0f9a1
2016-07-21 13:39:42 +05:30
Wim Taymans 660c872422 gnome.py: typelib files should be installed in libdir
The typelib files should be installed in libdir, even on debian (which
has them in /usr/lib/x86_64-linux-gnu/girepository-1.0/).
2016-07-04 12:29:56 +02:00
Jussi Pakkanen d8e08224da Helper function to get the install dir of a gtkdoc module. Closes #551. 2016-05-25 22:55:02 +03:00
Emmanuele Bassi 8998e44cd9 Support passing extra arguments to gtkdoc-fixxref
The extra arguments are typically used to specified the location of
installed API references that gtk-doc can use to create cross links
for symbols.

Fixes #555
2016-05-25 11:36:33 +01:00
Tim-Philipp Müller 3b5dcdbd42 gnome: only print warning when gresource-related functionality is used (#510)
It's confusing to print this when using stuff that works just fine.
2016-04-07 20:23:46 +03:00
Hemmo Nieminen 336904b553 Move MesonException from coredata to mesonlib. 2016-04-01 00:52:45 +03:00
Jussi Pakkanen 352b5badd2 Handle resources that come in files(). Closes #424. 2016-02-29 21:04:16 +02:00
Damián Nohales 8bcd25f5b4 Simplify target generation in GnomeModule.compile_resources 2016-02-09 19:41:26 -03:00
Damián Nohales b91662a903 Allow multiple source_dir in GResource
There are use case where one may want to specify --sourcedir option
multiple times to glib-compile-resources, which will look for
resources in every specified directory.

By doing this, we also need to get rid of the manual GResource XML
parsing and we opted to use the glib-compile-resources command with
the --generate-dependencies option. This command will solve the
multiple source_dir case for us.
2016-02-09 19:41:26 -03:00
Jussi Pakkanen 5586dcf5c0 Text clarification. 2016-01-31 00:19:50 +11:00
Jussi Pakkanen d6e176f455 Made gtkdoc and run targets work. 2016-01-16 18:04:59 +02:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00