<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>200661</bug_id>
          
          <creation_ts>2007-11-28 16:59 0000</creation_ts>
          <short_desc>dev-libs/DirectFB-0.9.25.1 - directfb-config does not set -lsysfs</short_desc>
          <delta_ts>2007-12-02 22:21:13 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Library</component>
          <version>2007.0</version>
          <rep_platform>AMD64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://www.directfb.org/</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>linuxras@gmail.com</reporter>
          <assigned_to>games@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>linuxras@gmail.com</who>
            <bug_when>2007-11-28 16:59:45 0000</bug_when>
            <thetext>I have been trying to get splashy to work on gentoo and ran into a small directfb bug that seems to have been around for some time.

When DirectFB is built with the &quot;sysfs&quot; USE flag linking against the library fails  with the following errors.

then mv -f &quot;.deps/splashy-splashy_functions.Tpo&quot; &quot;.deps/splashy-splashy_functions.Po&quot;; else rm -f &quot;.deps/splashy-splashy_functions.Tpo&quot;; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link i686-pc-linux-gnu-gcc -O2 -march=athlon64 -msse3 -fomit-frame-pointer -pipe -Wall -Werror -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -o splashy -all-static -static-libgcc -Wl,-uIDirectFBFont_Default -Wl,-uIDirectFBFont_FT2 -Wl,-uIDirectFBImageProvider_PNG splashy-splashy_main.o splashy-splashy_functions.o libsplashycnf.la libsplashy.la -lpthread -lm -lglib-2.0 -static /usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o /usr/lib/directfb-0.9.25/wm/libdirectfbwm_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_ft2.o -lfreetype /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o -lpng -lz -lm /usr/lib/directfb-0.9.25/inputdrivers/libdirectfb_keyboard.o -L/usr/lib -ldirectfb -lfusion -ldirect -lpthread -lz
i686-pc-linux-gnu-gcc -O2 -march=athlon64 -msse3 -fomit-frame-pointer -pipe -Wall -Werror -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -o splashy -static -static-libgcc -Wl,-uIDirectFBFont_Default -Wl,-uIDirectFBFont_FT2 -Wl,-uIDirectFBImageProvider_PNG splashy-splashy_main.o splashy-splashy_functions.o /usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o /usr/lib/directfb-0.9.25/wm/libdirectfbwm_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_ft2.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBFont/libidirectfbfont_default.o /usr/lib/directfb-0.9.25/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o /usr/lib/directfb-0.9.25/inputdrivers/libdirectfb_keyboard.o ./.libs/libsplashycnf.a ./.libs/libsplashy.a /var/tmp/portage/media-gfx/splashy-0.3.6/work/splashy-0.3.6/src/.libs/libsplashycnf.a /usr/lib/libglib-2.0.a /usr/lib/libfreetype.a /usr/lib/libpng12.a -lm -L/usr/lib /usr/lib/libdirectfb.a /usr/lib/libfusion.a /usr/lib/libdirect.a -ldl -lpthread -lz
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do&apos;:
(.text+0x121b): warning: Using &apos;getpwuid&apos; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do&apos;:
(.text+0x120e): warning: Using &apos;setpwent&apos; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do&apos;:
(.text+0x1227): warning: Using &apos;endpwent&apos; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do&apos;:
(.text+0x10cf): warning: Using &apos;getpwnam_r&apos; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do&apos;:
(.text+0x1117): warning: Using &apos;getpwuid_r&apos; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libdirect.a(log.o): In function `parse_host_addr&apos;:
(.text+0x231): warning: Using &apos;getaddrinfo&apos; in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev&apos;:
(.text+0x4c1c): undefined reference to `sysfs_get_mnt_path&apos;
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev&apos;:
(.text+0x4cb5): undefined reference to `sysfs_open_class_device&apos;
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev&apos;:
(.text+0x4cc7): undefined reference to `sysfs_get_classdev_device&apos;
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev&apos;:
(.text+0x4ce1): undefined reference to `sysfs_get_device_attr&apos;
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev&apos;:
(.text+0x4d18): undefined reference to `sysfs_get_device_attr&apos;
/usr/lib/directfb-0.9.25/systems/libdirectfb_fbdev.o: In function `directfb_fbdev&apos;:
(.text+0x4db2): undefined reference to `sysfs_close_class_device&apos;
collect2: ld returned 1 exit status
make[2]: *** [splashy] Error 1
make[2]: Leaving directory `/var/tmp/portage/media-gfx/splashy-0.3.6/work/splashy-0.3.6/src&apos;
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-gfx/splashy-0.3.6/work/splashy-0.3.6&apos;
make: *** [all] Error 2

More details here http://forums.gentoo.org/viewtopic-t-326522.html

I tracked this down to directfb itself, directfb-config does not set -lsysfs
so linking against it fails as noted above.
I went looking into why this was happening on Gentoo and not other distros and it seems this is because they are ALL patching the DirectFB sources.
I have attached a simple patch that fixed the problem.
Please add this patch to the ebuild. I have tested it in my overlay and it works as it should.

diff -uNr DirectFB-0.9.25.1/directfb-config.in DirectFB-0.9.25.1-sysfs/directfb-config.in
--- DirectFB-0.9.25.1/directfb-config.in        2005-12-01 11:51:06.000000000 -0700
+++ DirectFB-0.9.25.1-sysfs/directfb-config.in  2007-11-27 21:45:03.000000000 -0700
@@ -300,7 +300,7 @@
       libs=-L@libdir@

       if test &quot;$lib_directfb&quot; = &quot;yes&quot;; then
-        libs=&quot;$libs -ldirectfb -lfusion -ldirect @THREADLIB@ @ZLIB_LIBS@&quot;
+        libs=&quot;$libs -ldirectfb -lfusion -ldirect @THREADLIB@ @ZLIB_LIBS@ @SYSFS_LIBS@&quot;

         if test -z &quot;$echo_static&quot;; then
            libs=&quot;$libs @DYNLIB@&quot;
diff -uNr DirectFB-0.9.25.1/directfb.pc.in DirectFB-0.9.25.1-sysfs/directfb.pc.in
--- DirectFB-0.9.25.1/directfb.pc.in    2005-10-18 17:14:04.000000000 -0600
+++ DirectFB-0.9.25.1-sysfs/directfb.pc.in      2007-11-27 21:44:04.000000000 -0700
@@ -7,5 +7,5 @@
 Description: Graphics and windowing library for the Linux frame buffer device
 Version: @VERSION@
 Requires: fusion direct
-Libs: -L${libdir} -ldirectfb @THREADLIB@ @DYNLIB@ @ZLIB_LIBS@ @OSX_LIBS@
+Libs: -L${libdir} -ldirectfb @THREADLIB@ @DYNLIB@ @ZLIB_LIBS@ @SYSFS_LIBS@ @OSX_LIBS@
 Cflags: @THREADFLAGS@ -I@INCLUDEDIR@</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>linuxras@gmail.com</who>
            <bug_when>2007-11-28 17:02:58 0000</bug_when>
            <thetext>Created an attachment (id=137249)
Patch against DirectFB-0.9.25.1

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-12-02 21:17:14 0000</bug_when>
            <thetext>should really convert the additional libs to Libs.private

Libs: -L${libdir} -ldirectfb
Libs.private: @THREADLIB@ @DYNLIB@ @ZLIB_LIBS@ @SYSFS_LIBS@ @OSX_LIBS@</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-12-02 22:21:13 0000</bug_when>
            <thetext>fixed in DirectFB-1.1.0 ... thanks for the report/patch !

i&apos;ll see about opening a bug report upstream about the Libs.private thing</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>137249</attachid>
            <date>2007-11-28 17:02 0000</date>
            <desc>Patch against DirectFB-0.9.25.1</desc>
            <filename>DirectFB-0.9.25.1-sysfs.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">ZGlmZiAtdU5yIERpcmVjdEZCLTAuOS4yNS4xL2RpcmVjdGZiLWNvbmZpZy5pbiBEaXJlY3RGQi0w
LjkuMjUuMS1zeXNmcy9kaXJlY3RmYi1jb25maWcuaW4KLS0tIERpcmVjdEZCLTAuOS4yNS4xL2Rp
cmVjdGZiLWNvbmZpZy5pbgkyMDA1LTEyLTAxIDExOjUxOjA2LjAwMDAwMDAwMCAtMDcwMAorKysg
RGlyZWN0RkItMC45LjI1LjEtc3lzZnMvZGlyZWN0ZmItY29uZmlnLmluCTIwMDctMTEtMjcgMjE6
NDU6MDMuMDAwMDAwMDAwIC0wNzAwCkBAIC0zMDAsNyAr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