Commit Graph

17522 Commits

Author SHA1 Message Date
Emmanuele Bassi
fd541c3518 Require Python 2.7
Python 2.7 is the last stable release of the 2.x series, as per PEP
404: http://legacy.python.org/dev/peps/pep-0404/

Python 2.7 is also 7 years old, and maintained until 2020.
2017-07-20 15:11:50 +01:00
Debarshi Ray
c1ae1170fa GApplication: Assert that dbus_unregister was called before destruction
Invoking the dbus_unregister virtual method during destruction is
problematic. It would happen after a sub-class has dropped its
references to its instance objects, and it is surprising to be asked to
unexport exported D-Bus objects after that.

This problem was masked as a side-effect of commit 21b1c390a3.
Let's ensure that it doesn't regress by asserting that dbus_unregister
has happened before destruction.

Based on a patch by Giovanni Campagna.

https://bugzilla.gnome.org/show_bug.cgi?id=725950
2017-07-20 15:31:41 +02:00
Christoph Reiter
be7c3ae611 meson: set glib_extension in glibconfig.h to match the autotools output
https://bugzilla.gnome.org/show_bug.cgi?id=784995
2017-07-19 16:39:44 +02:00
Christoph Reiter
cb0c224e94 meson: use set_quoted() instead of quoting manually
https://bugzilla.gnome.org/show_bug.cgi?id=784995
2017-07-19 16:39:14 +02:00
Christoph Reiter
ab6e425574 meson: define G_PID_FORMAT
https://bugzilla.gnome.org/show_bug.cgi?id=784995
2017-07-19 16:38:37 +02:00
Christoph Reiter
d88d1ba7e8 glib-mkenums: Don't use FileNotFoundError, it's Python 3 only.
https://bugzilla.gnome.org/show_bug.cgi?id=785113
2017-07-19 14:21:24 +02:00
Christoph Reiter
c2dace6b8b glib-mkenums: Use utf-8 for reading files
On Windows open() defaults to ANSI and on Python 2 it doesn't take
an encoding. Use io.open() instead which provides the same interface
on both Python versions.

https://bugzilla.gnome.org/show_bug.cgi?id=785113
2017-07-19 14:21:20 +02:00
Tim-Philipp Müller
2ac8079b94 meson: fix unit tests and "Invalid byte sequence in conversion input"
Check if strerror_r returns a char * and define STRERROR_R_CHAR_P
if so, which is needed by g_strerror() since c8e268b

https://bugzilla.gnome.org/show_bug.cgi?id=784000
2017-07-19 10:34:45 +01:00
Adrian Perez de Castro
f8a88a768d Map G_NOTIFICATION_PRIORITY_HIGH to NOTIFY_URGENCY_NORMAL
When using the Freedesktop backend for GNotification, it seems like a
better idea to map G_NOTIFICATION_PRIORITY_HIGH to NOTIFY_URGENCY_NORMAL
(instead of NOTIFY_URGENCY_CRITICAL) provided that the difference
between GNotification's NORMAL and HIGH priorities is minor.

Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>

https://bugzilla.gnome.org/show_bug.cgi?id=784815
2017-07-18 17:31:29 -04:00
Emmanuele Bassi
9a31103ebb Add Meson build files to the Autotools dist
We should allow building GLib with Meson from an Autotools dist tarball.
2017-07-18 12:01:05 +01:00
Matthias Clasen
9424facde2 2.53.4 2017-07-17 16:20:52 -04:00
Emmanuele Bassi
2219cfb92d mkenums: Keep compatibility with Python 2.x
Since every other tool in GLib is allowed to be used with Python 2.x,
glib-mkenums should follow suit.
2017-07-17 16:29:40 +01:00
Emmanuele Bassi
f18556749c mkenums: Skip unparsed lines
The old glib-mkenums just skipped lines it could not understand.
2017-07-17 16:11:19 +01:00
Matthias Clasen
1e4135f253 2.53.4 2017-07-17 10:46:19 -04:00
Emmanuele Bassi
a45bf85ce5 tests: Do not use gnome.genmarshal()
We are providing glib-genmarshal; using the gnome module in Meson does
not call the just built glib-genmarshal tool.
2017-07-17 13:59:20 +01:00
Emmanuele Bassi
4f17d1049f mkenums: Add missing --fprod handler
We are not generating the template for the --fprod command line
argument.
2017-07-17 11:15:06 +01:00
Emmanuele Bassi
3c03cc8f68 meson: Simplify the use of built tools
The Meson build has fallen a bit behind the Autotools one, when it comes
to the internally built tools like glib-mkenums and glib-genmarshals.

