1 |
commit: 3d5955237d11589421ba48f5958e271b9ff3def1 |
2 |
Author: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name> |
3 |
AuthorDate: Tue Jun 4 07:09:57 2013 +0000 |
4 |
Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name> |
5 |
CommitDate: Tue Jun 4 07:09:57 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/lua.git;a=commit;h=3d595523 |
7 |
|
8 |
[dev-lang/luajit] 2.0.2 release |
9 |
|
10 |
Signed-off-by: Vadim A. Misbakh-Soloviov <mva <AT> mva.name> |
11 |
|
12 |
--- |
13 |
dev-lang/luajit/Manifest | 3 +- |
14 |
dev-lang/luajit/files/v2.0.1_hotfix1.patch | 103 --------------------- |
15 |
.../{luajit-2.0.1.ebuild => luajit-2.0.2.ebuild} | 86 ++++++++--------- |
16 |
.../{luajit-9999.ebuild => luajit-2.0.9999.ebuild} | 63 ++++++------- |
17 |
.../{luajit-9999.ebuild => luajit-2.1.9999.ebuild} | 65 ++++++------- |
18 |
5 files changed, 99 insertions(+), 221 deletions(-) |
19 |
|
20 |
diff --git a/dev-lang/luajit/Manifest b/dev-lang/luajit/Manifest |
21 |
index aa8cbe1..b425ae6 100644 |
22 |
--- a/dev-lang/luajit/Manifest |
23 |
+++ b/dev-lang/luajit/Manifest |
24 |
@@ -1,2 +1 @@ |
25 |
-DIST LuaJIT-2.0.0-beta9.tar.gz 814960 SHA256 da3793b4364a17c3700d39d13eae799b82ff23da1f61631d735de05333f46240 SHA512 14f100ea0ff243b070abedc30f029afdba1792ef41b7add86623b6ba3a0e733949fc7450c531f54e2f908e32cc013106b16031bcd99754a0342636c5b41bfbb6 WHIRLPOOL 8f86e3f209d1832d02327148b7dbb248599756fa1929f03435d03db080f8659518d920ec17b5f32f55431a605e0a4615bd07bf80138fd26ed7de0f70b2a9b0db |
26 |
-DIST LuaJIT-2.0.1.tar.gz 841399 SHA256 2371cceb53453d8a7b36451e6a0ccdb66236924545d6042ddd4c34e9668990c0 SHA512 a5af5772d00dfedcf1c3449b1d74d45af25d111c91931735ad80f2c7a3b7837b51807eb3a0ce12688e38352ad32cdd70bea35b53906c945ddf86dfd706118518 WHIRLPOOL 42781f3d4efa9d515f7f1c879ffc45a13ab231c951a995eb0f1e89ff27c1dd6d0cee7795fd45dd169effc067c1bae5add36b290fd8f306f99a6ed0a99f4929ad |
27 |
+DIST LuaJIT-2.0.2.tar.gz 843031 SHA256 c05202974a5890e777b181908ac237625b499aece026654d7cc33607e3f46c38 SHA512 c1afea13ec61a59f37d1f61fc50bcac47208d9d4f0a80689b74e901ad2b34294b6c89a0b4eef54b43f3d2db411660da61b191b0bbfba4ba2f97743a9ee4484e3 WHIRLPOOL cb6e8ee6c5ac2293ca5d5452cda34769d3229e2d4681c0ce3c164659c2d2d781f8474e243747b197c10b3abc116e4145df6f5293317f1db871865f38ecd2b6cd |
28 |
|
29 |
diff --git a/dev-lang/luajit/files/v2.0.1_hotfix1.patch b/dev-lang/luajit/files/v2.0.1_hotfix1.patch |
30 |
deleted file mode 100644 |
31 |
index 0601cd9..0000000 |
32 |
--- a/dev-lang/luajit/files/v2.0.1_hotfix1.patch |
33 |
+++ /dev/null |
34 |
@@ -1,103 +0,0 @@ |
35 |
-Add missing GC steps for io.* functions. |
36 |
-MIPS: Fix cache flush/sync for JIT-compiled code jump area. |
37 |
-ARM: Fix cache flush/sync for exit stubs of JIT-compiled code. |
38 |
-Fix MSVC intrinsics for older versions. |
39 |
-Fix memory access check for fast string interning. |
40 |
- |
41 |
---- a/src/lib_io.c |
42 |
-+++ b/src/lib_io.c |
43 |
-@@ -17,6 +17,7 @@ |
44 |
- #include "lualib.h" |
45 |
- |
46 |
- #include "lj_obj.h" |
47 |
-+#include "lj_gc.h" |
48 |
- #include "lj_err.h" |
49 |
- #include "lj_str.h" |
50 |
- #include "lj_state.h" |
51 |
-@@ -152,6 +153,7 @@ static int io_file_readline(lua_State *L, FILE *fp, MSize chop) |
52 |
- if (n >= m - 64) m += m; |
53 |
- } |
54 |
- setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); |
55 |
-+ lj_gc_check(L); |
56 |
- return (int)ok; |
57 |
- } |
58 |
- |
59 |
-@@ -163,6 +165,7 @@ static void io_file_readall(lua_State *L, FILE *fp) |
60 |
- n += (MSize)fread(buf+n, 1, m-n, fp); |
61 |
- if (n != m) { |
62 |
- setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); |
63 |
-+ lj_gc_check(L); |
64 |
- return; |
65 |
- } |
66 |
- } |
67 |
-@@ -174,6 +177,7 @@ static int io_file_readlen(lua_State *L, FILE *fp, MSize m) |
68 |
- char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m); |
69 |
- MSize n = (MSize)fread(buf, 1, m, fp); |
70 |
- setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); |
71 |
-+ lj_gc_check(L); |
72 |
- return (n > 0 || m == 0); |
73 |
- } else { |
74 |
- int c = getc(fp); |
75 |
---- a/src/lj_asm_arm.h |
76 |
-+++ b/src/lj_asm_arm.h |
77 |
-@@ -91,6 +91,7 @@ static MCode *asm_exitstub_gen(ASMState *as, ExitNo group) |
78 |
- *mxp++ = group*EXITSTUBS_PER_GROUP; |
79 |
- for (i = 0; i < EXITSTUBS_PER_GROUP; i++) |
80 |
- *mxp++ = ARMI_B|((-6-i)&0x00ffffffu); |
81 |
-+ lj_mcode_sync(as->mcbot, mxp); |
82 |
- lj_mcode_commitbot(as->J, mxp); |
83 |
- as->mcbot = mxp; |
84 |
- as->mclim = as->mcbot + MCLIM_REDZONE; |
85 |
---- a/src/lj_asm_mips.h |
86 |
-+++ b/src/lj_asm_mips.h |
87 |
-@@ -71,6 +71,7 @@ static void asm_sparejump_setup(ASMState *as) |
88 |
- memset(mxp+2, 0, MIPS_SPAREJUMP*8); |
89 |
- mxp += MIPS_SPAREJUMP*2; |
90 |
- lua_assert(mxp < as->mctop); |
91 |
-+ lj_mcode_sync(as->mcbot, mxp); |
92 |
- lj_mcode_commitbot(as->J, mxp); |
93 |
- as->mcbot = mxp; |
94 |
- as->mclim = as->mcbot + MCLIM_REDZONE; |
95 |
---- a/src/lj_def.h |
96 |
-+++ b/src/lj_def.h |
97 |
-@@ -243,17 +243,17 @@ static LJ_AINLINE uint32_t lj_getu32(const void *p) |
98 |
- #endif |
99 |
- |
100 |
- #ifdef _M_PPC |
101 |
--#pragma intrinsic(_CountLeadingZeros) |
102 |
- unsigned int _CountLeadingZeros(long); |
103 |
-+#pragma intrinsic(_CountLeadingZeros) |
104 |
- static LJ_AINLINE uint32_t lj_fls(uint32_t x) |
105 |
- { |
106 |
- return _CountLeadingZeros(x) ^ 31; |
107 |
- } |
108 |
- #else |
109 |
--#pragma intrinsic(_BitScanForward) |
110 |
--#pragma intrinsic(_BitScanReverse) |
111 |
- unsigned char _BitScanForward(uint32_t *, unsigned long); |
112 |
- unsigned char _BitScanReverse(uint32_t *, unsigned long); |
113 |
-+#pragma intrinsic(_BitScanForward) |
114 |
-+#pragma intrinsic(_BitScanReverse) |
115 |
- |
116 |
- static LJ_AINLINE uint32_t lj_ffs(uint32_t x) |
117 |
- { |
118 |
---- a/src/lj_str.c |
119 |
-+++ b/src/lj_str.c |
120 |
-@@ -48,7 +48,7 @@ static LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len) |
121 |
- { |
122 |
- MSize i = 0; |
123 |
- lua_assert(len > 0); |
124 |
-- lua_assert((((uintptr_t)a + len) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4); |
125 |
-+ lua_assert((((uintptr_t)a+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4); |
126 |
- do { /* Note: innocuous access up to end of string + 3. */ |
127 |
- uint32_t v = lj_getu32(a+i) ^ *(const uint32_t *)(b+i); |
128 |
- if (v) { |
129 |
-@@ -121,7 +121,7 @@ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx) |
130 |
- h ^= b; h -= lj_rol(b, 16); |
131 |
- /* Check if the string has already been interned. */ |
132 |
- o = gcref(g->strhash[h & g->strmask]); |
133 |
-- if (LJ_LIKELY((((uintptr_t)str + len) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) { |
134 |
-+ if (LJ_LIKELY((((uintptr_t)str+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) { |
135 |
- while (o != NULL) { |
136 |
- GCstr *sx = gco2str(o); |
137 |
- if (sx->len == len && str_fastcmp(str, strdata(sx), len) == 0) { |
138 |
|
139 |
diff --git a/dev-lang/luajit/luajit-2.0.1.ebuild b/dev-lang/luajit/luajit-2.0.2.ebuild |
140 |
similarity index 64% |
141 |
rename from dev-lang/luajit/luajit-2.0.1.ebuild |
142 |
rename to dev-lang/luajit/luajit-2.0.2.ebuild |
143 |
index 0b14d62..01f4f12 100644 |
144 |
--- a/dev-lang/luajit/luajit-2.0.1.ebuild |
145 |
+++ b/dev-lang/luajit/luajit-2.0.2.ebuild |
146 |
@@ -4,17 +4,26 @@ |
147 |
|
148 |
EAPI="5" |
149 |
|
150 |
-inherit eutils multilib flag-o-matic check-reqs pax-utils |
151 |
+inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs |
152 |
+ |
153 |
+MY_PV="$(get_version_component_range 1-3)" |
154 |
+MY_P="LuaJIT-${MY_PV}" |
155 |
+if [[ $(get_version_component_range 4) != "" ]]; then |
156 |
+ HOTFIX="v${PV}" |
157 |
+ HOTFIX="${HOTFIX/_p/_hotfix}.patch" |
158 |
+fi |
159 |
|
160 |
-MY_P="LuaJIT-${PV/_/-}" |
161 |
DESCRIPTION="Just-In-Time Compiler for the Lua programming language" |
162 |
HOMEPAGE="http://luajit.org/" |
163 |
-SRC_URI="http://luajit.org/download/${MY_P}.tar.gz" |
164 |
+SRC_URI=" |
165 |
+ http://luajit.org/download/${MY_P}.tar.gz |
166 |
+ ${HOTFIX:+http://luajit.org/download/${HOTFIX}} |
167 |
+" |
168 |
|
169 |
LICENSE="MIT" |
170 |
SLOT="2" |
171 |
-KEYWORDS="~amd64 ~x86" |
172 |
-IUSE="+optimization lua52compat" |
173 |
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" |
174 |
+IUSE="lua52compat +optimization" |
175 |
|
176 |
DEPEND="" |
177 |
PDEPEND=" |
178 |
@@ -23,12 +32,14 @@ PDEPEND=" |
179 |
|
180 |
S="${WORKDIR}/${MY_P}" |
181 |
|
182 |
+HTML_DOCS=( "doc/" ) |
183 |
+ |
184 |
check_req() { |
185 |
if use optimization; then |
186 |
CHECKREQS_MEMORY="200M" |
187 |
ewarn "Optimized (amalgamated) build wants at least 200MB of RAM" |
188 |
ewarn "If you have no such RAM - try to disable 'optimization' flag" |
189 |
- check-reqs_pkg_${1} |
190 |
+ check-reqs_pkg_${1} |
191 |
fi |
192 |
} |
193 |
|
194 |
@@ -40,34 +51,21 @@ pkg_setup() { |
195 |
check_req setup |
196 |
} |
197 |
|
198 |
-src_prepare(){ |
199 |
+src_prepare() { |
200 |
+ if [[ -n ${HOTFIX} ]]; then |
201 |
+ epatch "${DISTDIR}/${HOTFIX}" |
202 |
+ fi |
203 |
+ |
204 |
# fixing prefix and version |
205 |
- sed -e "s|/usr/local|/usr|" \ |
206 |
+ sed \ |
207 |
+ -e "s|/usr/local|/usr|" \ |
208 |
-e "s|/lib|/$(get_libdir)|" \ |
209 |
- -e "s|VERSION=.*|VERSION= ${PV}|" \ |
210 |
-i Makefile || die "failed to fix prefix in Makefile" |
211 |
|
212 |
- sed -e "s|\(share/luajit\)-[^\"]*|\1-${PV}/|g" \ |
213 |
+ sed \ |
214 |
-e "s|/usr/local|/usr|" \ |
215 |
-e "s|lib/|$(get_libdir)/|" \ |
216 |
-i src/luaconf.h || die "failed to fix prefix in luaconf.h" |
217 |
- |
218 |
- if use lua52compat; then |
219 |
- sed \ |
220 |
- -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \ |
221 |
- -i src/Makefile || die "Lua-5.2 compat fix failed" |
222 |
- fi |
223 |
- |
224 |
- # removing strip |
225 |
- sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \ |
226 |
- || die "failed to remove forced strip" |
227 |
- |
228 |
- # fixing pkg-config file (Lua-replacing compatibility) |
229 |
- sed -r \ |
230 |
- -e 's#(INSTALL_CMOD=.*)#\1\nINSTALL_INC=${includedir}#' \ |
231 |
- -i etc/luajit.pc || die "failed to fix pkgconfig file" |
232 |
- |
233 |
- epatch "${FILESDIR}/v${PV}_hotfix1.patch" |
234 |
} |
235 |
|
236 |
src_compile() { |
237 |
@@ -88,9 +86,11 @@ src_compile() { |
238 |
# ebuild, I choose method "a" |
239 |
# (since it is more secure on hardened systems, imho) + |
240 |
# + ewarn user, that he really should disable ccache. |
241 |
+ # append-ldflags -nopie |
242 |
|
243 |
-# append-ldflags -nopie |
244 |
+# append-ldflags -nopie |
245 |
append-cflags -fPIC |
246 |
+ |
247 |
ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," |
248 |
ewarn "we need to either:" |
249 |
ewarn " a) add -fPIC to CFLAGS, or" |
250 |
@@ -108,23 +108,23 @@ src_compile() { |
251 |
ewarn "to disable ccache instead." |
252 |
fi |
253 |
|
254 |
- emake "${opt}" |
255 |
+ emake \ |
256 |
+ Q= \ |
257 |
+ HOST_CC="$(tc-getBUILD_CC)" \ |
258 |
+ STATIC_CC="$(tc-getCC)" \ |
259 |
+ DYNAMIC_CC="$(tc-getCC) -fPIC" \ |
260 |
+ TARGET_LD="$(tc-getCC)" \ |
261 |
+ TARGET_AR="$(tc-getAR) rcus" \ |
262 |
+ TARGET_STRIP="true" \ |
263 |
+ XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ |
264 |
+ "${opt}" |
265 |
} |
266 |
|
267 |
src_install() { |
268 |
default |
269 |
- host-is-pax && pax-mark m "${D}usr/bin/${P}" |
270 |
- dosym "luajit-${PV}" "/usr/bin/${PN}" |
271 |
- newbin "${FILESDIR}/luac.jit" "luac-${P}" |
272 |
-} |
273 |
+ base_src_install_docs |
274 |
|
275 |
-pkg_postinst() { |
276 |
- if ! has_version dev-lua/iluajit; then |
277 |
- einfo "You'd probably want to install dev-lua/iluajit to"; |
278 |
- ewarn "get fully functional interactive shell for LuaJIT"; |
279 |
- fi |
280 |
- if has_version app-editors/emacs || has_version app-editors/xemacs; then |
281 |
- einfo "You'd probably want to install app-emacs/lua-mode to"; |
282 |
- ewarn "get Lua completion in emacs."; |
283 |
- fi |
284 |
-} |
285 |
\ No newline at end of file |
286 |
+ host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" |
287 |
+ dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" |
288 |
+ newbin "${FILESDIR}/luac.jit" "luac-${MY_PV}" |
289 |
+} |
290 |
|
291 |
diff --git a/dev-lang/luajit/luajit-9999.ebuild b/dev-lang/luajit/luajit-2.0.9999.ebuild |
292 |
similarity index 68% |
293 |
copy from dev-lang/luajit/luajit-9999.ebuild |
294 |
copy to dev-lang/luajit/luajit-2.0.9999.ebuild |
295 |
index 08f52e0..5086ac9 100644 |
296 |
--- a/dev-lang/luajit/luajit-9999.ebuild |
297 |
+++ b/dev-lang/luajit/luajit-2.0.9999.ebuild |
298 |
@@ -4,7 +4,9 @@ |
299 |
|
300 |
EAPI="5" |
301 |
|
302 |
-inherit eutils multilib flag-o-matic check-reqs pax-utils git-2 |
303 |
+inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs git-2 |
304 |
+ |
305 |
+MY_PV="2.0.1" |
306 |
|
307 |
DESCRIPTION="Just-In-Time Compiler for the Lua programming language" |
308 |
HOMEPAGE="http://luajit.org/" |
309 |
@@ -14,13 +16,15 @@ EGIT_REPO_URI="http://luajit.org/git/luajit-2.0.git" |
310 |
LICENSE="MIT" |
311 |
SLOT="2" |
312 |
KEYWORDS="" |
313 |
-IUSE="+optimization lua52compat" |
314 |
+IUSE="lua52compat +optimization" |
315 |
|
316 |
DEPEND="" |
317 |
PDEPEND=" |
318 |
virtual/lua[luajit] |
319 |
" |
320 |
|
321 |
+HTML_DOCS=( "doc/" ) |
322 |
+ |
323 |
check_req() { |
324 |
if use optimization; then |
325 |
CHECKREQS_MEMORY="200M" |
326 |
@@ -40,30 +44,15 @@ pkg_setup() { |
327 |
|
328 |
src_prepare(){ |
329 |
# fixing prefix and version |
330 |
- sed -e "s|/usr/local|/usr|" \ |
331 |
+ sed \ |
332 |
+ -e "s|/usr/local|/usr|" \ |
333 |
-e "s|/lib|/$(get_libdir)|" \ |
334 |
- -e "s|VERSION=.*|VERSION= ${PV}|" \ |
335 |
-i Makefile || die "failed to fix prefix in Makefile" |
336 |
|
337 |
- sed -e "s|\(share/luajit\)-[^\"]*|\1-${PV}/|g" \ |
338 |
+ sed \ |
339 |
-e "s|/usr/local|/usr|" \ |
340 |
-e "s|lib/|$(get_libdir)/|" \ |
341 |
-i src/luaconf.h || die "failed to fix prefix in luaconf.h" |
342 |
- |
343 |
- if use lua52compat; then |
344 |
- sed \ |
345 |
- -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \ |
346 |
- -i src/Makefile || die "Lua-5.2 compat fix failed" |
347 |
- fi |
348 |
- |
349 |
- # removing strip |
350 |
- sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \ |
351 |
- || die "failed to remove forced strip" |
352 |
- |
353 |
- # fixing pkg-config file (Lua-replacing compatibility) |
354 |
- sed -r \ |
355 |
- -e 's#(INSTALL_CMOD=.*)#\1\nINSTALL_INC=${includedir}#' \ |
356 |
- -i etc/luajit.pc || die "failed to fix pkgconfig file" |
357 |
} |
358 |
|
359 |
src_compile() { |
360 |
@@ -84,9 +73,11 @@ src_compile() { |
361 |
# ebuild, I choose method "a" |
362 |
# (since it is more secure on hardened systems, imho) + |
363 |
# + ewarn user, that he really should disable ccache. |
364 |
+ # append-ldflags -nopie |
365 |
|
366 |
-# append-ldflags -nopie |
367 |
+# append-ldflags -nopie |
368 |
append-cflags -fPIC |
369 |
+ |
370 |
ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," |
371 |
ewarn "we need to either:" |
372 |
ewarn " a) add -fPIC to CFLAGS, or" |
373 |
@@ -104,23 +95,23 @@ src_compile() { |
374 |
ewarn "to disable ccache instead." |
375 |
fi |
376 |
|
377 |
- emake "${opt}" |
378 |
+ emake \ |
379 |
+ Q= \ |
380 |
+ HOST_CC="$(tc-getBUILD_CC)" \ |
381 |
+ STATIC_CC="$(tc-getCC)" \ |
382 |
+ DYNAMIC_CC="$(tc-getCC) -fPIC" \ |
383 |
+ TARGET_LD="$(tc-getCC)" \ |
384 |
+ TARGET_AR="$(tc-getAR) rcus" \ |
385 |
+ TARGET_STRIP="true" \ |
386 |
+ XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ |
387 |
+ "${opt}" |
388 |
} |
389 |
|
390 |
src_install() { |
391 |
default |
392 |
- host-is-pax && pax-mark m "${D}usr/bin/${P}" |
393 |
- dosym "luajit-${PV}" "/usr/bin/${PN}" |
394 |
- newbin "${FILESDIR}/luac.jit" "luac-${P}" |
395 |
-} |
396 |
+ base_src_install_docs |
397 |
|
398 |
-pkg_postinst() { |
399 |
- if ! has_version dev-lua/iluajit; then |
400 |
- einfo "You'd probably want to install dev-lua/iluajit to"; |
401 |
- ewarn "get fully functional interactive shell for LuaJIT"; |
402 |
- fi |
403 |
- if has_version app-editors/emacs || has_version app-editors/xemacs; then |
404 |
- einfo "You'd probably want to install app-emacs/lua-mode to"; |
405 |
- ewarn "get Lua completion in emacs."; |
406 |
- fi |
407 |
-} |
408 |
+ host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" |
409 |
+ dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" |
410 |
+ newbin "${FILESDIR}/luac.jit" "luac-${MY_PV}" |
411 |
+} |
412 |
\ No newline at end of file |
413 |
|
414 |
diff --git a/dev-lang/luajit/luajit-9999.ebuild b/dev-lang/luajit/luajit-2.1.9999.ebuild |
415 |
similarity index 67% |
416 |
rename from dev-lang/luajit/luajit-9999.ebuild |
417 |
rename to dev-lang/luajit/luajit-2.1.9999.ebuild |
418 |
index 08f52e0..0b39743 100644 |
419 |
--- a/dev-lang/luajit/luajit-9999.ebuild |
420 |
+++ b/dev-lang/luajit/luajit-2.1.9999.ebuild |
421 |
@@ -4,23 +4,27 @@ |
422 |
|
423 |
EAPI="5" |
424 |
|
425 |
-inherit eutils multilib flag-o-matic check-reqs pax-utils git-2 |
426 |
+inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs git-2 |
427 |
+ |
428 |
+MY_PV="2.1.0-alpha" |
429 |
|
430 |
DESCRIPTION="Just-In-Time Compiler for the Lua programming language" |
431 |
HOMEPAGE="http://luajit.org/" |
432 |
SRC_URI="" |
433 |
EGIT_REPO_URI="http://luajit.org/git/luajit-2.0.git" |
434 |
+EGIT_BRANCH="v2.1" |
435 |
|
436 |
LICENSE="MIT" |
437 |
SLOT="2" |
438 |
KEYWORDS="" |
439 |
-IUSE="+optimization lua52compat" |
440 |
+IUSE="lua52compat +optimization" |
441 |
|
442 |
-DEPEND="" |
443 |
PDEPEND=" |
444 |
virtual/lua[luajit] |
445 |
" |
446 |
|
447 |
+HTML_DOCS=( "doc/" ) |
448 |
+ |
449 |
check_req() { |
450 |
if use optimization; then |
451 |
CHECKREQS_MEMORY="200M" |
452 |
@@ -40,30 +44,15 @@ pkg_setup() { |
453 |
|
454 |
src_prepare(){ |
455 |
# fixing prefix and version |
456 |
- sed -e "s|/usr/local|/usr|" \ |
457 |
+ sed \ |
458 |
+ -e "s|/usr/local|/usr|" \ |
459 |
-e "s|/lib|/$(get_libdir)|" \ |
460 |
- -e "s|VERSION=.*|VERSION= ${PV}|" \ |
461 |
-i Makefile || die "failed to fix prefix in Makefile" |
462 |
|
463 |
- sed -e "s|\(share/luajit\)-[^\"]*|\1-${PV}/|g" \ |
464 |
+ sed \ |
465 |
-e "s|/usr/local|/usr|" \ |
466 |
-e "s|lib/|$(get_libdir)/|" \ |
467 |
-i src/luaconf.h || die "failed to fix prefix in luaconf.h" |
468 |
- |
469 |
- if use lua52compat; then |
470 |
- sed \ |
471 |
- -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \ |
472 |
- -i src/Makefile || die "Lua-5.2 compat fix failed" |
473 |
- fi |
474 |
- |
475 |
- # removing strip |
476 |
- sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \ |
477 |
- || die "failed to remove forced strip" |
478 |
- |
479 |
- # fixing pkg-config file (Lua-replacing compatibility) |
480 |
- sed -r \ |
481 |
- -e 's#(INSTALL_CMOD=.*)#\1\nINSTALL_INC=${includedir}#' \ |
482 |
- -i etc/luajit.pc || die "failed to fix pkgconfig file" |
483 |
} |
484 |
|
485 |
src_compile() { |
486 |
@@ -84,9 +73,11 @@ src_compile() { |
487 |
# ebuild, I choose method "a" |
488 |
# (since it is more secure on hardened systems, imho) + |
489 |
# + ewarn user, that he really should disable ccache. |
490 |
+ # append-ldflags -nopie |
491 |
|
492 |
-# append-ldflags -nopie |
493 |
+# append-ldflags -nopie |
494 |
append-cflags -fPIC |
495 |
+ |
496 |
ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," |
497 |
ewarn "we need to either:" |
498 |
ewarn " a) add -fPIC to CFLAGS, or" |
499 |
@@ -104,23 +95,23 @@ src_compile() { |
500 |
ewarn "to disable ccache instead." |
501 |
fi |
502 |
|
503 |
- emake "${opt}" |
504 |
+ emake \ |
505 |
+ Q= \ |
506 |
+ HOST_CC="$(tc-getBUILD_CC)" \ |
507 |
+ STATIC_CC="$(tc-getCC)" \ |
508 |
+ DYNAMIC_CC="$(tc-getCC) -fPIC" \ |
509 |
+ TARGET_LD="$(tc-getCC)" \ |
510 |
+ TARGET_AR="$(tc-getAR) rcus" \ |
511 |
+ TARGET_STRIP="true" \ |
512 |
+ XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ |
513 |
+ "${opt}" |
514 |
} |
515 |
|
516 |
src_install() { |
517 |
default |
518 |
- host-is-pax && pax-mark m "${D}usr/bin/${P}" |
519 |
- dosym "luajit-${PV}" "/usr/bin/${PN}" |
520 |
- newbin "${FILESDIR}/luac.jit" "luac-${P}" |
521 |
-} |
522 |
+ base_src_install_docs |
523 |
|
524 |
-pkg_postinst() { |
525 |
- if ! has_version dev-lua/iluajit; then |
526 |
- einfo "You'd probably want to install dev-lua/iluajit to"; |
527 |
- ewarn "get fully functional interactive shell for LuaJIT"; |
528 |
- fi |
529 |
- if has_version app-editors/emacs || has_version app-editors/xemacs; then |
530 |
- einfo "You'd probably want to install app-emacs/lua-mode to"; |
531 |
- ewarn "get Lua completion in emacs."; |
532 |
- fi |
533 |
-} |
534 |
+ host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" |
535 |
+ dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" |
536 |
+ newbin "${FILESDIR}/luac.jit" "luac-${MY_PV}" |
537 |
+} |
538 |
\ No newline at end of file |