Commit Graph

1453 Commits

Author SHA1 Message Date
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
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
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
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
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
Matej Knopp
dc9b01fd64 glib-mkenums: add back missing --fprod option
... in glib-mkenums python port.

https://bugzilla.gnome.org/show_bug.cgi?id=779332
https://bugzilla.gnome.org/show_bug.cgi?id=783198
2017-07-13 19:03:39 -04:00
Matej Knopp
29f9fe041b glib-mkenums: Fix parsing of multiline comments
... in glib-mkenums python port.

https://bugzilla.gnome.org/show_bug.cgi?id=779332
https://bugzilla.gnome.org/show_bug.cgi?id=783198
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
1672678bc4 glib-mkenums: fix parsing of /*< flags >*/ annotation
Fixes get_type function generation for:

 - GMountMountFlags
 - GDriveStartFlags
 - GResourceLookupFlags
 - GSocketMsgFlags
 - GTlsDatabaseVerifyFlags
 - GTestDBusFlags

which were registered as enum types before, which broke
some unit tests.

Problem is that the flags annotation has no value, so
options.get('flags') would always return None even if
it was present.

https://bugzilla.gnome.org/show_bug.cgi?id=779332
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
2d72a9e1d1 glib-mkenums: misc fixes to python port 2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
dd8ff54736 meson: Use Python port of glib-mkenums
This reduces the build-time dependencies of glib to only Python 3,
Meson, and git. Git is also optional if you provide a tarball in
which the subproject directories already exist.

The Python port was done by Jussi Pakkanen on bugzilla:
https://bugzilla.gnome.org/show_bug.cgi?id=779332

This version contains some fixes from that and also changes all
instances of `@` to `\u0040` because Meson does not yet provide a
configure_file() mode that ignores unknown @MACRO@ values.
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
ee94ad776e meson: Use proxy-libintl if gettext is not found
This is a stub-only library that can be used while building against
MSVC and contains no i18n machinery at all.

The dependencies added indirectly use the libintl.h header, and when
built as a subproject, the header won't be in a path known the
pre-processor.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
2f29ee1735 meson: add -fvisibility=hidden explicitly to selected targets
Don't use it project-wide for building everything. Otherwise
symbols for shared modules won't be exposed, e.g. in the
resourceplugin used by the gio resource unit test.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
34e4e25d53 meson: gio/tests: add more missing tests 2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
33fb1bbb61 meson: gio, gobject: use files() for headers list
Since these variables are referenced from other directories
such as the tests/ subdir as well.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
d29f022b0b meson: add support for dtrace/systemtap
Still at least one FIXME. And untested so far. It builds.
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
e2da3cb599 meson: Port to latest master (2.51.0)
Also remove headers from some gio sources. Headers do not need to be
added to the list of sources.

+ various smaller self-explanatory fixes.
2017-07-13 19:03:39 -04:00
Patrick Griffis
d10be6102f meson: Minor modernizations 2017-07-13 19:03:39 -04:00
Patrick Griffis
a690e2a375 meson: More build fixes
- Fix installing various data files
- Build translations
2017-07-13 19:03:39 -04:00
Nirbheek Chauhan
fe2a9887a8 meson: Improve MSVC and MinGW support and fix dependencies everywhere
Disable gio tests on Windows, fix .gitignore to not ignore
config.h.meson, and add more things to it.

Rename the library file naming and versioning to match what Autotools
outputs, e.g., libglib-2.0.so.0.5000.2 on Linux, libglib-2.0-0.dll  and
glib-2.0-0.dll on Windows with MSVC.

Several more tiny fixes, more executables built and installed, install
pkg-config and m4 files, fix building of gobject tests.

