[cairo-bugs] [Bug 18623] New: Patch for Ruby gem cairo-1.8. 0 to build on Mac OS X Leopard

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 19 06:15:09 PST 2008


http://bugs.freedesktop.org/show_bug.cgi?id=18623

           Summary: Patch for Ruby gem cairo-1.8.0 to build on Mac OS X
                    Leopard
           Product: cairo
           Version: 1.9.1
          Platform: x86-64 (AMD64)
        OS/Version: Mac OS X (All)
            Status: NEW
          Keywords: patch
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: cworth at cworth.org
        ReportedBy: sebastian.gassner at gmail.com
         QAContact: cairo-bugs at cairographics.org


Created an attachment (id=20443)
 --> (http://bugs.freedesktop.org/attachment.cgi?id=20443)
Patch fixing extconf.rb on Mac OS X Leopard

Overview
--------

Building the Ruby gem for cairo fails on Mac OS X Leopard because the '-o'
option in line 129 of extconf.rb is lacking a blank after the 'o'

    126       if PKGConfig.msvc?
    127         output_option = "-Fo"
    128       else
    129         output_option = "-o"
    130       end

resulting in the compiler complaining about the '-o' flag (full trace below):

  :
  /usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
  /usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
  :


Steps to reproduce
------------------

    sudo gem install cairo


Solution
--------

Apply the patch attached to this post, build the gem:

    [dowload the gem cairo-1.8.0]
    cd cairo-1.8.0
    patch -p0 < 20081118-fix_rcairo_build_on_mac_leopard.patch
    ruby extconf.rb
    make
    make install


Stack Trace
-----------

sebastian at sebastian:~/Desktop %> sudo gem install cairo
Bulk updating Gem source index for: http://gems.rubyforge.org
Building native extensions.  This could take a while...
ERROR:  Error installing cairo:
        ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
install cairo
checking for GCC... yes
checking for cairo version (>= 1.2.0)... yes
checking for HAVE_RUBY_ST_H in ruby.h... no
checking for ruby/st.h... no
checking for rb_errinfo() in ruby.h... no
checking for enum ruby_value_type in ruby.h... no
checking Win32 OS... no
checking for CAIRO_HAS_QUARTZ_SURFACE in cairo.h... yes
checking for RubyCocoa... yes
creating Makefile

make
Makefile:175: warning: overriding commands for target
`/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/lib'
Makefile:169: warning: ignoring old commands for target
`/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/lib'
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c /Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo.c
-osrc/rb_cairo.o
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_constants.c
-osrc/rb_cairo_constants.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_context.c
-osrc/rb_cairo_context.o
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_exception.c
-osrc/rb_cairo_exception.o
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_font_extents.c
-osrc/rb_cairo_font_extents.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_font_face.c
-osrc/rb_cairo_font_face.o
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_font_options.c
-osrc/rb_cairo_font_options.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_glyph.c
-osrc/rb_cairo_glyph.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_matrix.c
-osrc/rb_cairo_matrix.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_path.c
-osrc/rb_cairo_path.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_pattern.c
-osrc/rb_cairo_pattern.o
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_private.c
-osrc/rb_cairo_private.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_scaled_font.c
-osrc/rb_cairo_scaled_font.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c
-osrc/rb_cairo_surface.o
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c: In function
'cr_quartz_image_surface_initialize':
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1156: warning:
implicit declaration of function 'cairo_quartz_image_surface_create'
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1156: warning:
assignment makes pointer from integer without a cast
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c: In function
'cr_quartz_image_surface_get_image':
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1169: warning:
implicit declaration of function 'cairo_quartz_image_surface_get_image'
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1169: warning:
assignment makes pointer from integer without a cast
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c: In function
'cr_quartz_image_surface_initialize':
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1156: warning:
implicit declaration of function 'cairo_quartz_image_surface_create'
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1156: warning:
assignment makes pointer from integer without a cast
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c: In function
'cr_quartz_image_surface_get_image':
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1169: warning:
implicit declaration of function 'cairo_quartz_image_surface_get_image'
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_surface.c:1169: warning:
assignment makes pointer from integer without a cast
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_text_cluster.c
-osrc/rb_cairo_text_cluster.o
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
gcc -I. -I.
-I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
-I. -DHAVE_RUBY_COCOA -DRB_CAIRO_COMPILATION  -fno-common -arch ppc -arch i386
-Os -pipe -fno-common -Wall -DPNG_NO_MMX_CODE -DXTHREADS
-I/opt/local/include/cairo -I/opt/local/include/pixman-1
-I/opt/local/include/freetype2 -I/opt/local/include -I/sw/include/libpng12
-I/usr/X11/include  -c
/Library/Ruby/Gems/1.8/gems/cairo-1.8.0/src/rb_cairo_text_extents.c
-osrc/rb_cairo_text_extents.o
/usr/bin/../libexec/gcc/darwin/i386/as: Flag option -o has already been seen!
/usr/bin/../libexec/gcc/darwin/ppc/as: Flag option -o has already been seen!
cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup -o
src/cairo.bundle src/rb_cairo.o src/rb_cairo_constants.o src/rb_cairo_context.o
src/rb_cairo_exception.o src/rb_cairo_font_extents.o src/rb_cairo_font_face.o
src/rb_cairo_font_options.o src/rb_cairo_glyph.o src/rb_cairo_matrix.o
src/rb_cairo_path.o src/rb_cairo_pattern.o src/rb_cairo_private.o
src/rb_cairo_scaled_font.o src/rb_cairo_surface.o src/rb_cairo_text_cluster.o
src/rb_cairo_text_extents.o -L"."
-L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L. -arch
ppc -arch i386 -L/opt/local/lib  -Wl,-framework,RubyCocoa   -lruby  -lcairo
-lpthread -ldl -lm  
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo.o: No such file or directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_constants.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_context.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_exception.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_font_extents.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_font_face.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_font_options.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_glyph.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_matrix.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_path.o: No such file or directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_pattern.o: No such file or
directory
powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_private.o: No such file or
directory
i686-apple-darwin9-gcc-4.0.1: powerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo.o:
No such file or directorysrc/rb_cairo_scaled_font.o: No such file or directory

i686-apple-darwin9-gcc-4.0.1: powerpc-apple-darwin9-gcc-4.0.1:
src/rb_cairo_surface.o: No such file or directory
src/rb_cairo_constants.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: powerpc-apple-darwin9-gcc-4.0.1:
src/rb_cairo_context.o: No such file or directory
src/rb_cairo_text_cluster.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_exception.o: No such file or
directorypowerpc-apple-darwin9-gcc-4.0.1: src/rb_cairo_text_extents.o: No such
file or directory

i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_font_extents.o: No such file or
directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_font_face.o: No such file or
directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_font_options.o: No such file or
directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_glyph.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_matrix.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_path.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_pattern.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_private.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_scaled_font.o: No such file or
directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_surface.o: No such file or directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_text_cluster.o: No such file or
directory
i686-apple-darwin9-gcc-4.0.1: src/rb_cairo_text_extents.o: No such file or
directory
lipo: can't figure out the architecture type of: /var/tmp//ccZJneD1.out
make: *** [src/cairo.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/cairo-1.8.0 for
inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/cairo-1.8.0/gem_make.out


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list