summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2020-11-29 20:20:59 +0100
committerMarek Szuba <marecki@gentoo.org>2020-11-29 20:41:58 +0100
commit1e16f00ebe854302532ed3d504e33062bd17afe8 (patch)
tree6aa80c7e83937ed965ec52306eb853fb81b147b7 /sci-astronomy/celestia/celestia-9999.ebuild
parentsci-libs/plplot: migrate to lua-single.eclass (diff)
downloadgentoo-1e16f00ebe854302532ed3d504e33062bd17afe8.tar.gz
gentoo-1e16f00ebe854302532ed3d504e33062bd17afe8.tar.bz2
gentoo-1e16f00ebe854302532ed3d504e33062bd17afe8.zip
sci-astronomy/celestia: migrate to lua-single.eclass
Both the release and the live ebuild. Closes: https://bugs.gentoo.org/752828 Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'sci-astronomy/celestia/celestia-9999.ebuild')
-rw-r--r--sci-astronomy/celestia/celestia-9999.ebuild19
1 files changed, 16 insertions, 3 deletions
diff --git a/sci-astronomy/celestia/celestia-9999.ebuild b/sci-astronomy/celestia/celestia-9999.ebuild
index c38a6c82ab31..dd539877e827 100644
--- a/sci-astronomy/celestia/celestia-9999.ebuild
+++ b/sci-astronomy/celestia/celestia-9999.ebuild
@@ -3,7 +3,9 @@
EAPI=7
-inherit desktop flag-o-matic xdg cmake
+LUA_COMPAT=( lua5-{1..3} luajit )
+
+inherit desktop flag-o-matic lua-single xdg cmake
if [[ ${PV} == *9999 ]] ; then
EGIT_REPO_URI="https://github.com/CelestiaProject/Celestia.git"
@@ -26,7 +28,8 @@ HOMEPAGE="https://celestia.space"
LICENSE="GPL-2+"
SLOT="0"
IUSE="glut lua nls +qt5 theora"
-REQUIRED_USE="|| ( glut qt5 )"
+REQUIRED_USE="|| ( glut qt5 )
+ lua? ( ${LUA_REQUIRED_USE} )"
BDEPEND="
dev-cpp/eigen
@@ -42,7 +45,7 @@ DEPEND="
virtual/jpeg:0
virtual/opengl
glut? ( media-libs/freeglut )
- lua? ( dev-lang/lua:* )
+ lua? ( ${LUA_DEPS} )
qt5? (
dev-qt/qtcore:5
dev-qt/qtgui:5
@@ -60,6 +63,8 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.5.0-desktop.patch
# add a ~/.celestia for extra directories
"${FILESDIR}"/${PN}-1.6.99-cfg.patch
+ # allow forcing CMake to look for a specific Lua version instead of the newest branch installed
+ "${FILESDIR}"/${PN}-1.7.0-cmake_lua_version.patch
)
src_prepare() {
@@ -81,6 +86,14 @@ src_configure() {
-DENABLE_WIN=OFF
-DENABLE_THEORA="$(usex theora)"
)
+ # Upstream always looks for LuaJIT first unless stopped, and we only need
+ # the version specification when linking against PUC Lua
+ if use lua && ! use lua_single_target_luajit; then
+ mycmakeargs+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_LuaJIT=ON
+ -DLUA_VERSION=$(lua_get_version)
+ )
+ fi
cmake_src_configure
}