Forum: Ruby-Gnome 2 latest pango package fails to build on pre cairo 1.8 systems

C53e81f5d7c781c6dc3979c4ce888706?d=identicon&s=25 Grant Schoep (matobinder)
on 2013-07-09 07:23
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
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2013-07-09 16:03
(Received via mailing list)
Hi,

In <a6a3acfc2d3ede1cc339f5b7dc5b9f24@ruby-forum.com>
  "[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 Schoep <ruby-forum-incoming@andreas-s.net> 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
C53e81f5d7c781c6dc3979c4ce888706?d=identicon&s=25 Grant Schoep (matobinder)
on 2013-07-09 21:27
>> 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.
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2013-07-13 04:20
(Received via mailing list)
Hi,

In <0a5e87398e6efa259a120133dba68052@ruby-forum.com>
  "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 Schoep <ruby-forum-incoming@andreas-s.net> 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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.