Iniciandome con clutter y gnome-games

Como proyecto personal voy a intentar migrar a Clutter el juego gnobots2 utilizando el upstream de Clutter al menos hasta que salga la primer 1.0 estable.

Comienzo haciendo clone de todo gnome-games, clutter y clutter-gtk
$ git clone http://git.gnome.org/gnome-games
$ git clone git://git.clutter-project.org/clutter
$ git clone git://git.clutter-project.org/clutter-gtk

Compilo clutter y clutter-gtk.
Dentro de la carpeta gnome-games aplico el siguiente parche para que me deje funcionando clutter adentro de gnobots2 aplico estos dos pareches.

From 98601c7991dfed4b8a544133866070ffe11d7261 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Diego=20L=C3=B3pez=20Le=C3=B3n?=
Date: Sun, 26 Apr 2009 03:09:40 -0300
Subject: [PATCH] modified to use clutter 0.9

---
configure.in | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/configure.in b/configure.in
index 968405e..3329f08 100644
--- a/configure.in
+++ b/configure.in
@@ -562,8 +562,8 @@ fi
if test "$enable_clutter" = "yes"; then
CLUTTER_API_VERSION=
AC_MSG_CHECKING([for clutter API version])
- for API_VERSION in 0.8; do
- PKG_CHECK_EXISTS([clutter-$API_VERSION clutter-cairo-$API_VERSION],
+ for API_VERSION in 0.9; do
+ PKG_CHECK_EXISTS([clutter-$API_VERSION],
[CLUTTER_API_VERSION=$API_VERSION; break],[])
done
if test -z "$CLUTTER_API_VERSION"; then
@@ -571,13 +571,11 @@ if test "$enable_clutter" = "yes"; then
fi
AC_MSG_RESULT([$CLUTTER_API_VERSION])

- CLUTTER_REQUIRED=0.8.8
- CLUTTER_GTK_REQUIRED=0.8.3
- CLUTTER_CAIRO_REQUIRED=0.8.2
+ CLUTTER_REQUIRED=0.9.3
+ CLUTTER_GTK_REQUIRED=0.9.0

PKG_CHECK_MODULES([CLUTTER],[
- clutter-$CLUTTER_API_VERSION >= $CLUTTER_REQUIRED
- clutter-cairo-$CLUTTER_API_VERSION >= $CLUTTER_CAIRO_REQUIRED])
+ clutter-$CLUTTER_API_VERSION >= $CLUTTER_REQUIRED])
AC_SUBST([CLUTTER_CFLAGS])
AC_SUBST([CLUTTER_LIBS])

--
1.6.2.4

y luego

From 7517b3108fd3dce3bfb03b272c13115d0025db08 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Diego=20L=C3=B3pez=20Le=C3=B3n?=
Date: Sun, 26 Apr 2009 05:03:08 -0300
Subject: [PATCH] add clutter as dependency for gnobots2

---
gnobots2/Makefile.am | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/gnobots2/Makefile.am b/gnobots2/Makefile.am
index 377ad20..0924855 100644
--- a/gnobots2/Makefile.am
+++ b/gnobots2/Makefile.am
@@ -59,6 +59,12 @@ gnobots2_CFLAGS += $(GHTREAD_CFLAGS)
gnobots2_LDADD += $(GTHREAD_LIBS)
endif

+if HAVE_CLUTTER
+gnobots2_CFLAGS += $(CLUTTER_CFLAGS) $(CLUTTER_GTK_CFLAGS)
+gnobots2_LDADD += $(CLUTTER_LIBS) $(CLUTTER_GTK_LIBS)
+endif
+
+
pixmapdir = $(pkgdatadir)/gnobots2/pixmaps
pixmap_DATA = gnomes.png \
yahoo.png \
--
1.6.2.4

Esto nos va a dar la posibilidad de habilitar clutter en el desarrollo de gnobots2.
Antes de trabajar hay que decirle a dónde buscar los .pc de clutter que acabamos de compilar. En mi caso sería:
$ export PKG_CONFIG_PATH=~/dev-new/c/clutter-upstream/dist/lib/pkgconfig:~/dev-new/c/clutter-gtk-upstream/dist/lib/pkgconfig
Ahora corremos el autogen.sh, con el fin que yo persigo sería:
$ ./autogen.sh –prefix=`pwd`/dist –enable-games=gnobots2 –enable-clutter
$ make && make install
esto nos dejaría listo en dist/bin/gnobots2 el ejecutable y ya en el código podemos agregar nuestras amigas líneas de uso de clutter

Más info de clutter, leer este tutorial.
En la próxima espero ya postear avances concretos sobre el juego

Leave a comment