Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#792 closed Bug Report (fixed)

ganv requires cairo 1.10, but doesn't check for it

Reported by: colinf Owned by: dave
Priority: minor Component: Build System
Keywords: Cc:

Description

I suppose I'm an old stick-in-the-mud for persisting with Ubuntu 10.04 LTS when there is so much new shiny in the world, but I'm not quite ready to jump to anythig newer just yet.

Anyway, current svn fails to build on that platform, which has libcairo2-1.8.10.

ganv/ganv/canvas-base.h uses the cairo_region_t type, which was introduced in libcairo 1.10, leading to:

In file included from /home/colinf/src/drobilla-lad/ganv/ganv/canvas.h:19,

from /home/colinf/src/drobilla-lad/ganv/ganv/Canvas.hpp:25,
from ../ganv/src/Port.cpp:20:

/home/colinf/src/drobilla-lad/ganv/ganv/canvas-base.h:259:2: error: ISO C++ forbids declaration of ‘cairo_region_t’ with no type

Trying to hack around that with 'typedef GdkRegion? cairo_region_t;' just leads to a slew more build errors, so it looks like the dependency on the newer version is not trivially revertible.

It'd be nice to be able to build with older libcairo, but I guess if versions older than 1.10 really aren't supported any more, ./waf configure should at least check this.

Change History (7)

comment:1 Changed 2 years ago by dave

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r3926.

comment:2 Changed 2 years ago by colinf

Sadly, ./waf of r3926 still fails, for what look to me like similar cairo-version-related reasons:

[ 72/269] c: ganv/src/edge.c -> build/ganv/src/edge.c.4.o
../ganv/src/canvas-base.c: In function ‘shutdown_transients’:
../ganv/src/canvas-base.c:1061:3: warning: implicit declaration of function ‘g_slist_free_full’
../ganv/src/canvas-base.c: In function ‘paint’:
../ganv/src/canvas-base.c:1938:3: error: ‘cairo_rectangle_int_t’ undeclared (first use in this function)
../ganv/src/canvas-base.c:1938:3: error: (Each undeclared identifier is reported only once
../ganv/src/canvas-base.c:1938:3: error: for each function it appears in.)
../ganv/src/canvas-base.c:1938:26: error: ‘rect’ undeclared (first use in this function)
../ganv/src/canvas-base.c:1938:56: error: expected expression before ‘)’ token
../ganv/src/canvas-base.c: At top level:
../ganv/src/canvas-base.c:2367:1: warning: type defaults to ‘int’ in declaration of ‘cairo_rectangle_int_t’
../ganv/src/canvas-base.c:2367:42: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
../ganv/src/canvas-base.c:2380:1: warning: type defaults to ‘int’ in declaration of ‘cairo_rectangle_int_t’
../ganv/src/canvas-base.c:2380:68: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
../ganv/src/canvas-base.c: In function ‘ganv_canvas_base_request_redraw’:
../ganv/src/canvas-base.c:2412:30: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rect’
../ganv/src/canvas-base.c:2412:30: error: ‘rect’ undeclared (first use in this function)
../ganv/src/canvas-base.c:2412:37: error: expected expression before ‘{’ token
../ganv/src/canvas-base.c:2414:2: warning: implicit declaration of function ‘rect_is_visible’
../ganv/src/canvas-base.c:2418:2: error: ‘cairo_rectangle_int_t’ undeclared (first use in this function)
../ganv/src/canvas-base.c:2418:25: error: ‘r’ undeclared (first use in this function)

comment:3 Changed 2 years ago by colinf

Checking against the list of new symbols in cairo 1.10 at http://cairographics.org/manual/index-1.10.html, it looks to me as if cairo_rectangle_int_t is the only other cairo 1.10-specific thing used anywhere: I'm guessing that won't be unfeasibly hard to do without.

comment:4 Changed 2 years ago by dave

&%*!

comment:5 Changed 2 years ago by dave

Fixed in r3928.

comment:6 Changed 2 years ago by colinf

Brilliant, thank you! All the cairo-version-related build issues seem fixed now.

There's still a dependency on glib 2.28 that prevents building on Ubuntu 10.04 (which has 2.24): g_slist_free_full() came in with glib 2.28. It's a simple enough hack to define that function if glib is older, with something like:

Index: ganv/src/canvas-base.c
===================================================================
--- ganv/src/canvas-base.c	(revision 3928)
+++ ganv/src/canvas-base.c	(working copy)
@@ -1054,6 +1054,14 @@
 	canvas->idle_id = 0;
 }
 
+#if !GLIB_CHECK_VERSION(2,28,0)
+/* glib versions earlier than 2.28.0 don't provide g_slist_free_full() */
+void g_slist_free_full (GSList *list, GDestroyNotify free_func) {
+	g_slist_foreach(list, (GFunc) free_func, NULL);
+	g_slist_free(list);
+}
+
+#endif 
 /* Removes the transient state of the canvas (idle handler, grabs). */
 static void
 shutdown_transients(GanvCanvasBase* canvas)

comment:7 Changed 2 years ago by dave

Fixed in r3929, thanks.

Note: See TracTickets for help on using tickets.