upgraded 2 machines to dev-ruby/rcairo-1.8.1 caused undefined method `create_cairo_context' for #<Gdk::Window:0x7f4d00c02098 ptr=0x1191330> in dev-ruby/ruby-gtk2-0.19.3 had to downgrade to dev-ruby/rcairo-1.8.0-r1 to get cairo in rg2 again Reproducible: Always
Created attachment 217975 [details] dev-ruby:ruby-gtk2-0.19.3:20100130-221724.log this is the ruby-gtk2 build log using dev-ruby/rcairo-1.8.1 ... checking for cairo... yes checking for rb_cairo.h... no
I'm not sure what rg2 is, but rcairo 1.8.1 seems to work just as well for me in other applications.
sorry, rg2 is ruby-gnome2
some more info: ruby-gtk2 built with rcairo-1.8.0-r1 works fine, testing it(note there is no error): ruby -rgtk2 -e "w=Gtk::PrintContext.new; p w.cairo_context;" nil ruby-gtk2 built with rcairo-1.8.1 does the missing method. testing it(note NoMethodError): ruby -rgtk2 -e "w=Gtk::PrintContext.new; p w.cairo_context;" -e:1: undefined method `cairo_context' for #<Gtk::PrintContext:0x7f85e515f960 ptr=0xa7a850> (NoMethodError)
(In reply to comment #4) > ruby-gtk2 built with rcairo-1.8.1 does the missing method. > testing it(note NoMethodError): > ruby -rgtk2 -e "w=Gtk::PrintContext.new; p w.cairo_context;" > -e:1: undefined method `cairo_context' for #<Gtk::PrintContext:0x7f85e515f960 > ptr=0xa7a850> (NoMethodError) Thanks for providing a quick reproducer. However, something else must be going on because for me this works fine with rcairo 1.8.1. So rcairo 1.8.1 isn't broken by itself, but there is some combination of things that makes this break for you. I seem to recall that I've seen this before and that it had to do with USE=svg missing from cairo at the time that rcairo got compiled, but I'm not sure anymore of the details (and I couldn't find another bug for it).
i have svg in rcairo, i use i. # equery u rcairo * Searching for rcairo ... [ Legend : U - flag is set in make.conf ] [ : I - package is installed with flag ] [ Colors : set, unset ] * Found these USE flags for dev-ruby/rcairo-1.8.0-r1: U I + + svg : Adds support for SVG (Scalable Vector Graphics)
Yes, but the relevant bit is what was set for x11-libs/cairo at the time of compilation.
i have svg set in cairo, for sure. but the change came when i upgraded rcairo, and not cairo.
Is this still an issue with ruby-gtk2-0.19.4 and rcairo-1.8.1-r1?
after upgrading to dev-ruby/rcairo-1.8.1-r1 configure of ruby-gtk2 gives: checking for cairo... yes checking for rb_cairo.h... no than it emerges with no errors, then testing against cairo gives undefined method `create_cairo_context' for #<Gdk::Window:0x7f9bcfff0fd8 ptr=0x1130290> so, it is still an issue with ruby-gtk2-0.19.4 and rcairo-1.8.1-r1
Seems that same problems occurs on my AMD64 box. This is for Ruby 1.8, x11-libs/cairo-1.8.10 and dev-ruby/rcairo-1.8.1. Maybe we need rcairo-1.8.3 for cairo-1.8.10, see Release 1.8.3 (2010-08-26) Kouhei Sutou <kou@cozmixng.org>) =========================================================== Features -------- * Support cairo 1.8.10. * Support Ruby 1.9.2. (reported by Tasuku SUENAGA and kimura wataru) * Fix RGV -> HSV conversion. (patch by Yuta Taniguchi) * Support Cairo::Color as Hash key. Thanks ------ * Yuta Taniguchi * Tasuku SUENAGA * kimura wataru Release 1.8.1 (2009-12-13) Kouhei Sutou <kou@cozmixng.org>) =========================================================== Features -------- * Support cairo 1.8.8. * Improve auto .pc detection.
I can confirm that these 3 commands fixes the problem: emerge -av =dev-ruby/rcairo-1.8.0-r1 emerge -av ruby-gnome2 emerge -av ruby-gtk2
emerge -av =dev-ruby/rcairo-1.8.1 emerge -av ruby-gtk2 emerge -av ruby-gnome2 or emerge -av =dev-ruby/rcairo-1.8.1-1 emerge -av ruby-gtk2 emerge -av ruby-gnome2 gives again same problems. But great surprise -- Diego P. can you here me cp rcairo-1.8.0-r1.ebuild rcairo-1.8.1-r2.ebuild followed by the 3 emerges mentioned above makes it work! So the problem is the new ebuild format, not rcairo itself. There is not much difference in the generated files: AMD64X2 dev-ruby # diff -r rcairo-1.8.1-r1/image/usr/ rcairo-1.8.1-r2/image/usr/ Only in rcairo-1.8.1-r1/image/usr/lib64/ruby/gems/1.8: gems diff -r rcairo-1.8.1-r1/image/usr/lib64/ruby/gems/1.8/specifications/rcairo-1.8.1.gemspec rcairo-1.8.1-r2/image/usr/lib64/ruby/gems/1.8/specifications/rcairo-1.8.1.gemspec 1d0 < # generated by ruby-fakegem.eclass : 1.22 $ 7d5 < s.require_paths = ['lib'] Only in rcairo-1.8.1-r2/image/usr/lib64/ruby: site_ruby Only in rcairo-1.8.1-r1/image/usr/share/doc: rcairo-1.8.1-r1 Only in rcairo-1.8.1-r2/image/usr/share/doc: rcairo-1.8.1-r2 AMD64X2 dev-ruby # By box is pure 64, no multilib. Best regards Stefan Salewski
dev-ruby/rcairo-1.8.5 USE="svg -doc -test" RUBY_TARGETS="ruby18" works fine, thanks! stefan@AMD64X2 /usr/portage/dev-ruby/rcairo $ diff rcairo-1.8.5.ebuild rcairo-1.8.1-r1.ebuild 3c3 < # $Header: /var/cvsroot/gentoo-x86/dev-ruby/rcairo/rcairo-1.8.5.ebuild,v 1.1 2010/09/18 13:57:56 graaff Exp $ --- > # $Header: /var/cvsroot/gentoo-x86/dev-ruby/rcairo/rcairo-1.8.1-r1.ebuild,v 1.1 2010/07/30 17:44:32 flameeyes Exp $ 19c19 < RUBY_FAKEGEM_EXTRADOC="AUTHORS NEWS" --- > RUBY_FAKEGEM_EXTRADOC="AUTHORS ChangeLog NEWS README" 21c21 < inherit multilib ruby-fakegem --- > inherit ruby-fakegem 45a46,48 > # it doesn't follow the usual gem tree hierarchy > ln -s src/lib lib || die > 56d58 < echo 67c69 < cp ext/cairo/cairo$(get_modname) lib/ || die --- > cp src/cairo.so lib || die
Sorry, same problem occurred again, I guess it was a result of re-emerging ruby-gtk2 and ruby-gnome2 after rcairo-1.8.5. Back to cp rcairo-1.8.0-r1.ebuild rcairo-1.8.1-r2.ebuild emerge -av =dev-ruby/rcairo-1.8.1-2 emerge -av ruby-gtk2 emerge -av ruby-gnome2 and all seems to be fine, including the missing rb_cairo.h, see bug http://bugs.gentoo.org/show_bug.cgi?id=338512
Some days ago I reemerged my whole system/world with gcc 4.5.1-r1. Still the same problem, I have to manually install rb_cairo.h before emerging ruby-gtk2. I have not really an idea why my box depends on rb_cairo.h, while others may work without it. My box is AMD64, no multilib, may that make a difference? Should I append an emerge --info?
Status update: After a recent "emerge --update world" my rcairo installation was broken. And I was not able to repair it with any of the available rcairo ebuilds. Now I was able to manually fix it again: That fix works for x11-libs/cairo-1.10.2-r1 dev-ruby/rcairo-1.10.0 dev-ruby/ruby-gtk2-0.19.4 dev-ruby/ruby-gnome2-0.19.4 dev-ruby/ruby-pango-0.19.4 First fix: in /usr/lib64/ruby/gems/1.8/specifications/cairo-1.10.0.gemspec comment out dependency to already satisfied pkg-config and rubyforge. Without that a require 'cairo' failed by trying to load pkg-config from gem. That fixed basic cairo support. Next fix was again cp /var/tmp/portage/dev-ruby/rcairo-1.10.0/work/all/rcairo-1.10.0/ext/cairo/rb_cairo.h /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/ After reemerging ruby-gtk2, ruby-gnome2 and ruby-pango all seems to work. Best regards Stefan Salewski
That sounds interesting, especially now, i postponed confronting this issue by masking >=dev-ruby/rcairo-1.8.1, but i just noticed that rcairo-1.8.0-r1 is not available anymore I have thow options: try your fix or use gems. I see the ruby-gtk2 gentoo packages are not really maintained, so currently i'm trying to install rcairo and ruby-gtk2 packages from gem, on Jan-30 Kou released Ruby-GNOME2 0.90.6 in the gem repository.
(In reply to comment #17) > First fix: in > /usr/lib64/ruby/gems/1.8/specifications/cairo-1.10.0.gemspec > comment out dependency to already satisfied pkg-config and rubyforge. Fixed in rcairo-1.10.0-r1. > That fixed basic cairo support. Next fix was again > cp > /var/tmp/portage/dev-ruby/rcairo-1.10.0/work/all/rcairo-1.10.0/ext/cairo/rb_cairo.h > /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/ Also fixed in rcairo-1.10.0-r1. Thanks for looking into the issue and suggesting fixes.
(In reply to comment #18) > I see the ruby-gtk2 gentoo packages are not really maintained, so currently i'm > trying to install rcairo and ruby-gtk2 packages from gem, on Jan-30 Kou > released Ruby-GNOME2 0.90.6 in the gem repository. We have not been able to work on this yet due to lack of manpower. Feel free to help out :-)
> We have not been able to work on this yet due to lack of manpower. Feel free to > help out :-) Don't know how much I can help, but I'm running into issues as Stefan Salewski did with his AMD64 box and on my AMD64 box: dev-ruby/rcairo Available versions: 1.8.1 (~)1.8.5-r1 (~)1.10.0 (~)1.10.0-r2 {doc ruby_targets_ruby18 svg test} Installed versions: 1.10.0-r2 [Prior versions had either the same error, or a different error for 1.8.1, I don't recall what it was.] ruby peted.rb peted.rb:206:in `paint': undefined method `create_cairo_context' for #<Gdk::Window:0x7f00dc5b3ce8 ptr=0xe33800> from peted.rb:122:in `darea_configure_callback' from peted.rb:69:in `initialize' from peted.rb:231:in `call' from peted.rb:231:in `show_all' from peted.rb:231:in `initialize' from peted.rb:268:in `new' from peted.rb:268 emerge --info Portage 2.1.9.25 (default/linux/amd64/10.0/desktop, gcc-4.4.4, glibc-2.11.2-r3, 2.6.36-gentoo-r5 x86_64) ================================================================= System uname: Linux-2.6.36-gentoo-r5-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4600+-with-gentoo-1.12.14 Timestamp of tree: Wed, 02 Feb 2011 23:00:01 +0000 app-shells/bash: 4.1_p9 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.6.6-r1, 3.1.2-r4 dev-util/cmake: 2.8.3-r1 sys-apps/baselayout: 1.12.14-r1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.13, 2.65-r1 sys-devel/automake: 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.4.4-r2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.30-r1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=athlon64 -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/openvpn/easy-rsa" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=athlon64 -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="http://172.16.17.129:8080 http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" LANG="C" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j3" PKGDIR="/var/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/xfce-dev /var/lib/layman/embedded-cross /var/lib/layman/dotnet /var/lib/layman/lua /var/lib/layman/msp430 /var/lib/layman/ruby /var/lib/layman/science /var/lib/layman/x11 /usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X a52 aac accessibility acl acpi alsa amd64 aspell assistant berkdb bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus device-mapper djvu dri dts dvd dvdr emacs emboss encode escreen esd eselect exif extensions extras fam firefox flac fontconfig fortran gdbm gdu gif git gnutls gpg gpm graphviz gs gtalk gtk guile gzip gzip-el hal hddtemp htmltidy hunspell iconv imagemagick ipv6 jabber jack jpeg lcms ldap libnotify lock mad mercurial mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib mysql ncurses networking nls nptl nptlonly objc objc++ ogg opengl openmp pam pango pcre pdf perl png policykit ppds pppd python qt3support qt4 rdesktop readline ruby ruby-bindings rubytests samba scanner sdl semantic-desktop server session slp spell sql sse sse2 ssl startup-notification svg sysfs tcl tcpd threads thunar tidy tiff tk truetype udev unicode usb v4l v4l2 virtualbox vorbis webkit wxwidgets x264 xcb xcomposite xfce xml xorg xscreensaver xsettings xterm xterm-color xulrunner xv xvid yaml zeroconf zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="v4l nouveau" XFCE_PLUGINS="brightness menu trash" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
(In reply to comment #21) > Installed versions: 1.10.0-r2 > [Prior versions had either the same error, or a different error for 1.8.1, I > don't recall what it was.]
Bob, have you reemerged ruby-gtk2 after installing latest rcairo? Reemerged ruby-gtk2 is necessary, maybe reemerging ruby-gnome2 and ruby-pango too. I will try testing the patch of Hans de Graaff tomorrow, too busy currently, sorry. (Indeed, it would be fine when emerging rcairo would enforce emerging ruby-gtk2 or alt least output a message.)
emerging ruby-gtk2 ruby-gnome2 ruby-pango and running revdep-rebuild made no difference. Got the same error.
Thanks for testing, Bob. You are right, it does not work. $ ruby /usr/share/doc/ruby-gtk2-0.19.4/sample/misc/cairo-pong.rb /usr/share/doc/ruby-gtk2-0.19.4/sample/misc/cairo-pong.rb:16: GTK+ 2.8.0 or later and cairo support are required. (RuntimeError) $ locate rb_cairo.h /usr/lib64/ruby/gems/1.8/gems/cairo-1.10.0/src/rb_cairo.h Is this really the right location? For that I get # ebuild ruby-gtk2-0.19.4.ebuild compile checking for rb_cairo.h... no I suggested in Comment#17 /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/ which worked for me. Best wishes, Stefan
Either 'rb_cairo.h' is installed in the wrong location or ruby-gtk2 configure is looking for it in the wrong places. also there should be a 'cairo' use flag and dep for the relevants ruby-g* packages to force correct build order. IMHO either the line 'cp ext/cairo/rb_cairo.h src/ || die' in rcairo ebuild or the install phase should be somehow corrected.
I think I found something. in ruby-gnome2-all-0.19.4/glib/src/lib/mkmf-gnome2.rb:340 there's check_cairo function. As first try it looks for rb_cairo.h in (I think) standard places with have_header from mkmf. then it looks for rb_cairo.h in gems' path. this should be our case as rcairo ebuild uses fakegem. but the Gem.dir expression used in building the regexp to search the header (lines 349,350) returns the wrong path "/usr/local/lib/ruby/gems/1.8" . This also reminds me of some problems I have had with bundler and rails-3 looking for gems in that same path and failing because of that dir not being on the filesystem. So there's something wrong with our gem system. Solutions? patching mkmf-gnome2.rb to strip away the "local", fix gem. Also note that there's another issue as mkmf-ruby2 searches under "gems/cairo-1.10.0/bin" and "gems/cairo-1.10.0/lib" and the header is copied in the "gems/cairo-1.10.0/src" subdirectory so probably patching mkmf-ruby2 could be needed anyway.
(In reply to comment #27) > I think I found something. > Would be great if someone can fix this bug! In http://www.ruby-forum.com/topic/1207991 there was this comment in [ANN] Ruby-GNOME2 0.90.8: >==== Ruby/GLib2 > > * Fixes > * fix non-gem rcairo detection. [#3178228] > [OBATA Akio, Kouhei Sutou] May that be related to our Gentoo problems?
I've tried to configure in my home dir the 0.90.8-all tarball. Findings: cairo is found, rb_cairo.h is not found. So it is still the same situation. then I did a) symlink /usr/local/lib/ruby -> /usr/lib/ruby to workaround gem problem b) open mkmf-gnome-2.rb and read check_cairo function. the path included in CFLAGS to look for the header is /usr/local/lib/ruby/gems/1.8/gems/cairo-1.10.0/ext/cairo (ie ext/cairo subdir) so I copied the existing header to that newly created subdir and ruby extconf.rb was able to find both, thus enabling rcairo support. Also building is working fine. Either the ext/cairo dir is a standard location and so devs should patch rcairo ebuild to install the headers in that dir too (rb_cairo.h is not the only one present) or it is the wrong place so devs should patch ruby-glib to look for it in the directory it is installed in. I'm too much of a ruby newbie to know what to do. Hope this can help have this one fixed. p.s. the "gem issue" is still present, maybe this one needs a separate bug report?
Created attachment 271321 [details] rcairo corrected ebuild Heavily taken from https://github.com/shurizzle/shura-overlay/blob/master/dev-ruby/rcairo/rcairo-1.10.0.ebuild , so credit goes to shurizzle This ebuild correctly installs .h rcairo headers to enable configure time detection of cairo by ruby-gdkpixbuf2, ruby-gtk2 and others. Please, please, please consider adding this one to portage.
I've done some more testing, and it's not clear to me how the cairo gem actually makes this work. It keeps the rb_cairo.h file in its ext/cairo directory, but that also isn't found by ruby-gtk2. I have now reverted back to the -r1 behaviour which installs the header file in the ruby arch-dependent headers directory, which does work with ruby-gtk2. Bumped 1.10.0-r3 straight to stable.