mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
Work around g-ir-scanner problem with Gdk.Rectangle
g-ir-scanner is currently buggy and confuses the Gdk.Rectangle alias with MetaRectangle. Since this is moderately hard to fix in gobject-introspection and the fix would conflict with in-progress changes, work around by doing a 'sed job' on the generated Meta.gir. https://bugzilla.gnome.org/show_bug.cgi?id=623639
This commit is contained in:
parent
37de1b2d25
commit
7853bb8042
@ -534,6 +534,9 @@ if test "x$GCC" = "xyes"; then
|
|||||||
CFLAGS="$CFLAGS -Wall -Werror -ansi"
|
CFLAGS="$CFLAGS -Wall -Werror -ansi"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# For fix-meta-rectangle.py
|
||||||
|
AM_PATH_PYTHON([2.5])
|
||||||
|
|
||||||
# Use gnome-doc-utils:
|
# Use gnome-doc-utils:
|
||||||
GNOME_DOC_INIT([0.8.0])
|
GNOME_DOC_INIT([0.8.0])
|
||||||
|
|
||||||
|
@ -223,7 +223,10 @@ Meta-$(api_version).gir: $(G_IR_SCANNER) mutter $(libmutterinclude_HEADERS) $(mu
|
|||||||
$(filter %.c,$(mutter_SOURCES)) \
|
$(filter %.c,$(mutter_SOURCES)) \
|
||||||
$(libmutterinclude_base_headers) \
|
$(libmutterinclude_base_headers) \
|
||||||
$(INCLUDES) \
|
$(INCLUDES) \
|
||||||
-o $$pwd/$@
|
-o $$pwd/$@.tmp && \
|
||||||
|
$(PYTHON) $(srcdir)/fix-meta-rectangle.py $$pwd/$@.tmp $$pwd/$@.tmp2 && \
|
||||||
|
rm $$pwd/$@.tmp && \
|
||||||
|
mv $$pwd/$@.tmp2 $$pwd/$@
|
||||||
|
|
||||||
Meta-$(api_version).typelib: $(G_IR_COMPILER) Meta-$(api_version).gir
|
Meta-$(api_version).typelib: $(G_IR_COMPILER) Meta-$(api_version).gir
|
||||||
$(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) Meta-$(api_version).gir -o $@
|
$(AM_V_GEN) LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) Meta-$(api_version).gir -o $@
|
||||||
@ -300,6 +303,7 @@ EXTRA_DIST=$(desktopfiles_files) \
|
|||||||
$(desktopfiles_in_files) \
|
$(desktopfiles_in_files) \
|
||||||
$(wmproperties_in_files) \
|
$(wmproperties_in_files) \
|
||||||
$(schema_in_files) \
|
$(schema_in_files) \
|
||||||
|
fix-meta-rectangle.py \
|
||||||
libmutter-private.pc.in \
|
libmutter-private.pc.in \
|
||||||
mutter-plugins.pc.in \
|
mutter-plugins.pc.in \
|
||||||
mutter-enum-types.h.in \
|
mutter-enum-types.h.in \
|
||||||
|
21
src/fix-meta-rectangle.py
Executable file
21
src/fix-meta-rectangle.py
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# gobject-introspection currently has a bug where an alias like
|
||||||
|
# 'typedef GdkRectangle cairo_rect_int_t' is stored un-namespaced,
|
||||||
|
# so it is taken to apply to all *Rectangle types. Fixing this
|
||||||
|
# requires a significant rework of g-ir-scanner, so for the moment
|
||||||
|
# we fix up the output using this script.
|
||||||
|
#
|
||||||
|
# https://bugzilla.gnome.org/show_bug.cgi?id=622609
|
||||||
|
|
||||||
|
GDK_RECTANGLE = re.compile(r'Gdk\.Rectangle')
|
||||||
|
META_RECTANGLE = re.compile(r'MetaRectangle')
|
||||||
|
|
||||||
|
i = open(sys.argv[1], 'r')
|
||||||
|
o = open(sys.argv[2], 'w')
|
||||||
|
for line in i:
|
||||||
|
if GDK_RECTANGLE.search(line) and META_RECTANGLE.search(line):
|
||||||
|
line = re.sub('Gdk.Rectangle', 'Rectangle', line)
|
||||||
|
o.write(line)
|
Loading…
Reference in New Issue
Block a user