Changes to gdbus-codegen to support out-of-tree builds without
environment variables set (which you can't in Meson). We now add the
build directory to the Python module search path.
2017-07-13 19:03:39 -04:00
Tim-Philipp Müller
213957970e meson: Fix glib, add gobject, gio, gthread, gmodule, etc
Several small fixes to the build files.

Lots of tests have also been added, and glib tests pass now.
2017-07-13 19:03:39 -04:00
Matthias Clasen
41385745e7 Revert "mkenums: Support public/private trigraph"
This reverts commit 9ba17d511e.

This conflicts with the python port in the meson branch.
2017-07-13 19:03:00 -04:00
Emmanuele Bassi
c6793d1cfb Allow whitespace between marshallers list tokens
Some (older) list files use whitespace, and we need to take that into
account when splitting off the various tokens.
2017-07-11 18:25:26 +01:00
Emmanuele Bassi
30b961607a Avoid a leak for arguments in va_list marshallers
We need to revers a check on whether the list of arguments needs
unboxing.
2017-07-11 12:24:10 +01:00
Emmanuele Bassi
ea365530d2 Do not mix declarations and statements
Projects using glib-genmarshal may still wish to support C89.
2017-07-11 12:15:44 +01:00
Emmanuele Bassi
9c66e65b29 Remove unused marshallers-related files
We don't use gmarshal.list any more, and the generated gmarshal.strings
file is not used after the Python port of glib-genmarshal.

https://bugzilla.gnome.org/show_bug.cgi?id=784528
2017-07-10 16:47:48 +01:00
Emmanuele Bassi
f7643a7df7 Re-enable signal tests when cross-compiling
The glib-genmarshal tool has been rewritten in Python, which means we
can run it when cross-compiling.

https://bugzilla.gnome.org/show_bug.cgi?id=784528
2017-07-10 16:47:48 +01:00
Emmanuele Bassi
93f16a45ab Rewrite glib-genmarshal in Python
We're in the process or rewriting other tools in Python to reduce the
number of dependencies of GLib.

Additionally, making glib-genmarshal a Python script reduces the
complexity when cross-compiling, as we don't need a native build to
generate the marshallers.

https://bugzilla.gnome.org/show_bug.cgi?id=784528
2017-07-10 16:47:47 +01:00
Philip Withnall
a131134918 build: Drop nmake/MSC build system for GLib
It hasn’t been seriously maintained for the best part of 10 years and is
very outdated. The recommended way to build GLib on Windows is now
Visual Studio:

https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack#GLib

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=722047
2017-07-10 11:22:40 +01:00
Colin Walters
017f78d77f gtype: Add private DEFINE_TYPE with prelude to workaround gtype deadlocks
And use it in GSocket, as it had a real-world case reported.

https://bugzilla.gnome.org/show_bug.cgi?id=674885
2017-06-14 14:45:45 -04:00
Sébastien Wilmet
6b948d9613 gobject/: LGPLv2+ -> LGPLv2.1+
All gobject/*.{c,h} files have been processed.

gmarshal.c and gmarshal.h don't have a license header.

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-24 11:58:19 +02:00
Sébastien Wilmet
308bc41fb9 gobject/tests/: LGPLv2+ -> LGPLv2.1+
A lot of tests in gobject/tests/ don't have a license header. And some
tests are licensed under a BSD-style license.

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-24 11:58:19 +02:00
Emmanuele Bassi
9ba17d511e mkenums: Support public/private trigraph
It is possible, when using GTK-Doc, to mark sections of an enumeration
type as "private": the values are there, but they are not documented,
and GTK-Doc won't complain about missing symbols:

    typedef enum {
      /*< private >*/
      MY_FOO_PRIVATE,

      /*< public >*/
      MY_FOO_VALUE_A,
      MY_FOO_VALUE_B,

      /*< private >*/
      MY_FOO_VALUE_C,
      MY_FOO_VALUE_D
    } MyFooValue;

The glib-mkenums parser also allows skipping enumeration values, using a
slightly different syntax:

    typedef enum P
      MY_BAR_PRIVATE, /*< skip >*/
      MY_BAR_VALUE_A,
      MY_BAR_VALUE_B
    } MyBarValue;

The annotation must sit on the same line as the enumeration value.

Both GTK-Doc and glib-mkenum use the same trigraph syntax, but slightly
different keys. This makes combining them slightly redundant, but
feasible.