We don't need to generate gmarshal.strings any more, and since the
glib-genmarshal tool is now written in Python it can also be used when
cross-compiling, and without indirection, just like we use glib-mkenums.

We can also coalesce various rules into a simple array iteration, with
minimal changes to glib-mkenums, thus making the build a bit more
resilient and without unnecessary duplication.
2017-07-17 11:05:07 +01:00
Emmanuele Bassi
7ee050dc4b mkenums: Use the same reporting functions from genmarshal
We can reuse the same code to make error reporting stand out a bit more,
with colors and potentially with the ability to make warnings fatal.
2017-07-17 10:32:33 +01:00
Emmanuele Bassi
69515e9f5c mkenums: Skip files not found
The old glib-mkenums was more forgiving, and simply ignored any files it
could not find.

We're going to print a warning, as in the future we may want to allow
more strictness.
2017-07-17 10:24:32 +01:00
Emmanuele Bassi
77a3a96218 mkenums: Change ordering for template file and arguments
This is a bit of a hack to maintain some semblance of backward
compatibility with the old, Perl-based glib-mkenums. The old tool had an
implicit ordering on the arguments and templates; each argument was
parsed in order, and all the strings appended. This allowed developers
to write:

  glib-mkenums \
    --fhead ... \
    --template a-template-file.c.in \
    --ftail ...

And have the fhead be prepended to the file-head stanza in the template,
as well as the ftail be appended to the file-tail stanza in the
template.  Short of throwing away ArgumentParser and going over
sys.argv[] element by element, we can simulate that behaviour by
ensuring some ordering in how we build the template strings:

  - the head stanzas are always prepended to the template
  - the prod stanzas are always appended to the template
  - the tail stanzas are always appended to the template

Within each instance of the command line argument, we append each value
to the array in the order in which it appears on the command line.

This change fixes the libqmi build.
2017-07-17 09:37:21 +01:00
Chun-wei Fan
5ba3b4022e meson.build: Improve checks for va_copy() and __va_copy()
On Visual Studio, the compilation of the check program for va_copy() and
__va_copy() succeeds even though they may not be really available.  So,
make sure we include msvc_recommended_pragmas.h which helps us to detect
this situation by bailing out when warning C4013 (which means this
function is really not available) is encountered.

Also make sure that on Visual Studio builds we always include
msvc_recommended_pragmas.h is included so that it helps us to find out
problems in the build, and update comments for dirent.h and sys/time.h
as they are not shipped with any Visual Studio.

https://bugzilla.gnome.org/show_bug.cgi?id=783270
2017-07-17 14:50:55 +08:00
Emmanuele Bassi
35db045729 mkenums: Fix typo
There's a stray '~' that needs to be removed.
2017-07-16 17:25:08 +01:00
Emmanuele Bassi
69389bdc34 mkenums: Do not check for None
The symprefix variable can only be a string.
2017-07-16 12:06:34 +01:00
Emmanuele Bassi
af4a6457eb mkenums: Some arguments can be used multiple times
Some of the arguments that affect the generated result in glib-mkenums
can be used multiple times, to avoid embedding unnecessary newlines in
their values.

This change fixes the NetworkManager build.
2017-07-16 11:56:52 +01:00
Emmanuele Bassi
d19f53a767 Add more compatibility mode hacks
When using the `--header --body` compatibility mode, we need to emit
things we generally define in the header, such as the aliases for
standard marshallers, and aliases for deprecated tokens.

This fixes dbus-binding-tool, which is using `--header --body` and
deprecated tokens.

