commit:     bdf6beaf2fba3f2fecadbbd2efe6bff73271cc1c
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  1 11:19:14 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Tue Dec  1 13:23:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdf6beaf

games-sports/xmoto: migrate to lua-single.eclass

Closes: https://bugs.gentoo.org/752705
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../files/xmoto-0.6.1_cmake_lua_version.patch      | 13 ++++
 games-sports/xmoto/xmoto-0.6.1-r100.ebuild         | 72 ++++++++++++++++++++++
 profiles/package.mask                              |  1 +
 3 files changed, 86 insertions(+)

diff --git a/games-sports/xmoto/files/xmoto-0.6.1_cmake_lua_version.patch 
b/games-sports/xmoto/files/xmoto-0.6.1_cmake_lua_version.patch
new file mode 100644
index 00000000000..53a29161a14
--- /dev/null
+++ b/games-sports/xmoto/files/xmoto-0.6.1_cmake_lua_version.patch
@@ -0,0 +1,13 @@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -40,8 +40,8 @@
+ endif()
+ find_package(PNG REQUIRED)
+ 
+-find_package(Lua)
+-set(USE_SYSTEM_Lua 
$<AND:$<BOOL:${PREFER_SYSTEM_Lua}>,$<BOOL:${LUA51_FOUND}>,$<NOT:$<BOOL:${WIN32}>>>)
++find_package(Lua ${LUA_VERSION} EXACT REQUIRED)
++set(USE_SYSTEM_Lua 
$<AND:$<BOOL:${PREFER_SYSTEM_Lua}>,$<BOOL:${LUA_FOUND}>,$<NOT:$<BOOL:${WIN32}>>>)
+ if (NOT LUA_VERSION_STRING VERSION_LESS 5.2 AND LUA_VERSION_STRING 
VERSION_LESS 5.3)
+     add_definitions("-DLUA_COMPAT_ALL")
+ elseif (LUA_VERSION_STRING VERSION_GREATER_EQUAL "5.3")

diff --git a/games-sports/xmoto/xmoto-0.6.1-r100.ebuild 
b/games-sports/xmoto/xmoto-0.6.1-r100.ebuild
new file mode 100644
index 00000000000..aa6635754fc
--- /dev/null
+++ b/games-sports/xmoto/xmoto-0.6.1-r100.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-{1..3} )
+
+inherit cmake lua-single
+
+DESCRIPTION="A challenging 2D motocross platform game, where physics play an 
important role"
+HOMEPAGE="https://xmoto.tuxfamily.org";
+SRC_URI="https://github.com/xmoto/xmoto/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="double-precision +nls"
+
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RDEPEND="app-arch/bzip2
+       dev-db/sqlite:3
+       dev-games/ode[double-precision=]
+       ${LUA_DEPS}
+       dev-libs/libxdg-basedir
+       dev-libs/libxml2
+       media-fonts/dejavu
+       media-libs/libpng:0=
+       media-libs/libsdl[joystick,opengl]
+       media-libs/sdl-mixer[vorbis]
+       media-libs/sdl-net
+       media-libs/sdl-ttf
+       net-misc/curl
+       sys-libs/zlib:=
+       virtual/jpeg:0
+       virtual/glu
+       virtual/opengl
+       nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}"
+BDEPEND="app-arch/xz-utils
+       nls? ( sys-devel/gettext )"
+
+PATCHES=(
+       "${FILESDIR}/${P}_lua_deprecated.patch"
+       "${FILESDIR}/${PN}-0.6.1_cmake_lua_version.patch"
+)
+
+src_prepare() {
+       sed -e "/^Icon/s/.xpm//" -i extra/xmoto.desktop || die
+       sed -e "/add_subdirectory.*\(bzip2\|libccd\|lua\|ode\|xdgbasedir\)/d" 
-i src/CMakeLists.txt || die
+       rm -rf vendor/{bzip2,lua,ode,xdgbasedir} || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DUSE_GETTEXT=$(usex nls)
+               -DOpenGL_GL_PREFERENCE=GLVND
+               -DLUA_VERSION=$(lua_get_version)
+       )
+
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+
+       rm -f "${ED}/usr/share/xmoto"/Textures/Fonts/DejaVuSans{Mono,}.ttf || 
die
+       dosym ../../../fonts/dejavu/DejaVuSans.ttf 
/usr/share/xmoto/Textures/Fonts/DejaVuSans.ttf
+       dosym ../../../fonts/dejavu/DejaVuSansMono.ttf 
/usr/share/xmoto/Textures/Fonts/DejaVuSansMono.ttf
+}

diff --git a/profiles/package.mask b/profiles/package.mask
index 04c5357b1fe..64b96923cb5 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -582,6 +582,7 @@ dev-lua/luacrypto
 >=games-rpg/kqlives-0.99-r100
 >=games-rpg/sumwars-0.5.8-r100
 >=games-simulation/corsix-th-0.64-r100
+>=games-sports/xmoto-0.6.1-r100
 >=mail-filter/imapfilter-2.6.16-r100
 >=media-gfx/geeqie-1.5.1-r1
 >=media-sound/aqualung-1.1-r100

Reply via email to