1 |
commit: 1e16f00ebe854302532ed3d504e33062bd17afe8 |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 29 19:20:59 2020 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 29 19:41:58 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e16f00e |
7 |
|
8 |
sci-astronomy/celestia: migrate to lua-single.eclass |
9 |
|
10 |
Both the release and the live ebuild. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/752828 |
13 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
14 |
|
15 |
profiles/package.mask | 1 + |
16 |
....ebuild => celestia-1.7.0_pre20200316-r100.ebuild} | 19 ++++++++++++++++--- |
17 |
sci-astronomy/celestia/celestia-9999.ebuild | 19 ++++++++++++++++--- |
18 |
.../files/celestia-1.7.0-cmake_lua_version.patch | 11 +++++++++++ |
19 |
4 files changed, 44 insertions(+), 6 deletions(-) |
20 |
|
21 |
diff --git a/profiles/package.mask b/profiles/package.mask |
22 |
index 94c62c87a59..1f8a52a3556 100644 |
23 |
--- a/profiles/package.mask |
24 |
+++ b/profiles/package.mask |
25 |
@@ -559,6 +559,7 @@ dev-lua/luacrypto |
26 |
>=net-analyzer/suricata-6.0.0-r100 |
27 |
>=net-im/swift-4.0.2-r100 |
28 |
>=net-p2p/eiskaltdcpp-2.2.10-r100 |
29 |
+>=sci-astronomy/celestia-1.7.0_pre20200316-r100 |
30 |
>=sci-libs/plplot-5.15.0-r100 |
31 |
>=sci-visualization/gnuplot-5.4.0-r100 |
32 |
>=sci-visualization/fityk-1.3.1-r100 |
33 |
|
34 |
diff --git a/sci-astronomy/celestia/celestia-9999.ebuild b/sci-astronomy/celestia/celestia-1.7.0_pre20200316-r100.ebuild |
35 |
similarity index 79% |
36 |
copy from sci-astronomy/celestia/celestia-9999.ebuild |
37 |
copy to sci-astronomy/celestia/celestia-1.7.0_pre20200316-r100.ebuild |
38 |
index c38a6c82ab3..dd539877e82 100644 |
39 |
--- a/sci-astronomy/celestia/celestia-9999.ebuild |
40 |
+++ b/sci-astronomy/celestia/celestia-1.7.0_pre20200316-r100.ebuild |
41 |
@@ -3,7 +3,9 @@ |
42 |
|
43 |
EAPI=7 |
44 |
|
45 |
-inherit desktop flag-o-matic xdg cmake |
46 |
+LUA_COMPAT=( lua5-{1..3} luajit ) |
47 |
+ |
48 |
+inherit desktop flag-o-matic lua-single xdg cmake |
49 |
|
50 |
if [[ ${PV} == *9999 ]] ; then |
51 |
EGIT_REPO_URI="https://github.com/CelestiaProject/Celestia.git" |
52 |
@@ -26,7 +28,8 @@ HOMEPAGE="https://celestia.space" |
53 |
LICENSE="GPL-2+" |
54 |
SLOT="0" |
55 |
IUSE="glut lua nls +qt5 theora" |
56 |
-REQUIRED_USE="|| ( glut qt5 )" |
57 |
+REQUIRED_USE="|| ( glut qt5 ) |
58 |
+ lua? ( ${LUA_REQUIRED_USE} )" |
59 |
|
60 |
BDEPEND=" |
61 |
dev-cpp/eigen |
62 |
@@ -42,7 +45,7 @@ DEPEND=" |
63 |
virtual/jpeg:0 |
64 |
virtual/opengl |
65 |
glut? ( media-libs/freeglut ) |
66 |
- lua? ( dev-lang/lua:* ) |
67 |
+ lua? ( ${LUA_DEPS} ) |
68 |
qt5? ( |
69 |
dev-qt/qtcore:5 |
70 |
dev-qt/qtgui:5 |
71 |
@@ -60,6 +63,8 @@ PATCHES=( |
72 |
"${FILESDIR}"/${PN}-1.5.0-desktop.patch |
73 |
# add a ~/.celestia for extra directories |
74 |
"${FILESDIR}"/${PN}-1.6.99-cfg.patch |
75 |
+ # allow forcing CMake to look for a specific Lua version instead of the newest branch installed |
76 |
+ "${FILESDIR}"/${PN}-1.7.0-cmake_lua_version.patch |
77 |
) |
78 |
|
79 |
src_prepare() { |
80 |
@@ -81,6 +86,14 @@ src_configure() { |
81 |
-DENABLE_WIN=OFF |
82 |
-DENABLE_THEORA="$(usex theora)" |
83 |
) |
84 |
+ # Upstream always looks for LuaJIT first unless stopped, and we only need |
85 |
+ # the version specification when linking against PUC Lua |
86 |
+ if use lua && ! use lua_single_target_luajit; then |
87 |
+ mycmakeargs+=( |
88 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_LuaJIT=ON |
89 |
+ -DLUA_VERSION=$(lua_get_version) |
90 |
+ ) |
91 |
+ fi |
92 |
cmake_src_configure |
93 |
} |
94 |
|
95 |
|
96 |
diff --git a/sci-astronomy/celestia/celestia-9999.ebuild b/sci-astronomy/celestia/celestia-9999.ebuild |
97 |
index c38a6c82ab3..dd539877e82 100644 |
98 |
--- a/sci-astronomy/celestia/celestia-9999.ebuild |
99 |
+++ b/sci-astronomy/celestia/celestia-9999.ebuild |
100 |
@@ -3,7 +3,9 @@ |
101 |
|
102 |
EAPI=7 |
103 |
|
104 |
-inherit desktop flag-o-matic xdg cmake |
105 |
+LUA_COMPAT=( lua5-{1..3} luajit ) |
106 |
+ |
107 |
+inherit desktop flag-o-matic lua-single xdg cmake |
108 |
|
109 |
if [[ ${PV} == *9999 ]] ; then |
110 |
EGIT_REPO_URI="https://github.com/CelestiaProject/Celestia.git" |
111 |
@@ -26,7 +28,8 @@ HOMEPAGE="https://celestia.space" |
112 |
LICENSE="GPL-2+" |
113 |
SLOT="0" |
114 |
IUSE="glut lua nls +qt5 theora" |
115 |
-REQUIRED_USE="|| ( glut qt5 )" |
116 |
+REQUIRED_USE="|| ( glut qt5 ) |
117 |
+ lua? ( ${LUA_REQUIRED_USE} )" |
118 |
|
119 |
BDEPEND=" |
120 |
dev-cpp/eigen |
121 |
@@ -42,7 +45,7 @@ DEPEND=" |
122 |
virtual/jpeg:0 |
123 |
virtual/opengl |
124 |
glut? ( media-libs/freeglut ) |
125 |
- lua? ( dev-lang/lua:* ) |
126 |
+ lua? ( ${LUA_DEPS} ) |
127 |
qt5? ( |
128 |
dev-qt/qtcore:5 |
129 |
dev-qt/qtgui:5 |
130 |
@@ -60,6 +63,8 @@ PATCHES=( |
131 |
"${FILESDIR}"/${PN}-1.5.0-desktop.patch |
132 |
# add a ~/.celestia for extra directories |
133 |
"${FILESDIR}"/${PN}-1.6.99-cfg.patch |
134 |
+ # allow forcing CMake to look for a specific Lua version instead of the newest branch installed |
135 |
+ "${FILESDIR}"/${PN}-1.7.0-cmake_lua_version.patch |
136 |
) |
137 |
|
138 |
src_prepare() { |
139 |
@@ -81,6 +86,14 @@ src_configure() { |
140 |
-DENABLE_WIN=OFF |
141 |
-DENABLE_THEORA="$(usex theora)" |
142 |
) |
143 |
+ # Upstream always looks for LuaJIT first unless stopped, and we only need |
144 |
+ # the version specification when linking against PUC Lua |
145 |
+ if use lua && ! use lua_single_target_luajit; then |
146 |
+ mycmakeargs+=( |
147 |
+ -DCMAKE_DISABLE_FIND_PACKAGE_LuaJIT=ON |
148 |
+ -DLUA_VERSION=$(lua_get_version) |
149 |
+ ) |
150 |
+ fi |
151 |
cmake_src_configure |
152 |
} |
153 |
|
154 |
|
155 |
diff --git a/sci-astronomy/celestia/files/celestia-1.7.0-cmake_lua_version.patch b/sci-astronomy/celestia/files/celestia-1.7.0-cmake_lua_version.patch |
156 |
new file mode 100644 |
157 |
index 00000000000..80fba5d447a |
158 |
--- /dev/null |
159 |
+++ b/sci-astronomy/celestia/files/celestia-1.7.0-cmake_lua_version.patch |
160 |
@@ -0,0 +1,11 @@ |
161 |
+--- a/CMakeLists.txt |
162 |
++++ b/CMakeLists.txt |
163 |
+@@ -179,7 +179,7 @@ |
164 |
+ |
165 |
+ find_package(LuaJIT) |
166 |
+ if(NOT LUAJIT_FOUND) |
167 |
+- find_package(Lua REQUIRED) |
168 |
++ find_package(Lua ${LUA_VERSION} EXACT REQUIRED) |
169 |
+ endif() |
170 |
+ include_directories(${LUA_INCLUDE_DIR}) |
171 |
+ link_libraries(${LUA_LIBRARIES}) |