# Latest pango package fails to build on pre cairo 1.8 systems

**URL:** <https://www.ruby-forum.com/t/latest-pango-package-fails-to-build-on-pre-cairo-1-8-systems/245774>\
**Category:** Ruby-Gnome 2\
**Created:** [July 9, 2013, 7:23am UTC](https://www.ruby-forum.com/t/latest-pango-package-fails-to-build-on-pre-cairo-1-8-systems/245774 "2013-07-09T07:23:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [July 9, 2013, 7:23am UTC](https://www.ruby-forum.com/t/latest-pango-package-fails-to-build-on-pre-cairo-1-8-systems/245774/1 "2013-07-09T07:23:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![grantspeelman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@grantspeelman](https://www.ruby-forum.com/u/grantspeelman)\
**Post date:** [July 9, 2013, 9:27pm UTC](https://www.ruby-forum.com/t/latest-pango-package-fails-to-build-on-pre-cairo-1-8-systems/245774/2 "2013-07-09T21:27:40Z")

</div>

> > 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.

---

<div class="post-metadata">

**Author:** ![grantspeelman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@grantspeelman](https://www.ruby-forum.com/u/grantspeelman)\
**Post date:** [July 9, 2013, 4:03pm UTC](https://www.ruby-forum.com/t/latest-pango-package-fails-to-build-on-pre-cairo-1-8-systems/245774/3 "2013-07-09T16:03:10Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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

---

<div class="post-metadata">

**Author:** ![grantspeelman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@grantspeelman](https://www.ruby-forum.com/u/grantspeelman)\
**Post date:** [July 13, 2013, 4:20am UTC](https://www.ruby-forum.com/t/latest-pango-package-fails-to-build-on-pre-cairo-1-8-systems/245774/4 "2013-07-13T04:20:56Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
