# A potential patch for rcairo

**URL:** <https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823>\
**Category:** Ruby-Gnome 2\
**Created:** [September 14, 2011, 2:46pm UTC](https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823 "2011-09-14T14:46:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 14, 2011, 2:46pm UTC](https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823/1 "2011-09-14T14:46:07Z")

</div>

Hi!

(I realize that this is the wrong list, but Kouhei is on this list,  
and it’s related to Ruby-GNOME2, so I’m letting it slide.)

I have attached a small diff to rcairo-1.10.0 to allow it to be  
compiled with less warnings on Windows (MINGW) (unused functions and  
signed/unsigned comparison). There’s also a problem with  
ext/cairo/extconf.rb if you’re not cross-compiling (see the =begin …  
=end block). What’s the reason for the implib? Also, messing with  
pkgconfig like that won’t work if I’ve actually compiled cairo myself.

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 15, 2011, 3:32pm UTC](https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823/2 "2011-09-15T15:32:34Z")

</div>

Hi,

In [CADdV=removed\_email\_address@domain.invalid](mailto:CADdV=removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] A potential patch for rcairo” on Wed, 14 Sep  
2011 14:45:06 +0200,  
Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have attached a small diff to rcairo-1.10.0 to allow it to be  
> compiled with less warnings on Windows (MINGW) (unused functions and  
> signed/unsigned comparison).

I’ve merged them. Thanks!

> ```
> There$B!G(Bs also a problem with
> 
> ```
> 
> ext/cairo/extconf.rb if you$B!G(Bre not cross-compiling (see the =begin $B!D(B  
> =end block). What$B!G(Bs the reason for the implib? Also, messing with  
> pkgconfig like that won$B!G(Bt work if I$B!G(Bve actually compiled cairo myself.

implib is used to build Ruby/GTK2 with rcairo.  
Please put your compiled cairo into vendor/local/.  
The extconf is desgined to build binary bundled gem. It’s  
not designed for self build user on Windows.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 15, 2011, 3:35pm UTC](https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823/3 "2011-09-15T15:35:39Z")

</div>

2011/9/15 Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ```
> > There’s also a problem with
> > 
> > ```
> > 
> > ext/cairo/extconf.rb if you’re not cross-compiling (see the =begin …  
> > =end block). What’s the reason for the implib? Also, messing with  
> > pkgconfig like that won’t work if I’ve actually compiled cairo myself.

> implib is used to build Ruby/GTK2 with rcairo.  
> Please put your compiled cairo into vendor/local/.  
> The extconf is desgined to build binary bundled gem. It’s  
> not designed for self build user on Windows.

OK. Can I provide a patch that makes it possible for it to do both?  
(An environment variable or similar would do, I suppose.)

Also, I noticed that Ruby-GNOME2 mentions that setting CAIRO\_PATH  
should do something, but I don’t think that it actually works. What I  
did to get everything working in the end was placing rcairo at the  
same directory level as ruby-gnome2 and renaming it rcairo.win32.  
That way ruby-gnome2 found it and everything worked.

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 15, 2011, 3:48pm UTC](https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823/4 "2011-09-15T15:48:37Z")

</div>

Hi,

In [CADdV=Mut4yFnCAOvUV9hsrwgj=K=LUJLKm4cJR=removed\_email\_address@domain.invalid](mailto:CADdV=Mut4yFnCAOvUV9hsrwgj=K=LUJLKm4cJR=removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] A potential patch for rcairo” on Thu, 15  
Sep 2011 15:34:57 +0200,  
Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > The extconf is desgined to build binary bundled gem. It’s  
> > not designed for self build user on Windows.
> 
> OK. Can I provide a patch that makes it possible for it to do both?  
> (An environment variable or similar would do, I suppose.)

Yes. Sure.

> Also, I noticed that Ruby-GNOME2 mentions that setting CAIRO\_PATH  
> should do something, but I don’t think that it actually works. What I  
> did to get everything working in the end was placing rcairo at the  
> same directory level as ruby-gnome2 and renaming it rcairo.win32.  
> That way ruby-gnome2 found it and everything worked.

Now, CAIRO\_PATH isn’t used. It’s old information… Colud  
you remove it?

Ruby-GNOME2 can find installed rcairo gem. Is it good  
enough? If it’s not good enough, it seems good that adding  
an option to extconf.rb something like --with-rcairo-path.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 15, 2011, 6:23pm UTC](https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823/5 "2011-09-15T18:23:47Z")

</div>

On Thu, Sep 15, 2011 at 15:47, Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > 2011/9/15 Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> > 
> > > The extconf is desgined to build binary bundled gem. It’s  
> > > not designed for self build user on Windows.

> > OK. Can I provide a patch that makes it possible for it to do both?  
> > (An environment variable or similar would do, I suppose.)

> Yes. Sure.

Would something like

unless $configure\_args[‘–without-vendor-override’]  
…  
end

work?

> > Also, I noticed that Ruby-GNOME2 mentions that setting CAIRO\_PATH  
> > should do something, but I don’t think that it actually works. What I  
> > did to get everything working in the end was placing rcairo at the  
> > same directory level as ruby-gnome2 and renaming it rcairo.win32.  
> > That way ruby-gnome2 found it and everything worked.

> Now, CAIRO\_PATH isn’t used. It’s old information… Colud  
> you remove it?

Yes, I’ll remove it. I’ll try to unify the handling of cairo. It’s  
repeated in pango, gtk+, and other places.

> Ruby-GNOME2 can find installed rcairo gem. Is it good  
> enough? If it’s not good enough, it seems good that adding  
> an option to extconf.rb something like --with-rcairo-path.

Well, I don’t want to use the gem ;-). I’ll see what I can come up  
with tomorrow.

It˚s unfortunate that rcairo is in a separate repository…

---

<div class="post-metadata">

**Author:** ![Nikolai\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/df705f/32.png) [@Nikolai\_W](https://www.ruby-forum.com/u/Nikolai_W)\
**Post date:** [September 16, 2011, 10:36am UTC](https://www.ruby-forum.com/t/a-potential-patch-for-rcairo/211823/6 "2011-09-16T10:36:17Z")

</div>

On Thu, Sep 15, 2011 at 18:23, Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Would something like
> 
> unless $configure\_args[‘–without-vendor-override’]  
> …  
> end
> 
> work?

Patch sent to removed\_email\_address@domain.invalid