See: https://bugs.freedesktop.org/show_bug.cgi?id=101799
2017-07-16 11:15:07 +01:00
Christoph Reiter
fbf3511309 meson: fix typo in install path for gobject_gdb.py 2017-07-16 00:23:16 +02:00
Tim-Philipp Müller
8451f0b817 glib-mkenums: unescape \n etc. in command line arguments
Fixes generation of GStreamer enumtype files with autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=779332
2017-07-15 13:02:40 -04:00
Igor Gnatenko
a882c974d3 mkenums: pass string for re.sub() for real
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
2017-07-15 15:33:17 +02:00
Igor Gnatenko
1a182df5d1 mkenums: don't try to call undefined function
argparse will take care about everything

Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
2017-07-15 15:33:17 +02:00
Igor Gnatenko
615238d0a4 mkenums: make string raw for real regex
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
2017-07-15 15:33:17 +02:00
Igor Gnatenko
d753a411c0 mkenums: trivial style fixes
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
2017-07-15 15:33:17 +02:00
Igor Gnatenko
112908d9e4 mkenums: fix main incompatibility with python2
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
2017-07-15 15:27:31 +02:00
Tim-Philipp Müller
9306ada4fd meson: fix 'Unknown variable "gtester"' error on windows
With msys64/mingw.
2017-07-15 11:24:40 +01:00
Emmanuele Bassi
683809d5f7 Use env for gdbus-codegen's script
This allows us to build with Python 3 without using an absolute path.
2017-07-14 22:05:01 +01:00
Emmanuele Bassi
4395a89777 Use env to run the Python-based tools
Otherwise overriding the Python interpreter with `--with-python` won't
work correctly.
2017-07-14 21:21:33 +01:00
Emmanuele Bassi
0f18a2ebda meson: Substitute the Python shebang
Just like we do with Autotools. This allows building glib-mkenums and
glib-genmarshal on older platforms that only have Python 2.
2017-07-14 20:43:19 +01:00
Emmanuele Bassi
1eda0627f3 meson: Use the appropriate libdir-relative paths 2017-07-14 14:21:57 +01:00
Emmanuele Bassi
065a8a488a meson: Use the appropriate interface and binary ages
We need to build them out of the project version, and then propagate
them.
2017-07-14 14:21:57 +01:00
Emmanuele Bassi
37ff4189fd meson: Sync the version with Autotools 2017-07-14 14:21:57 +01:00
Thibault Saunier
be8820128f meson: fix remaining wrong #include's for gdbus_codegen files
This is a follow up on 266bc1e510
to fix building tests and examples when using GLib as a meson
subproject.
2017-07-13 22:22:16 -04:00
Matthias Clasen
b8c8bb73b0 Fix glib-genmarshal build with meson
This is no longer built from a C source, but a python file.
2017-07-13 19:35:09 -04:00
Matthias Clasen
653be67d7d Add gopenuriportal.c to the meson build
This was added recently.
2017-07-13 19:34:21 -04:00
Alessandro Decina
4db695bfb7 meson: replace meson.current_source_dir() with files()
As the meson reference doc says, files() is preferred over building
paths with current_source_dir().
2017-07-13 19:03:39 -04:00
Alessandro Decina
266bc1e510 meson: fix wrong #include's for gdbus_codegen files
When building glib as a subproject, #include's for xdp-dbus.h from xdp-dbus.c
and for gdbus-daemon-generated.h from gdbus-daemon-generated.c were generated as
being prefixed with the subproject prefix, eg
 #include "subproject/glib/gio/gdbus-daemon-generated.h".
That failed since the root of the build directory is obviously not part of the
include path when building a subproject.

Passing --output-directory @OUTDIR@ to gdbus-codegen and removing @OUTDIR@ from
--generate-c-code fixes the issue.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
dbf0a56670 glib-mkenums: pick up /*< nick=xyz >*/ annotation again
... in glib-mkenums python port.

Was parsed correctly but then skipped due to inverted condition.

https://bugzilla.gnome.org/show_bug.cgi?id=779332
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
4268372fae meson: error out if atomic ops would be available with -march=i486
Same as autotools build.
2017-07-13 19:03:39 -04:00
Thibault Saunier
0689231bd6 meson: Fix the build defining HAVE_RTLD_X
Otherwise RTLD_XXX get redefined.

https://bugzilla.gnome.org/show_bug.cgi?id=784133
2017-07-13 19:03:39 -04:00
Thibault Saunier
eb2196e89d meson: Fix building as a subproject
meson.source_root() returns the toplevel source directory
of the toplevel project, thus the paths were wrong when using
it. Simply using files() gets us the right path

https://bugzilla.gnome.org/show_bug.cgi?id=784133
2017-07-13 19:03:39 -04:00
Thibault Saunier
1d30c9eebc meson: Defining MAJOR_IN_ as done by AC_HEADER_MAJOR
https://bugzilla.gnome.org/show_bug.cgi?id=784133
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
10ae386727 meson: gio tests need to link against gobject as well
With meson from git dependencies of dependencies are no
longer added automatically and recursively to the linker
lines. Meaning dependencies that are used have to be
passed directly and explicitly or we'll get linker errors.
2017-07-13 19:03:39 -04:00