Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-simulation/corsix-th/, games-simulation/corsix-th/files/, profiles/
Date: Tue, 01 Dec 2020 00:17:51
Message-Id: 1606781839.93e915dd5b6402818089203c77228ad300e3047e.marecki@gentoo
1 commit: 93e915dd5b6402818089203c77228ad300e3047e
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 1 00:12:15 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 1 00:17:19 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93e915dd
7
8 games-simulation/corsix-th: migrate to lua-single.eclass
9
10 LuaJIT is in principle supported upstream but requires one to override
11 cmake detection of the Lua library, and more importantly
12 dev-lua/luasocket doesn't support this implementation yet.
13
14 PUC Lua 5.4 is known not to be supported yet, see e.g.
15 http://lua-users.org/lists/lua-l/2020-07/msg00047.html
16
17 Closes: https://bugs.gentoo.org/752954
18 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
19
20 .../corsix-th/corsix-th-0.64-r100.ebuild | 84 ++++++++++++++++++++++
21 .../files/corsix-th-0.64-cmake_lua_detection.patch | 11 +++
22 profiles/package.mask | 1 +
23 3 files changed, 96 insertions(+)
24
25 diff --git a/games-simulation/corsix-th/corsix-th-0.64-r100.ebuild b/games-simulation/corsix-th/corsix-th-0.64-r100.ebuild
26 new file mode 100644
27 index 00000000000..0b163556250
28 --- /dev/null
29 +++ b/games-simulation/corsix-th/corsix-th-0.64-r100.ebuild
30 @@ -0,0 +1,84 @@
31 +# Copyright 1999-2020 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +LUA_COMPAT=( lua5-{1..3} )
37 +
38 +inherit cmake lua-single xdg
39 +
40 +MY_PN="CorsixTH"
41 +MY_PV="$(ver_rs 2 -)"
42 +
43 +DESCRIPTION="Open source clone of Theme Hospital"
44 +HOMEPAGE="https://corsixth.com"
45 +SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
46 +
47 +LICENSE="MIT"
48 +SLOT="0"
49 +KEYWORDS="~amd64 ~arm ~x86"
50 +IUSE="doc +midi +sound +truetype +videos"
51 +
52 +REQUIRED_USE="${LUA_REQUIRED_USE}"
53 +
54 +RDEPEND="${LUA_DEPS}
55 + $(lua_gen_cond_dep '
56 + >=dev-lua/luafilesystem-1.5[${LUA_USEDEP}]
57 + >=dev-lua/lpeg-0.9[${LUA_USEDEP}]
58 + >=dev-lua/luasocket-3.0_rc1-r4[${LUA_USEDEP}]
59 + ')
60 + media-libs/libsdl2[opengl,video]
61 + sound? ( media-libs/sdl2-mixer[midi?] )
62 + truetype? ( >=media-libs/freetype-2.5.3:2 )
63 + videos? ( >=media-video/ffmpeg-2.2.3:0= )
64 +"
65 +
66 +DEPEND="${RDEPEND}"
67 +
68 +# Technically, build-time generation of documentation could use any version
69 +# of Lua (or to be precise: if in src_configure cmake has been told to use
70 +# LuaJIT documentation generation looks for LuaJIT, otherwise any
71 +# dev-lang/lua slot will do; see the first few lines of the bundled file
72 +# CMake/GenerateDoc.cmake for details) - but since dev-lang/lua:0 conflicts
73 +# with the other slots of same, try to keep the deptree sane until we get
74 +# rid of unslotted Lua.
75 +BDEPEND="
76 + virtual/pkgconfig
77 + doc? (
78 + app-doc/doxygen[dot]
79 + ${LUA_DEPS}
80 + )
81 +"
82 +
83 +PATCHES=(
84 + "${FILESDIR}"/${PN}-0.64-cmake_lua_detection.patch
85 +)
86 +
87 +S="${WORKDIR}/${MY_PN}-${MY_PV}"
88 +
89 +src_prepare() {
90 + cmake_src_prepare
91 +}
92 +
93 +src_configure() {
94 + local mycmakeargs=(
95 + -DLUA_VERSION=$(lua_get_version)
96 + -DWITH_AUDIO=$(usex sound)
97 + -DWITH_FREETYPE2=$(usex truetype)
98 + -DWITH_MOVIES=$(usex videos)
99 + )
100 + cmake_src_configure
101 +}
102 +
103 +src_compile() {
104 + cmake_src_compile
105 + use doc && cmake_src_compile doc
106 +}
107 +
108 +src_install() {
109 + cmake_src_install
110 + dodoc {changelog,CONTRIBUTING}.txt
111 +
112 + docinto html
113 + use doc && dodoc -r "${BUILD_DIR}"/doc/*
114 +}
115
116 diff --git a/games-simulation/corsix-th/files/corsix-th-0.64-cmake_lua_detection.patch b/games-simulation/corsix-th/files/corsix-th-0.64-cmake_lua_detection.patch
117 new file mode 100644
118 index 00000000000..d57fa953ad0
119 --- /dev/null
120 +++ b/games-simulation/corsix-th/files/corsix-th-0.64-cmake_lua_detection.patch
121 @@ -0,0 +1,11 @@
122 +--- a/CorsixTH/CMakeLists.txt
123 ++++ b/CorsixTH/CMakeLists.txt
124 +@@ -103,7 +103,7 @@
125 + endif()
126 +
127 + # Find Lua
128 +-find_package(Lua REQUIRED)
129 ++find_package(Lua ${LUA_VERSION} EXACT REQUIRED)
130 + if(Lua_FOUND)
131 + target_link_libraries(CorsixTH ${LUA_LIBRARY})
132 + include_directories(${LUA_INCLUDE_DIR})
133
134 diff --git a/profiles/package.mask b/profiles/package.mask
135 index 4335da53185..bbaafb49b59 100644
136 --- a/profiles/package.mask
137 +++ b/profiles/package.mask
138 @@ -569,6 +569,7 @@ dev-lua/luacrypto
139 >=games-roguelike/stone-soup-0.25.1-r100
140 >=games-rpg/kqlives-0.99-r100
141 >=games-rpg/sumwars-0.5.8-r100
142 +>=games-simulation/corsix-th-0.64-r100
143 >=mail-filter/imapfilter-2.6.16-r100
144 >=media-gfx/geeqie-1.5.1-r1
145 >=media-sound/aqualung-1.1-r100