Subject: pkg/30496: x11/ruby-fox can't find libX11.so.6?
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <melkmund@airpost.net>
List: pkgsrc-bugs
Date: 06/11/2005 07:04:00
>Number:         30496
>Category:       pkg
>Synopsis:       x11/ruby-fox can't find libX11.so.6?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 11 07:04:00 +0000 2005
>Originator:     Mel Jones
>Release:        2.0.2
>Organization:
>Environment:
NetBSD  2.0.2 NetBSD 2.0.2 (GENERIC) #0: Wed Mar 23 08:53:42 UTC 2005  jmc@faith.netbsd.org:/home/builds/ab/netbsd-2-0-2-RELEASE/i386/200503220140Z-obj/home/builds/ab/netbsd-2-0-2-RELEASE/src/sys/arch/i386/compile/GENERIC i386
pkgsrc 2005-Q1
x binary from install CD
>Description:
I'm trying to get FXRuby (x11/ruby-fox) to work. However, when trying to load the fox extension, ruby fails because it can't find libX11.so.6 (which resides in /usr/X11R6/lib). when I "ldd" the fox.so extension object created by ruby-fox, I found out -lX11.6 and -lXext.6 were referenced twice each. See below. But setting LD_LIBRARY_PATH to /usr/X11R6/lib solves everything.

The problem is definitely with ruby-fox b/c C++ fox applications work fine, and ruby itself seems to be working well.
>How-To-Repeat:
% cd /usr/pkgsrc/x11/ruby-fox; make install clean

% cd /usr/pkg/share/examples/ruby18/fox 
% ruby hello.rb
/usr/pkg/lib/ruby/site_ruby/1.8/i386-netbsdelf/fox.so: Shared object "libX11.so.6" not found - /usr/pkg/lib/ruby/site_ruby/1.8/i386-netbsdelf/fox.so (LoadError)
        from hello.rb:3

% ldd /usr/pkg/lib/ruby/site_ruby/1.8/i386-netbsdelf/fox.so
fox.so:
         -lpthread.0 => /usr/lib/libpthread.so.0
         -lcrypt.0 => /usr/lib/libcrypt.so.0
         -lm.0 => /usr/lib/libm387.so.0
         -lm.0 => /usr/lib/libm.so.0
         -lruby18.18 => /usr/pkg/lib/libruby18.so.18
         -lX11.6 => /usr/X11R6/lib/libX11.so.6
         -lXext.6 => /usr/X11R6/lib/libXext.so.6
         -lGL.1 => /usr/pkg/lib/libGL.so.1
         -lstdc++.5 => /usr/lib/libstdc++.so.5
         -lgcc_s.1 => /usr/lib/libgcc_s.so.1
         -lGLU.1 => /usr/pkg/lib/libGLU.so.1
         -ljpeg.62 => /usr/pkg/lib/libjpeg.so.62
         -lz.0 => /usr/lib/libz.so.0
         -lpng.3 => /usr/pkg/lib/libpng.so.3
         -lc.12 => /usr/lib/libc.so.12
         -ltiff.3 => /usr/pkg/lib/libtiff.so.3
         -lFOX-1.0.0 => /usr/pkg/lib/libFOX-1.0.so.0
         -lX11.6 => not found
         -lXext.6 => not found

# the last two lines are weird....
>Fix:
set LD_LIBRARY_PATH to /usr/X11R6/lib, not really a fix..