Latest pango package fails to build on pre cairo 1.8 systems

Using latest ruby-gnome2 from git.

So with the recent change to rbpangocairo.c, I get a compile failure

Error is:
rbpangocairo.c:40: error: ‘CAIRO_FONT_TYPE_USER’ undeclared (first use
in this function)

Looking at the latest cairo.h file it looks like CAIRO_FONT_TYPE_USER
was added in cairo 1.8.

I’m still stuck using cairo-1.2.4(supporting under RHEL 5.9)

This leaves me with this for the typedef in cairo.h
typedef enum _cairo_font_type {
CAIRO_FONT_TYPE_TOY,
CAIRO_FONT_TYPE_FT,
CAIRO_FONT_TYPE_WIN32,
CAIRO_FONT_TYPE_ATSUI
} cairo_font_type_t;

Where as the newest is

typedef enum _cairo_font_type {
CAIRO_FONT_TYPE_TOY,
CAIRO_FONT_TYPE_FT,
CAIRO_FONT_TYPE_WIN32,
CAIRO_FONT_TYPE_QUARTZ,
CAIRO_FONT_TYPE_USER
} cairo_font_type_t;

I was thinking I could put something like this to check the version

if CAIRO_CHECK_VERSION(1, 8, 0)

But not sure what else I would do. Other than maybe if older than 1.8
use the previous version where it just returned…
return GOBJ2RVAL(pango_cairo_font_map_new());

But I see kou put those changes in for a specific bug fix. I’m happy to
play around with it and do a pull request. Just not sure of the best way
to fix it.

Thanks

But I see kou put those changes in for a specific bug fix. I’m happy to
play around with it and do a pull request. Just not sure of the best way
to fix it.

You can disable rg_s_create() (Pango::CairoFontMap.create)
by “#if CAIRO_CHECK_VERSION(1, 8, 0)”!

Done, submitted pull request.

Hi,

In [email protected]
“[ruby-gnome2-devel-en] latest pango package fails to build on pre
cairo 1.8 systems” on Tue, 09 Jul 2013 07:23:46 +0200,
Grant S. [email protected] wrote:

I was thinking I could put something like this to check the version

if CAIRO_CHECK_VERSION(1, 8, 0)

But not sure what else I would do. Other than maybe if older than 1.8
use the previous version where it just returned…
return GOBJ2RVAL(pango_cairo_font_map_new());

But I see kou put those changes in for a specific bug fix. I’m happy to
play around with it and do a pull request. Just not sure of the best way
to fix it.

You can disable rg_s_create() (Pango::CairoFontMap.create)
by “#if CAIRO_CHECK_VERSION(1, 8, 0)”!

Thanks,

kou

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] latest pango package fails to build on pre
cairo 1.8 systems” on Tue, 09 Jul 2013 21:27:40 +0200,
Grant S. [email protected] wrote:

But I see kou put those changes in for a specific bug fix. I’m happy to
play around with it and do a pull request. Just not sure of the best way
to fix it.

You can disable rg_s_create() (Pango::CairoFontMap.create)
by “#if CAIRO_CHECK_VERSION(1, 8, 0)”!

Done, submitted pull request.

Thanks!
I’ve merged it!


kou