Control: reassign -1 cmake
Control: retitle -1 cmake: FindRuby cannot handle Ruby 2.0 library in multiarch 
path

Hello Sylvain, thanks for your bug report. Hello cmake maintainer(s).

On Thu, Nov 21, 2013 at 11:19:09AM +0100, Sylvain Joyeux wrote:
> Package: ruby2.0
> Version: 2.0.0.343-1
> Severity: normal
> 
> RbConfig::CONFIG['libdir'] reports /usr/lib/ instead of (on my amd64
> machine) the multiarch /usr/lib/x86_64-linux-gnu. AFAIK, libdir is
> meant to be the directory in which the ruby .so library is
> installed, so it is wrong.
>
> It breaks CMake's FindRuby macros

libdir points to the base directory for libraries. Before multiarch
support, the shared library was also in that directory, but it was
mostly a coincidence.

DISCLAIMER: I don't know much about CMake.

IMO:

- CMake's FindRuby macros should not need any help to search for a
  library in the standard compiler paths, be it the multiarch path
  (/usr/lib/$triplet) or the legacy path (/usr/lib).
- CMake has to be fixed to cope with this, and this is why I am
  reassigning this bug to cmake. I see 2 ways of doing it:

0) Using archlibdir (new on Ruby 2.0), and falling back to libdir on older Ruby 
versions:

$ ruby1.9.1  -e 'puts RbConfig::CONFIG["archlibdir"] || 
RbConfig::CONFIG["libdir"]'
/usr/lib
$ ruby2.0  -e 'puts RbConfig::CONFIG["archlibdir"] || 
RbConfig::CONFIG["libdir"]'
/usr/lib/x86_64-linux-gnu

1) Using pkg-config to detect the presence of Ruby and trusting the
compiler to find the shared library in the right path

$ pkg-config --libs --cflags ruby-1.9
-I/usr/include/ruby-1.9.1/x86_64-linux -I/usr/include/ruby-1.9.1  -lruby-1.9.1 
-lpthread -lrt -ldl -lcrypt -lm
$ pkg-config --libs --cflags ruby-2.0
-I/usr/include/x86_64-linux-gnu/ruby-2.0.0 -I/usr/include/ruby-2.0.0  
-lruby-2.0 -lpthread -lrt -ldl -lcrypt -lm

Please let me know if there is any further information I can provide on
the Ruby side.

-- 
Antonio Terceiro <terce...@debian.org>

Attachment: signature.asc
Description: Digital signature

Reply via email to