All would be well and good, except that glib-mkenum will generate a
warning for lines it does not understand — and that includes the GTK-Doc
annotation trigraph, which, when confronted with the MyFooValue
enumeration above, will result in a warning like:

    glib-mkenums: myfoo.h:2: Failed to parse `  /*< private >*/ '
    glib-mkenums: myfoo.h:5: Failed to parse `  /*< public >*/ '
    glib-mkenums: myfoo.h:9: Failed to parse `  /*< private >*/ '

Of course, we could make glib-mkenum ignore any trigraph comment on a
stand alone line, but it would probably be better to ensure that both
glib-mkenums and gtk-doc behave consistently with each other, and
especially with the maintainer's intent of hiding some values from the
user, and reserving them for internal use.

So we should ensure that glib-mkenums automatically skips all the
enumeration values after a "private" flag has been set, until it reaches
a "public" stanza.

https://bugzilla.gnome.org/show_bug.cgi?id=782162
2017-05-16 11:23:50 +01:00
Mohammed Sadiq
274f336f6a docs: Trivial typo fixes
The presence of space was resulting in wrongly rendered documentation
in devhelp (and probably in other documentations).

https://bugzilla.gnome.org/show_bug.cgi?id=782068
2017-05-16 11:22:54 +01:00
Emmanuele Bassi
17a3c782db genmarshal: Always generate the prototypes in the body
This way code that does not manually include the generated marshallers
header and wishes to build with `-Wmissing-prototypes` will not generate
a compiler warning.

https://bugzilla.gnome.org/show_bug.cgi?id=781755
2017-04-28 17:39:14 +01:00
Emmanuele Bassi
616cff7c87 genmarshal: Use fewer magic numbers
https://bugzilla.gnome.org/show_bug.cgi?id=781755
2017-04-28 17:39:14 +01:00
Emmanuele Bassi
a8b5192d16 genmarshal: Constify global variables
https://bugzilla.gnome.org/show_bug.cgi?id=781755
2017-04-28 17:39:14 +01:00
Emmanuele Bassi
1ffad8fed9 genmarshal: Conform --help output to conventions
The convention for arguments taking a value is:

  --argument=VALUE

with the `VALUE` in caps.

https://bugzilla.gnome.org/show_bug.cgi?id=781755
2017-04-28 17:39:14 +01:00
Emmanuele Bassi
f952fdf3fc Drop trailing semi-colon from G_DEFINE_ macro
It's unnecessary, and only adds visual noise; we have been fairly
inconsistent in the past, but the semi-colon-less version clearly
dominates in the code base.

https://bugzilla.gnome.org/show_bug.cgi?id=669355
2017-04-10 10:38:31 +01:00
Tim-Philipp Müller
a83ccc535f gobject: remove duplicate GType sanity check
This is going to be checked again by g_object_new_with_properties()
and g_object_new_valist() anyway, so might just as well leave it
to those functions to do the check and only do it once. It doesn't
matter which function emits the critical warning in the end either,
as one has to look at a stack trace to find out what code triggered
it in any case.

https://bugzilla.gnome.org/show_bug.cgi?id=780908
2017-04-08 01:20:29 -04:00
Philip Withnall
2f2c2b6362 gobject: Fix Since/Deprecated versions for GParameter replacement API
This slipped through the review cracks.

https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 11:09:53 +01:00
Fabian Orccon
e2c3b7f634 gobject: Deprecate g_object_newv
g_object_newv uses a GParameter as argument. Since GParameter
is deprecated due to this type is not introspectible,
g_object_newv is deprecated now.

https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 11:00:23 +01:00
Fabian Orccon
2646c21735 gobject: Deprecate GParameter
GParameter is a rarely used type and not introspectible.

https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 11:00:23 +01:00
Fabian Orccon
942edbc700 tests: Add test for gobject properties for g_object_newv/setv/getv
https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 11:00:23 +01:00
Fabian Orccon
c6d373bfe7 gobject: Add g_object_setv and g_object_getv functions
https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 10:38:30 +01:00
Fabian Orccon
26b211ef89 gobject: Add g_object_new_with_properties
g_object_new_with_properties is an alternative to g_object_newv.
The last one, takes an array of GParameter. However, GParameter
is a rarely used type and this type is not introspectible, so
it will not work properly in bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 10:38:30 +01:00
Fabian Orccon
19e81dedc9 gobject: Add helper functions to handle warnings in g_object_new/set/get
g_object_new_is_valid_property
g_object_get_is_valid_property
g_object_set_is_valid_property

https://bugzilla.gnome.org/show_bug.cgi?id=709865
2017-03-31 10:38:30 +01:00