Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143784 - Ebuild for ruby-gd2 (New Package)
Summary: Ebuild for ruby-gd2 (New Package)
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://gd2.rubyforge.org/
Whiteboard: [sunrise-overlay]
Keywords: EBUILD, InOverlay
Depends on:
Blocks:
 
Reported: 2006-08-13 07:21 UTC by Markus Schirp
Modified: 2014-08-26 09:54 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-ruby/ruby-gd2-1.1.1.ebuild (ruby-gd2-1.1.1.ebuild,602 bytes, text/plain)
2006-08-13 07:23 UTC, Markus Schirp
Details
ruby-gd2-1.1.1 ebuild (proper) (ruby-gd2-1.1.1.ebuild,452 bytes, text/plain)
2006-08-13 17:40 UTC, Aggelos Orfanakos (RETIRED)
Details
ruby-gd2-1.1.1.ebuild.diff (patch for 'proper') (ruby-gd2-1.1.1.ebuild.diff,684 bytes, patch)
2006-08-14 01:48 UTC, Aggelos Orfanakos (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Schirp 2006-08-13 07:21:41 UTC
I created an Ebuild for ruby-gd2. It's like ruby-gd but provides a nicer interface.
Comment 1 Markus Schirp 2006-08-13 07:23:01 UTC
Created attachment 94145 [details]
dev-ruby/ruby-gd2-1.1.1.ebuild
Comment 2 Aggelos Orfanakos (RETIRED) gentoo-dev 2006-08-13 17:40:36 UTC
Created attachment 94186 [details]
ruby-gd2-1.1.1 ebuild (proper)

Hello. Your ebuild has several design mistakes; you may want to read http://devmanual.gentoo.org/ebuild-writing/ to learn how to write proper ebuilds.

I wrote a new (and hopefully correct) ebuild for ruby-gd2 which I've tested on my system (x86) and it works. You can find it attached here.

Regards.
Comment 3 Markus Schirp 2006-08-13 23:42:56 UTC
Hi,

Tested your ebuild on a server machine (amd64). After building i tried:

irb -r gd2

and got:

/usr/lib64/ruby/gems/1.8/gems/gd2-1.1.1/lib/gd2.rb:150:in `[]':RuntimeError: unknown symbol "gdFontCacheShutdown"

After echo "media-libs/gd truetype" > /etc/portage/package.use and remerging media-libs/gd the problem was solved.

For me it's just a bug in ruby-gd2, it should not depend on 'optimal' gd features. It should detect them on the fly.

Maybe you should add a 'use dependency' for truetype on media-libs/gd in your ebuild?

(Bevor i post a suggestion i'll spend time reading on the ebuild guide ;) )

Thx for not ignoring my bad ebuild skills,

Markus
Comment 4 Aggelos Orfanakos (RETIRED) gentoo-dev 2006-08-14 01:48:20 UTC
Created attachment 94209 [details, diff]
ruby-gd2-1.1.1.ebuild.diff (patch for 'proper')

Hi!
I've tested what you say on my system and I can reproduce it. As a matter of fact, I had truetype enabled on media-libs/gd, so this is why I didn't catch it in the first place. :-)

I've attached a patch that should fix this (and also adds ~amd64). Please let me know if it works for you; it does for me.

Regards.
Comment 5 Markus Schirp 2006-08-14 03:09:17 UTC
Hi, i tested your ebuild. 

I remerged gd without freetype and your ebuild refuses correctly to continue. But after remerging gd with truetype ruby-gd2 stops with an Access Virolation:

seon ruby-gd2 # emerge ruby-gd2
Calculating dependencies... done!
>>> Emerging (1 of 1) dev-ruby/ruby-gd2-1.1.1 to /
>>> checking ebuild checksums ;-)
>>> checking auxfile checksums ;-)
>>> checking miscfile checksums ;-)
>>> checking gd2-1.1.1.gem ;-)
>>> Unpacking source...
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/ruby-gd2-1.1.1/work ...
>>> Source compiled.
>>> Test phase [not enabled]: dev-ruby/ruby-gd2-1.1.1

>>> Install ruby-gd2-1.1.1 into /var/tmp/portage/ruby-gd2-1.1.1/image/ category dev-ruby
ACCESS DENIED  mkdir:     /usr/lib64/ruby/gems/1.8/doc
ACCESS DENIED  mkdir:     /usr/lib64/ruby/gems/1.8/doc
Attempting local installation of '/var/tmp/portage/ruby-gd2-1.1.1/distdir/gd2-1.1.1'
Successfully installed gd2, version 1.1.1
>>> Completed installing ruby-gd2-1.1.1 into /var/tmp/portage/ruby-gd2-1.1.1/image/

--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/var/log/sandbox/sandbox-dev-ruby_-_ruby-gd2-1.1.1-1045.log"

mkdir:     /usr/lib64/ruby/gems/1.8/doc
mkdir:     /usr/lib64/ruby/gems/1.8/doc
--------------------------------------------------------------------------------
!!! This ebuild is from an overlay: '/usr/local/portage'


cat /var/log/sandbox/sandbox-dev-ruby_-_ruby-gd2-1.1.1-1045.log 

mkdir:     /usr/lib64/ruby/gems/1.8/doc
mkdir:     /usr/lib64/ruby/gems/1.8/doc

Without your latest patch I got the same problems, so something is broken on my system.
Comment 6 Aggelos Orfanakos (RETIRED) gentoo-dev 2006-08-14 03:46:35 UTC
Hello.
Hm, strange. Does the directory "/usr/lib64/ruby/gems/1.8/doc" exist in your system? Have you tried issuing

USE="-doc" emerge -av ruby-gd2

?
Comment 7 Markus Schirp 2006-08-14 04:05:32 UTC
Hi,

Thx for your idear with the path. I just got 

/usr/lib/ruby/gems/<gemstuff>

while it should be

/usr/lib64/ruby/gems/<gemstuff>

I did following:

mv /usr/lib/ruby/gems /usr/lib64/ruby/
rmdir /usr/lib/ruby
ln -s /usr/lib64/ruby /usr/lib/ruby

And now 'emerge ruby-gd2' works correct!

Im a little bit confused about the directory layout of rubygems (it installs /usr/lib/ruby)

equery f rubygems | grep lib


/usr/lib
/usr/lib/ruby
/usr/lib/ruby/gems
/usr/lib/ruby/gems/1.8
/usr/lib/ruby/gems/1.8/cache
/usr/lib/ruby/gems/1.8/cache/sources-0.0.1.gem
/usr/lib/ruby/gems/1.8/doc
/usr/lib/ruby/gems/1.8/doc/.keep
/usr/lib/ruby/gems/1.8/gems
/usr/lib/ruby/gems/1.8/gems/sources-0.0.1
/usr/lib/ruby/gems/1.8/gems/sources-0.0.1/lib
/usr/lib/ruby/gems/1.8/gems/sources-0.0.1/lib/sources.rb
/usr/lib/ruby/gems/1.8/specifications
/usr/lib/ruby/gems/1.8/specifications/sources-0.0.1.gemspec
/usr/lib64
/usr/lib64/ruby
/usr/lib64/ruby/site_ruby
/usr/lib64/ruby/site_ruby/1.8
/usr/lib64/ruby/site_ruby/1.8/gemconfigure.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems
/usr/lib64/ruby/site_ruby/1.8/rubygems.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/builder.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/cmd_manager.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/command.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/config_file.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/dependency_list.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/deployment.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/doc_manager.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/format.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/gem_commands.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/gem_openssl.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/gem_runner.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/installer.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/old_format.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/open-uri.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/package.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/remote_installer.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/rubygems_version.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/security.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/source_index.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/specification.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/timer.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/user_interaction.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/validator.rb
/usr/lib64/ruby/site_ruby/1.8/rubygems/version.rb
/usr/lib64/ruby/site_ruby/1.8/ubygems.rb
/usr/lib64/ruby/site_ruby/auto_gem.rb


Some libs are located in /usr/lib and some in /usr/lib64, is this intended? Maybe its a new bug?

Markus

P.S. Im not a native english speaker, complain please only constructionally. 
Comment 8 Aggelos Orfanakos (RETIRED) gentoo-dev 2006-08-14 04:24:59 UTC
Another idea; try issuing

gem install -r gd2

and see what happens. Make sure you've first unmerged ruby-gd2 and reverted the changes you made in your latest comment so that we know what's going on.
Comment 9 Markus Schirp 2006-08-14 04:55:33 UTC
Reverted all the changes and unmerged ruby-gd2

emerge --unmerge ruby-gd2
emerge --unmerge rubygems
rm -r /usr/lib/ruby
emerge rubygems
gem install gd2

->

Attempting local installation of 'gd2'
Local gem file not found: gd2*.gem
Attempting remote installation of 'gd2'
/usr/lib64/ruby/site_ruby/1.8/rubygems.rb:204:in `report_activate_error': Could not find RubyGem sources (> 0.0.0) (Gem::LoadError)
        from /usr/lib64/ruby/site_ruby/1.8/rubygems.rb:141:in `activate'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems.rb:37:in `require_gem_with_options'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems.rb:31:in `require_gem'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/remote_installer.rb:425:in `sources'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/remote_installer.rb:435:in `source_index_hash'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/remote_installer.rb:399:in `install'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/gem_commands.rb:195:in `execute'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/gem_commands.rb:153:in `execute'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/command.rb:49:in `invoke'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:94:in `process_args'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/cmd_manager.rb:67:in `run'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/gem_runner.rb:13:in `run'
        from /usr/bin/gem:17

After:

mv /usr/lib/ruby/gems /usr/lib64/ruby/
rmdir /usr/lib/ruby
ln -s /usr/lib64/ruby /usr/lib/ruby

Evrything wokrds correct again (ebuild and gem install). I thing rubygems should (on amd64) simple install it's few libarys in /usr/lib at /usr/lib64.

Thx for your spending time in my (ex)problem.

Markus
Comment 10 Aggelos Orfanakos (RETIRED) gentoo-dev 2006-08-14 07:02:16 UTC
I think I've nailed it down:

  # gem help install
  Usage: gem install GEMNAME [options]
  
    Options:
  <snip>
      -i, --install-dir DIR
  <snip>
    Defaults:
      --both --version '> 0' --rdoc --no-force --no-test
      --install-dir /usr/lib/ruby/gems/1.8

So it tries to install the gems under

  /usr/lib/ruby/gems/1.8

by default. This also means that with

  gem install -r -i /usr/lib64/ruby/

you shouldn't have any problems and won't even have to do the modifications you did to fix it. Of course, it still remains a problem for Gentoo. But, according to this

  http://docs.rubygems.org/read/chapter/11

RubyGems support a configuration file. So if you create (as root I guess) ~/.gemrc and in it write

  gem: -i /usr/lib64/ruby/

you shouldn't have any problems with Gentoo either. If you feel like trying it, please let me know of the results.
Comment 11 Aggelos Orfanakos (RETIRED) gentoo-dev 2006-08-14 07:13:24 UTC
Now in the Sunrise overlay:
http://www.gentoo-sunrise.org/sunrise/browser/reviewed/dev-ruby/ruby-gd2
Comment 12 Caleb Tennis (RETIRED) gentoo-dev 2006-08-14 07:15:29 UTC
If Ruby itself installs into /usr/lib64, that should be reflected in Ruby's Config.rb file.  I would think that the gem command would use this when determining where to install gems.  If it doesn't, that seems like gem itself might be broken?
Comment 13 Aggelos Orfanakos (RETIRED) gentoo-dev 2006-08-14 07:31:33 UTC
It sounds like a sensible conclusion to me, especially if Markus is able to install other gems without any problems.
Comment 14 Manuel Rüger (RETIRED) gentoo-dev 2014-07-26 13:54:03 UTC
Is there still any interest to get this into the tree? Please reply, otherwise the bug will be marked as WONTFIX in 30 days from now and I'll remove it from sunrise (it is broken there anyway).

 1.1.1 May 12, 2006 seems to be the recent version according to rubygems.
Comment 15 Manuel Rüger (RETIRED) gentoo-dev 2014-08-26 09:54:15 UTC
Closing old bug due to no response. Cleaning up sunrise because of outdated ruby18 support.