Probably deps should be added on sdl-mixer and sdl-ttf. Reproducible: Always
(In reply to Pavel Volkov from comment #0) > Probably deps should be added on sdl-mixer and sdl-ttf. > No. Those are bundled. If you don't want bundled libs, use the experimental system-renpy USE flag. Since I don't use portage I cannot test it's misfeatures.
(In reply to Julian Ospald (hasufell) from comment #1) > No. Those are bundled. The the ebuild should use chrpath on the binaries in order to force them to use the bundled libs. For example, see the chrpath usage in the googleearth (bug 265372) and spideroak-bin (bug 467896) ebuilds.
Pardon, I meant to say patchelf --set-rpath, not chrpath.
(In reply to Zac Medico from comment #3) > Pardon, I meant to say patchelf --set-rpath, not chrpath. Then someone should provide a patch. I cannot test if it's correct.
(In reply to Julian Ospald (hasufell) from comment #4) > (In reply to Zac Medico from comment #3) > > Pardon, I meant to say patchelf --set-rpath, not chrpath. > > Then someone should provide a patch. I cannot test if it's correct. I'll look into writing a patch, but you can use ldd to test it yourself. If ldd reports that your binaries are linking the bundled libraries instead of the system libraries, then it proves that patchelf --set-rpath has been used correctly.
Created attachment 388480 [details, diff] patch for katawa-shoujo-1.2.ebuild to use patchelf --set-rpath I have not tested this patch. If ldd reports that the program binaries link to the bundled libs, then it proves that the patch works.
+*katawa-shoujo-1.2-r1 (06 Nov 2014) + + 06 Nov 2014; Julian Ospald <hasufell@gentoo.org> +katawa-shoujo-1.2-r1.ebuild: + maybe fix bug #528086
Sorry, still bad linking: !!! existing preserved libs: >>> package: media-libs/sdl-mixer-1.2.12-r4 * - /usr/lib32/libSDL_mixer-1.2.so.0 * - /usr/lib32/libSDL_mixer-1.2.so.0.12.0 * used by /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so (games-misc/katawa-shoujo-1.2-r1) >>> package: media-libs/sdl-ttf-2.0.11-r1 * - /usr/lib32/libSDL_ttf-2.0.so.0 * - /usr/lib32/libSDL_ttf-2.0.so.0.10.1 * used by /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so (games-misc/katawa-shoujo-1.2-r1)
(In reply to Pavel Volkov from comment #8) > Sorry, still bad linking: > Provide a patch. As I said: I cannot and will not test this portage feature.
(In reply to Pavel Volkov from comment #8) > Sorry, still bad linking: > > !!! existing preserved libs: > >>> package: media-libs/sdl-mixer-1.2.12-r4 > * - /usr/lib32/libSDL_mixer-1.2.so.0 > * - /usr/lib32/libSDL_mixer-1.2.so.0.12.0 > * used by > /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so > (games-misc/katawa-shoujo-1.2-r1) > >>> package: media-libs/sdl-ttf-2.0.11-r1 > * - /usr/lib32/libSDL_ttf-2.0.so.0 > * - /usr/lib32/libSDL_ttf-2.0.so.0.10.1 > * used by > /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so > (games-misc/katawa-shoujo-1.2-r1) Where does katawa-shoujo install the bundled libs? The attached patch assumes that the bundled libs are installed in /opt/katawa-shoujo/lib/.
(In reply to Zac Medico from comment #10) > > Where does katawa-shoujo install the bundled libs? The attached patch > assumes that the bundled libs are installed in /opt/katawa-shoujo/lib/. Yes, that's the only place where libs are.
(In reply to Julian Ospald (hasufell) from comment #11) > (In reply to Zac Medico from comment #10) > > > > Where does katawa-shoujo install the bundled libs? The attached patch > > assumes that the bundled libs are installed in /opt/katawa-shoujo/lib/. > > Yes, that's the only place where libs are. Okay, then the patch seems correct. @Pavel: Please check with ldd to see how it resolves the dependencies of those bundled pygame libs: ldd /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so \ /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so
It seems that setting rpath with patchelf is not enough. patchelf succeeds: # patchelf --print-rpath /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so /opt/katawa-shoujo/lib However: # ldd /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so | grep SDL ldd: warning: you do not have execution permission for `/opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so' libSDL-1.2.so.0 => /usr/lib32/libSDL-1.2.so.0 (0xf76e9000) libSDL_ttf-2.0.so.0 => /usr/lib32/libSDL_ttf-2.0.so.0 (0xf76c6000) If it's relevant, my arch is am64.
There may be something about the bundled libraries that prevents ldd and preserve-libs from using them to resolve the dependencies. Please attach /var/db/pkg/games-misc/katawa-shoujo-1.2-r1/NEEDED.ELF.2 which contains essential details about the bundled libraries.
Created attachment 388682 [details] /var/db/pkg/games-misc/katawa-shoujo-1.2-r1/NEEDED.ELF.2 Attaching the requested file
(In reply to Pavel Volkov from comment #15) > Created attachment 388682 [details] > /var/db/pkg/games-misc/katawa-shoujo-1.2-r1/NEEDED.ELF.2 > > Attaching the requested file Everything there seems correct. If you temporarily rename /usr/lib32/libSDL_mixer-1.2.so* and /usr/lib32/libSDL_ttf-2.0.so.0*, then does ldd correctly resolve the links to the bundled libraries? If ldd still doesn't resolve the libraries correctly, then run ldconfig and try ldd again, in case the ld.so cache needs to be rebuilt for the changes to be recognized.
If I rename the system libs, ldd reports: 1. libSDL_ttf-2.0.so.0 as "not found". 2. libSDL_mixer-1.2.so.0 as "not found" 3. other libraries are found under /usr If I then create the file /etc/ld.so.conf.d/99katawa.conf containing "/opt/katawa-shoujo/lib/linux-x86/lib" and re-run ldconfig, ldd reports: 1. libSDL_ttf-2.0.so.0 is found in /opt 2. libSDL_mixer-1.2.so.0 as "not found" (there's no such file in /opt really) 3. other libraries are found under /usr ldconfig also outputs these messages: ldconfig: file /opt/katawa-shoujo/lib/linux-x86/lib/libSDL-1.2.so.0 is truncated ldconfig: file /opt/katawa-shoujo/lib/linux-x86/lib/libXau.so.6 is truncated ldconfig: file /opt/katawa-shoujo/lib/linux-x86/lib/libavcodec.so.52 is truncated ldconfig: file /opt/katawa-shoujo/lib/linux-x86/lib/libavutil.so.49 is truncated ldconfig: file /opt/katawa-shoujo/lib/linux-x86/lib/libpython2.5.so.1.0 is truncated ldconfig: /opt/katawa-shoujo/lib/linux-x86/lib/ is not a symbolic link libpython2.5.so.1.0 is also reported as "not found" by ldd
When looking at NEEDED.ELF.2 earlier, I failed to notice that the libs were installed in /opt/katawa-shoujo/lib/linux-x86/lib. So, I've fixed the rpath setting in the ebuild in cvs as follows: @@ -39,8 +39,8 @@ # Use \x7fELF header to separate ELF executables and libraries [[ $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] || continue patchelf --set-rpath \ - "${EPREFIX}${GAMES_PREFIX_OPT}/${PN}/lib" "${x}" || \ - die "patchelf failed on ${x}" + "${EPREFIX}${GAMES_PREFIX_OPT}/${PN}/lib/linux-x86/lib" \ + "${x}" || die "patchelf failed on ${x}" done < <(find . -type f) }
libSDL_ttf-2.0.so.0 is now found in /opt, alright libSDL_mixer-1.2.so.0.12.0 is still preserved by portage in /usr — there's no such file in /opt/katawa-shoujo It is used by /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so
(In reply to Pavel Volkov from comment #19) > libSDL_ttf-2.0.so.0 is now found in /opt, alright Excellent. Thanks for testing. > libSDL_mixer-1.2.so.0.12.0 is still preserved by portage in /usr — there's > no such file in /opt/katawa-shoujo > It is used by /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so Yeah, NEEDED.ELF.2 confirms that. @Julian: How do you handle libSDL_mixer-1.2.so.0 missing from the bundled libraries? I suppose you could add a dependency on media-libs/sdl-mixer, but maybe you'd prefer to bundle it in somehow.
(In reply to Zac Medico from comment #20) > Yeah, NEEDED.ELF.2 confirms that. > > @Julian: How do you handle libSDL_mixer-1.2.so.0 missing from the bundled > libraries? I suppose you could add a dependency on media-libs/sdl-mixer, but > maybe you'd prefer to bundle it in somehow. It starts fine here with all libSDL_mixer system libraries removed, so I don't see a reason to bundle it or even add a dependency.
What about you unbundle pygame instead? You know, proper packaging and all.
(In reply to Diego Elio Pettenò from comment #22) > What about you unbundle pygame instead? You know, proper packaging and all. This is totally unrelated to pygame. This is a renpy game. renpy is an engine and is already packaged. The engine breaks games with each new slot/release. The first thing I did was contacting upstream of katawa-shoujo to fix these issues. They didn't care. So I had to add the "system-renpy" USE flag which is equivalent to "nothing is bundled" and also to "may randomly crash". The initial ebuild did not have that USE flag until users reported problems, see http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/games-misc/katawa-shoujo/katawa-shoujo-1.0.ebuild?hideattic=0&revision=1.1&view=markup&sortby=log https://bugs.gentoo.org/show_bug.cgi?id=459742
/opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so This looks like it's coming from pygame. And it seems like either those versions are not being used (as a missing library from NEEDED means the file won't load, ever), or they are completely broken. Even this: 386;/opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so;;/opt/katawa-shoujo/lib;libSDL-1.2.so.0,libpthread.so.0,libSDL_mixer-1.2.so.0,libpython2.5.so.1.0,libc.so.6 either pygame mixer is never imported (just remove the .so) or it's loading the pygame mixer from the base OS (broken ABI).
(In reply to Diego Elio Pettenò from comment #24) > /opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/font.so > > This looks like it's coming from pygame. And it seems like either those > versions are not being used (as a missing library from NEEDED means the file > won't load, ever), or they are completely broken. > > Even this: > > 386;/opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so;;/opt/ > katawa-shoujo/lib;libSDL-1.2.so.0,libpthread.so.0,libSDL_mixer-1.2.so.0, > libpython2.5.so.1.0,libc.so.6 > > either pygame mixer is never imported (just remove the .so) or it's loading > the pygame mixer from the base OS (broken ABI). Removing '/opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so' seems to have no side effects afais. Should I commit it with that one removed?
(In reply to Julian Ospald (hasufell) from comment #25) > Removing '/opt/katawa-shoujo/lib/linux-x86/lib/python2.5/pygame/mixer.so' > seems to have no side effects afais. > > Should I commit it with that one removed? +1 From the point of view of portage users, that will solve the problem with preserve-libs.
+*katawa-shoujo-1.2-r2 (07 Nov 2014) + + 07 Nov 2014; Julian Ospald <hasufell@gentoo.org> + -katawa-shoujo-1.2-r1.ebuild, +katawa-shoujo-1.2-r2.ebuild: + rm unused lib and fix bug #528086