Installing Green Shoes on OSX Snow Leopard
- From:
- Timothy Barnes
- Date:
- 2011-07-03 @ 01:29
I am trying to get green shoes to work on Snow Leopard. I used homebrew to
install gtk+ and rvm to install ruby 1.9.2-p180. I believe that I installed
cairo v1.10.0 correctly, but when I try gtk2 0.90.5 I get the error messages
below. I have tried all I know. Any advice?
barnes7td (Timothy)
------------
Building native extensions. This could take a while...
ERROR: Error installing cairo:
ERROR: Failed to build gem native extension.
/Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for GCC... yes
checking for Win32 OS... no
checking for Mac OS X... yes
checking for cairo version (>= 1.2.0)... yes
checking for HAVE_RUBY_ST_H in ruby.h... yes
checking for HAVE_RUBY_IO_H in ruby.h... yes
checking for rb_errinfo() in ruby.h... yes
checking for enum ruby_value_type in ruby.h... yes
creating Makefile
make
gcc -I.
-I/Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/x86_64-darwin10.6.0
-I/Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/backward
-I/Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1 -I.
-DRB_CAIRO_COMPILATION -DHAVE_RB_ERRINFO -DHAVE_TYPE_ENUM_RUBY_VALUE_TYPE
-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra
-Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings
-Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long
-fno-common -pipe -Wall -I/opt/local/include/cairo
-I/opt/local/include/freetype2 -I/opt/local/include
-I/opt/local/include/libpng12 -I/usr/X11/include -DXTHREADS -o rb_cairo.o
-c rb_cairo.c
In file included from rb_cairo.c:17:
rb_cairo.h:20:19: error: cairo.h: No such file or directory
In file included from rb_cairo.c:17:
rb_cairo.h:205: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:206: error: expected ‘)’ before ‘*’ token
rb_cairo.h:208: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:209: error: expected ‘)’ before ‘*’ token
rb_cairo.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:212: error: expected ‘)’ before ‘*’ token
rb_cairo.h:219: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:220: error: expected ‘)’ before ‘*’ token
rb_cairo.h:222: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:223: error: expected ‘)’ before ‘*’ token
rb_cairo.h:225: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:226: error: expected ‘)’ before ‘*’ token
rb_cairo.h:228: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:229: error: expected ‘)’ before ‘*’ token
rb_cairo.h:231: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:232: error: expected ‘)’ before ‘*’ token
rb_cairo.h:234: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:235: error: expected ‘)’ before ‘*’ token
rb_cairo.h:237: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:238: error: expected ‘)’ before ‘*’ token
rb_cairo.h:245: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘*’ token
rb_cairo.h:246: error: expected ‘)’ before ‘*’ token
rb_cairo.h:248: error: expected ‘)’ before ‘*’ token
rb_cairo.h:293: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_operator_from_ruby_object’
rb_cairo.h:294: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_antialias_from_ruby_object’
rb_cairo.h:295: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_fill_rule_from_ruby_object’
rb_cairo.h:296: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_line_cap_from_ruby_object’
rb_cairo.h:297: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_line_join_from_ruby_object’
rb_cairo.h:298: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_font_slant_from_ruby_object’
rb_cairo.h:299: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_font_weight_from_ruby_object’
rb_cairo.h:300: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_subpixel_order_from_ruby_object’
rb_cairo.h:301: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_hint_style_from_ruby_object’
rb_cairo.h:302: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_hint_metrics_from_ruby_object’
rb_cairo.h:303: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_path_data_type_from_ruby_object’
rb_cairo.h:304: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_content_from_ruby_object’
rb_cairo.h:305: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_format_from_ruby_object’
rb_cairo.h:306: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_extend_from_ruby_object’
rb_cairo.h:307: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘rb_cairo_filter_from_ruby_object’
rb_cairo.h:331: error: expected ‘)’ before ‘status’
In file included from rb_cairo.c:18:
rb_cairo_private.h:81: error: expected declaration specifiers or ‘...’
before ‘cairo_glyph_t’
rb_cairo_private.h:84: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘rb_cairo__is_kind_of’
rb_cairo_private.h:112: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘rb_cairo__exception_to_status’
rb_cairo.c: In function ‘rb_cairo_satisfied_version’:
rb_cairo.c:40: error: ‘CAIRO_VERSION_MAJOR’ undeclared (first use in this
function)
rb_cairo.c:40: error: (Each undeclared identifier is reported only once
rb_cairo.c:40: error: for each function it appears in.)
rb_cairo.c:40: error: ‘CAIRO_VERSION_MINOR’ undeclared (first use in this
function)
rb_cairo.c:40: error: ‘CAIRO_VERSION_MICRO’ undeclared (first use in this
function)
rb_cairo.c:31: warning: unused parameter ‘self’
rb_cairo.c: In function ‘Init_cairo’:
rb_cairo.c:59: error: ‘CAIRO_VERSION_MAJOR’ undeclared (first use in this
function)
rb_cairo.c:60: error: ‘CAIRO_VERSION_MINOR’ undeclared (first use in this
function)
rb_cairo.c:61: error: ‘CAIRO_VERSION_MICRO’ undeclared (first use in this
function)
rb_cairo.c:63: warning: implicit declaration of function ‘cairo_version’
make: *** [rb_cairo.o] Error 1
Gem files will remain installed in
/Users/Timothy/.rvm/gems/ruby-1.9.2-p180/gems/cairo-1.10.0 for inspection.
Results logged to
/Users/Timothy/.rvm/gems/ruby-1.9.2-p180/gems/cairo-1.10.0/ext/cairo/gem_make.out
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- ashbb
- Date:
- 2011-07-04 @ 13:16
Hi Timothy,
> I am trying to get green shoes to work on Snow Leopard.
Great!
But sorry, I can't help anything about OS X. :(
Could you post your problem into ruby-list ML?
I think we need Ruby/GTK2 developer's help.
ashbb
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- ashbb
- Date:
- 2011-07-04 @ 21:35
Oops, mistook. xx-P
Not ruby-list ML, but ruby-talk ML.
The ruby-list is in Japanese ML and ruby-talk is in English.
ashbb
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- H. Sasse
- Date:
- 2011-07-05 @ 20:31
I've never really used a mac, not constructed an extension myself, so
please be
skeptical about what I say here. So, with the "here be dragons" out
of the way...
On 03/07/2011 02:29, Timothy Barnes wrote:
> I am trying to get green shoes to work on Snow Leopard. I used
> homebrew to install gtk+ and rvm to install ruby 1.9.2-p180. I
> believe that I installed cairo v1.10.0 correctly, but when I try gtk2
> 0.90.5 I get the error messages below. I have tried all I know. Any
> advice?
>
> barnes7td (Timothy)
>
> ------------
>
> Building native extensions. This could take a while...
> ERROR: Error installing cairo:
> ERROR: Failed to build gem native extension.
>
> /Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
> checking for GCC... yes
> checking for Win32 OS... no
> checking for Mac OS X... yes
> checking for cairo version (>= 1.2.0)... yes
Hmm, I wonder how it is doing that. Anyway...
> checking for HAVE_RUBY_ST_H in ruby.h... yes
> checking for HAVE_RUBY_IO_H in ruby.h... yes
> checking for rb_errinfo() in ruby.h... yes
> checking for enum ruby_value_type in ruby.h... yes
> creating Makefile
And that's all extconf.rb has to say about cairo??
>
> make
> gcc -I.
>
-I/Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/x86_64-darwin10.6.0
>
I've not ventured into RVM yet, but I'm not sure about the 192 including
1.9.1, but it isn't looking
in another source tree, so I'll plead ignorance here
> -I/Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/ruby/backward
> -I/Users/Timothy/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1 -I.
> -DRB_CAIRO_COMPILATION -DHAVE_RB_ERRINFO
> -DHAVE_TYPE_ENUM_RUBY_VALUE_TYPE -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE
> -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses
> -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers
> -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -Wall
> -I/opt/local/include/cairo -I/opt/local/include/freetype2
> -I/opt/local/include -I/opt/local/include/libpng12 -I/usr/X11/include
> -DXTHREADS -o rb_cairo.o -c rb_cairo.c
OK, looks fairly normal for a gcc command line....
> In file included from rb_cairo.c:17:
> rb_cairo.h:20:19: error: cairo.h: No such file or directory
Ah. That will make everything tricky I think. The output from
extconf.rb doesn't
say anything about finding the .h file. Maybe it just isn't chatty
about it.
My quick prodding of the web suggests
[https://code.google.com/p/starruby/source/browse/trunk/extconf.rb] that you
want something like
have_header("cairo.h") or exit(false)
in your extconf.rb. This seems to be supported by
http://www.linuxtopia.org/online_books/programming_books/ruby_tutorial/Extending_Ruby_Creating_a_Makefile_with_extconf.rb.html
But I can't say for sure.
> In file included from rb_cairo.c:17:
> rb_cairo.h:205: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘*’ token
> rb_cairo.h:206: error: expected ‘)’ before ‘*’ token
> rb_cairo.h:208: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘*’ token
> rb_cairo.h:209: error: expected ‘)’ before ‘*’ token
> rb_cairo.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘*’ token
>
[And lots more besides]
Well, it is going to get really confused if the macros weren't defined
to expand
correctly.
> rb_cairo.h:307: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘rb_cairo_filter_from_ruby_object’
> rb_cairo.h:331: error: expected ‘)’ before ‘status’
> In file included from rb_cairo.c:18:
> rb_cairo_private.h:81: error: expected declaration specifiers or ‘...’
> before ‘cairo_glyph_t’
> rb_cairo_private.h:84: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘rb_cairo__is_kind_of’
> rb_cairo_private.h:112: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
> ‘__attribute__’ before ‘rb_cairo__exception_to_status’
> rb_cairo.c: In function ‘rb_cairo_satisfied_version’:
> rb_cairo.c:40: error: ‘CAIRO_VERSION_MAJOR’ undeclared (first use in
> this function)
> rb_cairo.c:40: error: (Each undeclared identifier is reported only once
> rb_cairo.c:40: error: for each function it appears in.)
> rb_cairo.c:40: error: ‘CAIRO_VERSION_MINOR’ undeclared (first use in
> this function)
> rb_cairo.c:40: error: ‘CAIRO_VERSION_MICRO’ undeclared (first use in
> this function)
> rb_cairo.c:31: warning: unused parameter ‘self’
> rb_cairo.c: In function ‘Init_cairo’:
> rb_cairo.c:59: error: ‘CAIRO_VERSION_MAJOR’ undeclared (first use in
> this function)
> rb_cairo.c:60: error: ‘CAIRO_VERSION_MINOR’ undeclared (first use in
> this function)
> rb_cairo.c:61: error: ‘CAIRO_VERSION_MICRO’ undeclared (first use in
> this function)
> rb_cairo.c:63: warning: implicit declaration of function ‘cairo_version’
> make: *** [rb_cairo.o] Error 1
>
And I think the rest follows from that.
>
> Gem files will remain installed in
> /Users/Timothy/.rvm/gems/ruby-1.9.2-p180/gems/cairo-1.10.0 for inspection.
> Results logged to
>
/Users/Timothy/.rvm/gems/ruby-1.9.2-p180/gems/cairo-1.10.0/ext/cairo/gem_make.out
>
So does the extconf.rb have the "have_header" line, and does it have a
have_lib line for that
matter? Maybe it uses something else, like this seems to:
http://pub.cozmixng.org/~kou/diff/rsvg-support-2.13.diff
+if PKGConfig.have_package('cairo') and have_header('rb_cairo.h')
+ if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
+ unless ENV["CAIRO_PATH"]
+ puts "Error! Set CAIRO_PATH."
+ exit 1
+ end
+ add_depend_package("cairo", "packages/cairo/ext", ENV["CAIRO_PATH"])
+ $defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
+ end
+ have_header("librsvg/rsvg-cairo.h")
+end
+
In fact, most of the stuff I'm finding is for rsvg-cairo, whatever that
is. And some cairo/rcairo
links.
If that reply was no help at all, I'm sorry for taking your time.
Hugh
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- Steve Klabnik
- Date:
- 2011-07-05 @ 21:12
>
> I've not ventured into RVM yet, but I'm not sure about the 192 including
> 1.9.1, but it isn't looking
> in another source tree, so I'll plead ignorance here
>
Ruby 1.9.2 has a 'library compatability version' of 1.9.1, so this is
normal, and has nothing to do with rvm.
Yes, it's kinda silly.
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- H. Sasse
- Date:
- 2011-07-05 @ 21:31
On 05/07/2011 22:12, Steve Klabnik wrote:
>
> I've not ventured into RVM yet, but I'm not sure about the 192
> including 1.9.1, but it isn't looking
> in another source tree, so I'll plead ignorance here
>
>
> Ruby 1.9.2 has a 'library compatability version' of 1.9.1, so this is
> normal, and has nothing to do with rvm.
>
> Yes, it's kinda silly.
Thank you. Getting into 1.9.x is something I've been putting off for
various reasons, but I think it is
time for me to look at that now. Maybe I can take the opportunity to
learn about RVM as well.
Hugh
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- Timothy Barnes
- Date:
- 2011-07-22 @ 01:32
Issue Resolved.
After posting this on the Ruby mailing list, it was apparent that my use of
macports and hombrew were conflicting. I delete macports and homebrew and
reinstalled homebrew and followed the instructions on the green shoes github
page. Using RVM and Ruby 1.9.2 everything work perfectly. I'm not sure but
I think macports could have been affecting RVM b/c I had had several issue
(even prior to this) using gem install on RVM.
Lesson: choose Homebrew or Macports, but not both.
Thanks for the advice.
Timothy
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- ashbb
- Date:
- 2011-07-23 @ 04:07
Hi Timothy,
> Issue Resolved.
Wow, fantastic!
Thank you for your hard work!
ashbb
Re: [shoes] Installing Green Shoes on OSX Snow Leopard
- From:
- Cecil Coupe
- Date:
- 2011-07-03 @ 02:39
On Sat, 2011-07-02 at 21:29 -0400, Timothy Barnes wrote:
In file included from rb_cairo.c:17:
rb_cairo.h:20:19: error: cairo.h: No such file or directory
This is a fatal error. Same problem as before with Red Shoes and jpeg.