commit: de131984cda6e4c9097ee02ebcb38eb581f6db40 Author: Vadim A. Misbakh-Soloviov <git <AT> mva <DOT> name> AuthorDate: Fri Jun 2 13:02:17 2017 +0000 Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name> CommitDate: Fri Jun 2 13:02:17 2017 +0000 URL: https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=de131984
aquaria/bbge semi-fix: chewi said there is new repo + needs to finish porting to EAPI6 (no gamesdir) games-arcade/aquaria/aquaria-9999.ebuild | 72 ++++++++++++++++--------- games-engines/bbge/bbge-9999.ebuild | 43 ++++++++------- games-engines/bbge/files/gentoo-data-path.patch | 40 -------------- 3 files changed, 73 insertions(+), 82 deletions(-) diff --git a/games-arcade/aquaria/aquaria-9999.ebuild b/games-arcade/aquaria/aquaria-9999.ebuild index 7cbdc7d..2e1283e 100644 --- a/games-arcade/aquaria/aquaria-9999.ebuild +++ b/games-arcade/aquaria/aquaria-9999.ebuild @@ -1,11 +1,10 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: $ -EAPI="2" +EAPI=6 EHG_REPO_URI="http://hg.icculus.org/icculus/aquaria" -inherit eutils flag-o-matic games cmake-utils mercurial +inherit eutils flag-o-matic cmake-utils mercurial versionator DESCRIPTION="A 2D scroller set in a massive ocean world" HOMEPAGE="http://www.bit-blot.com/aquaria/" @@ -14,14 +13,24 @@ SRC_URI="aquaria-lnx-humble-bundle.mojo.run" LICENSE="GPL-2" SLOT="0" KEYWORDS="" -IUSE="" +IUSE="luajit" RESTRICT="fetch" -RDEPEND="dev-lang/lua +RDEPEND=" + luajit? ( + dev-lang/luajit:2 + ) + !luajit? ( + || ( + dev-lang/lua:5.1 + dev-lang/lua:0 + ) + ) >=dev-libs/tinyxml-2.6.1-r1[stl] games-engines/bbge media-libs/glpng - media-libs/libsdl" + media-libs/libsdl +" DEPEND="${RDEPEND} app-arch/unzip" @@ -30,7 +39,8 @@ S="${WORKDIR}/${PN}" pkg_nofetch() { echo - elog "Download ${A} from ${HOMEPAGE} and place it in ${DISTDIR}" + ewarn "Despite game code is open source, it still need artwork from original humblebundle package." + ewarn "Please, download ${A} from ${HOMEPAGE} (or from your humble bundle library) and place it in ${DISTDIR}" echo } @@ -45,41 +55,55 @@ src_unpack() { } src_prepare() { + local lua=lua + use luajit && lua=luajit-5.1 + has_version 'dev-lang/lua:5.1' && lua=lua5.1 + # Fix include paths. sed -i \ -e "s:\.\./ExternalLibs/glpng:GL/glpng:" \ -e "s:\.\./ExternalLibs/::" \ -e "s:\.\./BBGE/:BBGE/:" \ - Aquaria/*.{cpp,h} || die + Aquaria/*.{cpp,h} || die "Fix include patch failed" # Only build game sources. - rm -r BBGE/ || die - sed -i "/ADD_EXECUTABLE[(]/,/[)]/d" CMakeLists.txt || die - echo 'ADD_EXECUTABLE(aquaria ${AQUARIA_SRCS})' >> CMakeLists.txt || die + rm -r BBGE/ ExternalLibs/ || die "dropping bbge && ExternalLibs faled" + sed -i "/ADD_EXECUTABLE[(]/,/[)]/d" CMakeLists.txt || die "dropping bbge && ExternalLibs faled" + echo 'ADD_EXECUTABLE(aquaria ${AQUARIA_SRCS})' >> CMakeLists.txt || die "dropping bbge && ExternalLibs faled" # Redefine libraries to link against. sed -i "/TARGET_LINK_LIBRARIES/d" CMakeLists.txt || die - echo "TARGET_LINK_LIBRARIES(aquaria BBGE glpng lua pthread SDL tinyxml)" >> CMakeLists.txt || die + echo "TARGET_LINK_LIBRARIES(aquaria BBGE glpng ${lua} pthread SDL tinyxml)" >> CMakeLists.txt || die + + default } src_configure() { + local lua=lua + + use luajit && ( + local ljpk="$(best_version dev-lang/luajit:2)" + local ljv="$(get_version_component_range 1-2 ${ljpk/*luajit-/})" + append-cppflags -I/usr/include/luajit"${ljv}" + ) + + has_version 'dev-lang/lua:5.1' && append-cppflags -I/usr/include/lua5.1 + append-cppflags -I/usr/include/BBGE -I/usr/include/freetype2 cmake-utils_src_configure } src_install() { - dogamesbin "${CMAKE_BUILD_DIR}/${PN}" || die - - cd ../data || die - insinto "${GAMES_DATADIR}/Aquaria" - doins -r *.xml */ || die - doins -r "${S}"/game_scripts/* || die + cmake-utils_src_install - dodoc README-linux.txt || die - dohtml -r docs/* || die + cd ../data + insinto /usr/share/Aquaria + doins -r *.xml */ + doins -r "${S}"/game_scripts/* - doicon "${PN}.png" || die - make_desktop_entry "${PN}" "Aquaria" || die + dodoc README-linux.txt + dodoc -r docs/* - prepgamesdirs + doicon "${PN}.png" + make_desktop_entry "${PN}" "Aquaria" } diff --git a/games-engines/bbge/bbge-9999.ebuild b/games-engines/bbge/bbge-9999.ebuild index c20ac8e..d68e6ae 100644 --- a/games-engines/bbge/bbge-9999.ebuild +++ b/games-engines/bbge/bbge-9999.ebuild @@ -1,12 +1,11 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: $ -EAPI="2" +EAPI=6 EHG_REPO_URI="http://hg.icculus.org/icculus/aquaria" EHG_PROJECT="aquaria" -inherit flag-o-matic games cmake-utils mercurial +inherit flag-o-matic cmake-utils mercurial DESCRIPTION="The Bit-Blot Game Engine, used by Aquaria" HOMEPAGE="http://www.bit-blot.com/" @@ -16,7 +15,8 @@ SLOT="0" KEYWORDS="" IUSE="static-libs" -RDEPEND=">=dev-libs/tinyxml-2.6.1-r1[stl] +RDEPEND=" + >=dev-libs/tinyxml-2.6.1-r1[stl] media-libs/freetype:2 media-libs/ftgl media-libs/glpng @@ -24,15 +24,18 @@ RDEPEND=">=dev-libs/tinyxml-2.6.1-r1[stl] media-libs/libvorbis media-libs/openal sys-libs/zlib - virtual/opengl" + virtual/opengl +" DEPEND="${RDEPEND}" S="${WORKDIR}/aquaria" +#PATCHES=("${FILESDIR}/patches") + src_prepare() { # Remove bundled stuff to ensure it's not used. - rm -r BBGE/{GL,glext} || die + rm -r BBGE/{GL,glext} || die "Removing bundled stuff failed" # Remove bundled sources. # Don't build Aquaria. @@ -40,28 +43,32 @@ src_prepare() { -e '/glpng/d' -e '/tinyxml/d' \ -e '/TARGET_LINK_LIBRARIES/d' \ -e '/ADD_EXECUTABLE[(]/,/[)]/d' \ - CMakeLists.txt || die + CMakeLists.txt || die "No Aquaria patch failed" - # Set the data prefix directory. - echo "ADD_DEFINITIONS(-DBBGE_DATA_PREFIX=\"${GAMES_DATADIR}\")" >> CMakeLists.txt || die +# # Set the data prefix directory. +# echo "ADD_DEFINITIONS(-DBBGE_DATA_PREFIX=\"${GAMES_DATADIR}\")" >> CMakeLists.txt || die "" # Always build shared. - echo 'ADD_LIBRARY(BBGE SHARED ${BBGE_SRCS})' >> CMakeLists.txt || die + echo 'ADD_LIBRARY(BBGE SHARED ${BBGE_SRCS})' >> CMakeLists.txt || die "Always-shared patch failed" # Optionally build static. if use static-libs; then - echo 'ADD_LIBRARY(BBGE_Static STATIC ${BBGE_SRCS})' >> CMakeLists.txt || die - echo 'SET_TARGET_PROPERTIES(BBGE_Static PROPERTIES OUTPUT_NAME BBGE)' >> CMakeLists.txt || die + echo 'ADD_LIBRARY(BBGE_Static STATIC ${BBGE_SRCS})' >> CMakeLists.txt || die "Static libs patch failed" + echo 'SET_TARGET_PROPERTIES(BBGE_Static PROPERTIES OUTPUT_NAME BBGE)' >> CMakeLists.txt || die "Static libs patch failed" fi # Resolve symbols now, not later. - echo 'TARGET_LINK_LIBRARIES(BBGE ftgl glpng openal SDL tinyxml vorbisfile z)' >> CMakeLists.txt || die + echo 'TARGET_LINK_LIBRARIES(BBGE ftgl glpng openal SDL tinyxml vorbisfile z)' >> CMakeLists.txt || die "Now-Resolve patch failed" # Use system headers. - ln -snf ../ExternalLibs/glfont2 BBGE/glfont2 || die - sed -i 's:\.\./ExternalLibs/::' BBGE/*.{cpp,h} || die - sed -i -r 's:["<](gl[a-z]*\.h)[">]:<GL/\1>:' BBGE/Base.h BBGE/Texture.cpp || die - sed -i -e 's:"FTGL\.h":<FTGL/ftgl.h>:' -e '/FTGLTextureFont\.h/d' BBGE/TTFFont.h || die + ln -snf ../ExternalLibs/glfont2 BBGE/glfont2 || die "system-headers patch failed" + sed -i 's:\.\./ExternalLibs/::' BBGE/*.{cpp,h} || die "system-headers patch failed" + sed -i -r 's:["<](gl[a-z]*\.h)[">]:<GL/\1>:' BBGE/Base.h BBGE/Texture.cpp || die "system-headers patch failed" + sed -i -e 's:"FTGL\.h":<FTGL/ftgl.h>:' -e '/FTGLTextureFont\.h/d' BBGE/TTFFont.h || die "system-headers patch failed" + + sed -i -e '1i#include <unistd.h>' BBGE/Joystick.cpp || die "Joystick unistd sed-patch failed" + + default } src_configure() { diff --git a/games-engines/bbge/files/gentoo-data-path.patch b/games-engines/bbge/files/gentoo-data-path.patch deleted file mode 100644 index cf3a755..0000000 --- a/games-engines/bbge/files/gentoo-data-path.patch +++ /dev/null @@ -1,40 +0,0 @@ -# HG changeset patch -# User James Le Cuirot <ch...@aura-online.co.uk> -# Date 1276623161 -3600 -# Node ID 1feb7c10b9ae5669721fad0aec3c7fb9f4ccfd78 -# Parent 3806789df5b04b632bcc3a483f4668edcb164fbc -Use /usr/share/games/<appName> for data path on Gentoo. - -diff -r 3806789df5b0 -r 1feb7c10b9ae BBGE/Core.cpp ---- a/BBGE/Core.cpp Tue Jun 15 18:21:12 2010 +0100 -+++ b/BBGE/Core.cpp Tue Jun 15 18:32:41 2010 +0100 -@@ -1008,25 +1008,10 @@ - else - debugLog("Failed to chdir to filesystem path" + filesystem); - } -- char path[PATH_MAX]; -- // always a symlink to this process's binary, on modern Linux systems. -- const ssize_t rc = readlink("/proc/self/exe", path, sizeof (path)); -- if ( (rc == -1) || (rc >= sizeof (path)) ) -- { -- // error! -- debugLog("readlink"); -- } -- else -- { -- path[rc] = '\0'; -- char *ptr = strrchr(path, '/'); -- if (ptr != NULL) -- { -- *ptr = '\0'; -- debugLog(path); -- chdir(path); -- } -- } -+ std::string path("/usr/share/games/"); -+ path.append(appName); -+ debugLog(path); -+ chdir(path.c_str()); - #endif - #ifdef BBGE_BUILD_WINDOWS - // FIXME: filesystem not handled