commit:     bc136377c77f0ea077c87592f911b4683da94331
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 31 21:35:57 2018 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Wed Oct 31 21:53:11 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc136377

games-action/trine-enchanted-edition: Use our SDL with SDL_DYNAMIC_API

This is a magic environment variable that allows us to bypass the
static version of SDL 2 that the game was built with.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 ...8.ebuild => trine-enchanted-edition-2.12.508-r1.ebuild} | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/games-action/trine-enchanted-edition/trine-enchanted-edition-2.12.508.ebuild 
b/games-action/trine-enchanted-edition/trine-enchanted-edition-2.12.508-r1.ebuild
similarity index 81%
rename from 
games-action/trine-enchanted-edition/trine-enchanted-edition-2.12.508.ebuild
rename to 
games-action/trine-enchanted-edition/trine-enchanted-edition-2.12.508-r1.ebuild
index fcff32bee8f..d15a55db5f7 100644
--- 
a/games-action/trine-enchanted-edition/trine-enchanted-edition-2.12.508.ebuild
+++ 
b/games-action/trine-enchanted-edition/trine-enchanted-edition-2.12.508-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -23,14 +23,15 @@ QA_PREBUILT="opt/${PN}/${PN}*"
 DEPEND="app-arch/unzip"
 
 # SDL 1.3 is bundled but the game appears to be statically linked
-# against SDL 2.0.3. This is unfortunate as there are bugs. For example,
-# it doesn't respect the DISPLAY variable under Zaphod mode.
+# against SDL 2.0.3. We can bypass this and use our own SDL 2 by setting
+# the SDL_DYNAMIC_API environment variable.
 
 RDEPEND="
        media-gfx/nvidia-cg-toolkit[abi_x86_32]
        media-libs/alsa-lib[abi_x86_32]
        media-libs/freetype:2[abi_x86_32]
        media-libs/libogg[abi_x86_32]
+       
>=media-libs/libsdl2-2.0.3[abi_x86_32,joystick,opengl,sound,threads,video]
        >=media-libs/libvorbis-1.3[abi_x86_32]
        >=media-libs/openal-1.15[abi_x86_32]
        >=sys-devel/gcc-4.6[cxx]
@@ -56,7 +57,7 @@ pkg_nofetch() {
 }
 
 src_install() {
-       local dir=/opt/${PN}
+       local dir=/opt/${PN} SDL=${EPREFIX}/usr/$(ABI=x86 
get_libdir)/libSDL2-2.0.so.0
 
        insinto "${dir}"
        doins -r *.fbq data
@@ -64,14 +65,14 @@ src_install() {
        exeinto "${dir}"
        newexe bin/trine1_linux_32bit ${PN}
 
-       make_wrapper ${PN} ./${PN} "${dir}"
+       make_wrapper ${PN} "env SDL_DYNAMIC_API=\"${SDL}\" ./${PN}" "${dir}"
        make_desktop_entry ${PN} "${MY_PN}"
 
        if use launcher ; then
                exeinto "${dir}"
                newexe bin/trine1_linux_launcher_32bit ${PN}-launcher
 
-               make_wrapper ${PN}-launcher ./${PN}-launcher "${dir}"
+               make_wrapper ${PN}-launcher "env SDL_DYNAMIC_API=\"${SDL}\" 
./${PN}-launcher" "${dir}"
                make_desktop_entry ${PN}-launcher "${MY_PN} (launcher)"
 
                # Launcher binary has hardcoded the game path.
@@ -82,6 +83,5 @@ src_install() {
        dodoc readme_changelog.txt
 }
 
-pkg_preinst() { gnome2_icon_savelist; }
 pkg_postinst() { gnome2_icon_cache_update; }
 pkg_postrm() { gnome2_icon_cache_update; }

Reply via email to