diff options
author | Vadim A. Misbakh-Soloviov <mva@mva.name> | 2013-06-04 14:09:57 +0700 |
---|---|---|
committer | Vadim A. Misbakh-Soloviov <mva@mva.name> | 2013-06-04 14:09:57 +0700 |
commit | 3d5955237d11589421ba48f5958e271b9ff3def1 (patch) | |
tree | 9c06a250f0632f07198d7c701aa64d7430be9fdc /dev-lang | |
parent | [dev-lua/luaexpat] temp luajit-related fix (diff) | |
download | lua-3d5955237d11589421ba48f5958e271b9ff3def1.tar.gz lua-3d5955237d11589421ba48f5958e271b9ff3def1.tar.bz2 lua-3d5955237d11589421ba48f5958e271b9ff3def1.zip |
[dev-lang/luajit] 2.0.2 release
Signed-off-by: Vadim A. Misbakh-Soloviov <mva@mva.name>
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/luajit/Manifest | 3 | ||||
-rw-r--r-- | dev-lang/luajit/files/v2.0.1_hotfix1.patch | 103 | ||||
-rw-r--r-- | dev-lang/luajit/luajit-2.0.2.ebuild (renamed from dev-lang/luajit/luajit-2.0.1.ebuild) | 86 | ||||
-rw-r--r-- | dev-lang/luajit/luajit-2.0.9999.ebuild (renamed from dev-lang/luajit/luajit-9999.ebuild) | 63 | ||||
-rw-r--r-- | dev-lang/luajit/luajit-2.1.9999.ebuild | 117 |
5 files changed, 188 insertions, 184 deletions
diff --git a/dev-lang/luajit/Manifest b/dev-lang/luajit/Manifest index aa8cbe1..b425ae6 100644 --- a/dev-lang/luajit/Manifest +++ b/dev-lang/luajit/Manifest @@ -1,2 +1 @@ -DIST LuaJIT-2.0.0-beta9.tar.gz 814960 SHA256 da3793b4364a17c3700d39d13eae799b82ff23da1f61631d735de05333f46240 SHA512 14f100ea0ff243b070abedc30f029afdba1792ef41b7add86623b6ba3a0e733949fc7450c531f54e2f908e32cc013106b16031bcd99754a0342636c5b41bfbb6 WHIRLPOOL 8f86e3f209d1832d02327148b7dbb248599756fa1929f03435d03db080f8659518d920ec17b5f32f55431a605e0a4615bd07bf80138fd26ed7de0f70b2a9b0db -DIST LuaJIT-2.0.1.tar.gz 841399 SHA256 2371cceb53453d8a7b36451e6a0ccdb66236924545d6042ddd4c34e9668990c0 SHA512 a5af5772d00dfedcf1c3449b1d74d45af25d111c91931735ad80f2c7a3b7837b51807eb3a0ce12688e38352ad32cdd70bea35b53906c945ddf86dfd706118518 WHIRLPOOL 42781f3d4efa9d515f7f1c879ffc45a13ab231c951a995eb0f1e89ff27c1dd6d0cee7795fd45dd169effc067c1bae5add36b290fd8f306f99a6ed0a99f4929ad +DIST LuaJIT-2.0.2.tar.gz 843031 SHA256 c05202974a5890e777b181908ac237625b499aece026654d7cc33607e3f46c38 SHA512 c1afea13ec61a59f37d1f61fc50bcac47208d9d4f0a80689b74e901ad2b34294b6c89a0b4eef54b43f3d2db411660da61b191b0bbfba4ba2f97743a9ee4484e3 WHIRLPOOL cb6e8ee6c5ac2293ca5d5452cda34769d3229e2d4681c0ce3c164659c2d2d781f8474e243747b197c10b3abc116e4145df6f5293317f1db871865f38ecd2b6cd diff --git a/dev-lang/luajit/files/v2.0.1_hotfix1.patch b/dev-lang/luajit/files/v2.0.1_hotfix1.patch deleted file mode 100644 index 0601cd9..0000000 --- a/dev-lang/luajit/files/v2.0.1_hotfix1.patch +++ /dev/null @@ -1,103 +0,0 @@ -Add missing GC steps for io.* functions. -MIPS: Fix cache flush/sync for JIT-compiled code jump area. -ARM: Fix cache flush/sync for exit stubs of JIT-compiled code. -Fix MSVC intrinsics for older versions. -Fix memory access check for fast string interning. - ---- a/src/lib_io.c -+++ b/src/lib_io.c -@@ -17,6 +17,7 @@ - #include "lualib.h" - - #include "lj_obj.h" -+#include "lj_gc.h" - #include "lj_err.h" - #include "lj_str.h" - #include "lj_state.h" -@@ -152,6 +153,7 @@ static int io_file_readline(lua_State *L, FILE *fp, MSize chop) - if (n >= m - 64) m += m; - } - setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); -+ lj_gc_check(L); - return (int)ok; - } - -@@ -163,6 +165,7 @@ static void io_file_readall(lua_State *L, FILE *fp) - n += (MSize)fread(buf+n, 1, m-n, fp); - if (n != m) { - setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); -+ lj_gc_check(L); - return; - } - } -@@ -174,6 +177,7 @@ static int io_file_readlen(lua_State *L, FILE *fp, MSize m) - char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m); - MSize n = (MSize)fread(buf, 1, m, fp); - setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); -+ lj_gc_check(L); - return (n > 0 || m == 0); - } else { - int c = getc(fp); ---- a/src/lj_asm_arm.h -+++ b/src/lj_asm_arm.h -@@ -91,6 +91,7 @@ static MCode *asm_exitstub_gen(ASMState *as, ExitNo group) - *mxp++ = group*EXITSTUBS_PER_GROUP; - for (i = 0; i < EXITSTUBS_PER_GROUP; i++) - *mxp++ = ARMI_B|((-6-i)&0x00ffffffu); -+ lj_mcode_sync(as->mcbot, mxp); - lj_mcode_commitbot(as->J, mxp); - as->mcbot = mxp; - as->mclim = as->mcbot + MCLIM_REDZONE; ---- a/src/lj_asm_mips.h -+++ b/src/lj_asm_mips.h -@@ -71,6 +71,7 @@ static void asm_sparejump_setup(ASMState *as) - memset(mxp+2, 0, MIPS_SPAREJUMP*8); - mxp += MIPS_SPAREJUMP*2; - lua_assert(mxp < as->mctop); -+ lj_mcode_sync(as->mcbot, mxp); - lj_mcode_commitbot(as->J, mxp); - as->mcbot = mxp; - as->mclim = as->mcbot + MCLIM_REDZONE; ---- a/src/lj_def.h -+++ b/src/lj_def.h -@@ -243,17 +243,17 @@ static LJ_AINLINE uint32_t lj_getu32(const void *p) - #endif - - #ifdef _M_PPC --#pragma intrinsic(_CountLeadingZeros) - unsigned int _CountLeadingZeros(long); -+#pragma intrinsic(_CountLeadingZeros) - static LJ_AINLINE uint32_t lj_fls(uint32_t x) - { - return _CountLeadingZeros(x) ^ 31; - } - #else --#pragma intrinsic(_BitScanForward) --#pragma intrinsic(_BitScanReverse) - unsigned char _BitScanForward(uint32_t *, unsigned long); - unsigned char _BitScanReverse(uint32_t *, unsigned long); -+#pragma intrinsic(_BitScanForward) -+#pragma intrinsic(_BitScanReverse) - - static LJ_AINLINE uint32_t lj_ffs(uint32_t x) - { ---- a/src/lj_str.c -+++ b/src/lj_str.c -@@ -48,7 +48,7 @@ static LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len) - { - MSize i = 0; - lua_assert(len > 0); -- lua_assert((((uintptr_t)a + len) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4); -+ lua_assert((((uintptr_t)a+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4); - do { /* Note: innocuous access up to end of string + 3. */ - uint32_t v = lj_getu32(a+i) ^ *(const uint32_t *)(b+i); - if (v) { -@@ -121,7 +121,7 @@ GCstr *lj_str_new(lua_State *L, const char *str, size_t lenx) - h ^= b; h -= lj_rol(b, 16); - /* Check if the string has already been interned. */ - o = gcref(g->strhash[h & g->strmask]); -- if (LJ_LIKELY((((uintptr_t)str + len) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) { -+ if (LJ_LIKELY((((uintptr_t)str+len-1) & (LJ_PAGESIZE-1)) <= LJ_PAGESIZE-4)) { - while (o != NULL) { - GCstr *sx = gco2str(o); - if (sx->len == len && str_fastcmp(str, strdata(sx), len) == 0) { diff --git a/dev-lang/luajit/luajit-2.0.1.ebuild b/dev-lang/luajit/luajit-2.0.2.ebuild index 0b14d62..01f4f12 100644 --- a/dev-lang/luajit/luajit-2.0.1.ebuild +++ b/dev-lang/luajit/luajit-2.0.2.ebuild @@ -4,17 +4,26 @@ EAPI="5" -inherit eutils multilib flag-o-matic check-reqs pax-utils +inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs + +MY_PV="$(get_version_component_range 1-3)" +MY_P="LuaJIT-${MY_PV}" +if [[ $(get_version_component_range 4) != "" ]]; then + HOTFIX="v${PV}" + HOTFIX="${HOTFIX/_p/_hotfix}.patch" +fi -MY_P="LuaJIT-${PV/_/-}" DESCRIPTION="Just-In-Time Compiler for the Lua programming language" HOMEPAGE="http://luajit.org/" -SRC_URI="http://luajit.org/download/${MY_P}.tar.gz" +SRC_URI=" + http://luajit.org/download/${MY_P}.tar.gz + ${HOTFIX:+http://luajit.org/download/${HOTFIX}} +" LICENSE="MIT" SLOT="2" -KEYWORDS="~amd64 ~x86" -IUSE="+optimization lua52compat" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="lua52compat +optimization" DEPEND="" PDEPEND=" @@ -23,12 +32,14 @@ PDEPEND=" S="${WORKDIR}/${MY_P}" +HTML_DOCS=( "doc/" ) + check_req() { if use optimization; then CHECKREQS_MEMORY="200M" ewarn "Optimized (amalgamated) build wants at least 200MB of RAM" ewarn "If you have no such RAM - try to disable 'optimization' flag" - check-reqs_pkg_${1} + check-reqs_pkg_${1} fi } @@ -40,34 +51,21 @@ pkg_setup() { check_req setup } -src_prepare(){ +src_prepare() { + if [[ -n ${HOTFIX} ]]; then + epatch "${DISTDIR}/${HOTFIX}" + fi + # fixing prefix and version - sed -e "s|/usr/local|/usr|" \ + sed \ + -e "s|/usr/local|/usr|" \ -e "s|/lib|/$(get_libdir)|" \ - -e "s|VERSION=.*|VERSION= ${PV}|" \ -i Makefile || die "failed to fix prefix in Makefile" - sed -e "s|\(share/luajit\)-[^\"]*|\1-${PV}/|g" \ + sed \ -e "s|/usr/local|/usr|" \ -e "s|lib/|$(get_libdir)/|" \ -i src/luaconf.h || die "failed to fix prefix in luaconf.h" - - if use lua52compat; then - sed \ - -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \ - -i src/Makefile || die "Lua-5.2 compat fix failed" - fi - - # removing strip - sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \ - || die "failed to remove forced strip" - - # fixing pkg-config file (Lua-replacing compatibility) - sed -r \ - -e 's#(INSTALL_CMOD=.*)#\1\nINSTALL_INC=${includedir}#' \ - -i etc/luajit.pc || die "failed to fix pkgconfig file" - - epatch "${FILESDIR}/v${PV}_hotfix1.patch" } src_compile() { @@ -88,9 +86,11 @@ src_compile() { # ebuild, I choose method "a" # (since it is more secure on hardened systems, imho) + # + ewarn user, that he really should disable ccache. + # append-ldflags -nopie -# append-ldflags -nopie +# append-ldflags -nopie append-cflags -fPIC + ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," ewarn "we need to either:" ewarn " a) add -fPIC to CFLAGS, or" @@ -108,23 +108,23 @@ src_compile() { ewarn "to disable ccache instead." fi - emake "${opt}" + emake \ + Q= \ + HOST_CC="$(tc-getBUILD_CC)" \ + STATIC_CC="$(tc-getCC)" \ + DYNAMIC_CC="$(tc-getCC) -fPIC" \ + TARGET_LD="$(tc-getCC)" \ + TARGET_AR="$(tc-getAR) rcus" \ + TARGET_STRIP="true" \ + XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ + "${opt}" } src_install() { default - host-is-pax && pax-mark m "${D}usr/bin/${P}" - dosym "luajit-${PV}" "/usr/bin/${PN}" - newbin "${FILESDIR}/luac.jit" "luac-${P}" -} + base_src_install_docs -pkg_postinst() { - if ! has_version dev-lua/iluajit; then - einfo "You'd probably want to install dev-lua/iluajit to"; - ewarn "get fully functional interactive shell for LuaJIT"; - fi - if has_version app-editors/emacs || has_version app-editors/xemacs; then - einfo "You'd probably want to install app-emacs/lua-mode to"; - ewarn "get Lua completion in emacs."; - fi -}
\ No newline at end of file + host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" + dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" + newbin "${FILESDIR}/luac.jit" "luac-${MY_PV}" +} diff --git a/dev-lang/luajit/luajit-9999.ebuild b/dev-lang/luajit/luajit-2.0.9999.ebuild index 08f52e0..5086ac9 100644 --- a/dev-lang/luajit/luajit-9999.ebuild +++ b/dev-lang/luajit/luajit-2.0.9999.ebuild @@ -4,7 +4,9 @@ EAPI="5" -inherit eutils multilib flag-o-matic check-reqs pax-utils git-2 +inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs git-2 + +MY_PV="2.0.1" DESCRIPTION="Just-In-Time Compiler for the Lua programming language" HOMEPAGE="http://luajit.org/" @@ -14,13 +16,15 @@ EGIT_REPO_URI="http://luajit.org/git/luajit-2.0.git" LICENSE="MIT" SLOT="2" KEYWORDS="" -IUSE="+optimization lua52compat" +IUSE="lua52compat +optimization" DEPEND="" PDEPEND=" virtual/lua[luajit] " +HTML_DOCS=( "doc/" ) + check_req() { if use optimization; then CHECKREQS_MEMORY="200M" @@ -40,30 +44,15 @@ pkg_setup() { src_prepare(){ # fixing prefix and version - sed -e "s|/usr/local|/usr|" \ + sed \ + -e "s|/usr/local|/usr|" \ -e "s|/lib|/$(get_libdir)|" \ - -e "s|VERSION=.*|VERSION= ${PV}|" \ -i Makefile || die "failed to fix prefix in Makefile" - sed -e "s|\(share/luajit\)-[^\"]*|\1-${PV}/|g" \ + sed \ -e "s|/usr/local|/usr|" \ -e "s|lib/|$(get_libdir)/|" \ -i src/luaconf.h || die "failed to fix prefix in luaconf.h" - - if use lua52compat; then - sed \ - -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \ - -i src/Makefile || die "Lua-5.2 compat fix failed" - fi - - # removing strip - sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \ - || die "failed to remove forced strip" - - # fixing pkg-config file (Lua-replacing compatibility) - sed -r \ - -e 's#(INSTALL_CMOD=.*)#\1\nINSTALL_INC=${includedir}#' \ - -i etc/luajit.pc || die "failed to fix pkgconfig file" } src_compile() { @@ -84,9 +73,11 @@ src_compile() { # ebuild, I choose method "a" # (since it is more secure on hardened systems, imho) + # + ewarn user, that he really should disable ccache. + # append-ldflags -nopie -# append-ldflags -nopie +# append-ldflags -nopie append-cflags -fPIC + ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," ewarn "we need to either:" ewarn " a) add -fPIC to CFLAGS, or" @@ -104,23 +95,23 @@ src_compile() { ewarn "to disable ccache instead." fi - emake "${opt}" + emake \ + Q= \ + HOST_CC="$(tc-getBUILD_CC)" \ + STATIC_CC="$(tc-getCC)" \ + DYNAMIC_CC="$(tc-getCC) -fPIC" \ + TARGET_LD="$(tc-getCC)" \ + TARGET_AR="$(tc-getAR) rcus" \ + TARGET_STRIP="true" \ + XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ + "${opt}" } src_install() { default - host-is-pax && pax-mark m "${D}usr/bin/${P}" - dosym "luajit-${PV}" "/usr/bin/${PN}" - newbin "${FILESDIR}/luac.jit" "luac-${P}" -} + base_src_install_docs -pkg_postinst() { - if ! has_version dev-lua/iluajit; then - einfo "You'd probably want to install dev-lua/iluajit to"; - ewarn "get fully functional interactive shell for LuaJIT"; - fi - if has_version app-editors/emacs || has_version app-editors/xemacs; then - einfo "You'd probably want to install app-emacs/lua-mode to"; - ewarn "get Lua completion in emacs."; - fi -} + host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" + dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" + newbin "${FILESDIR}/luac.jit" "luac-${MY_PV}" +}
\ No newline at end of file diff --git a/dev-lang/luajit/luajit-2.1.9999.ebuild b/dev-lang/luajit/luajit-2.1.9999.ebuild new file mode 100644 index 0000000..0b39743 --- /dev/null +++ b/dev-lang/luajit/luajit-2.1.9999.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: This ebuild is from Lua overlay; Bumped by mva; $ + +EAPI="5" + +inherit base multilib pax-utils versionator toolchain-funcs flag-o-matic check-reqs git-2 + +MY_PV="2.1.0-alpha" + +DESCRIPTION="Just-In-Time Compiler for the Lua programming language" +HOMEPAGE="http://luajit.org/" +SRC_URI="" +EGIT_REPO_URI="http://luajit.org/git/luajit-2.0.git" +EGIT_BRANCH="v2.1" + +LICENSE="MIT" +SLOT="2" +KEYWORDS="" +IUSE="lua52compat +optimization" + +PDEPEND=" + virtual/lua[luajit] +" + +HTML_DOCS=( "doc/" ) + +check_req() { + if use optimization; then + CHECKREQS_MEMORY="200M" + ewarn "Optimized (amalgamated) build wants at least 200MB of RAM" + ewarn "If you have no such RAM - try to disable 'optimization' flag" + check-reqs_pkg_${1} + fi +} + +pkg_pretend() { + check_req pretend +} + +pkg_setup() { + check_req setup +} + +src_prepare(){ + # fixing prefix and version + sed \ + -e "s|/usr/local|/usr|" \ + -e "s|/lib|/$(get_libdir)|" \ + -i Makefile || die "failed to fix prefix in Makefile" + + sed \ + -e "s|/usr/local|/usr|" \ + -e "s|lib/|$(get_libdir)/|" \ + -i src/luaconf.h || die "failed to fix prefix in luaconf.h" +} + +src_compile() { + local opt; + use optimization && opt="amalg"; + + if gcc-fullversion 4 7 3 && gcc-specs-pie && has ccache ${FEATURES}; then + # It is three ways to avoid compilation breaking + # in case, when user use gcc-4.7.3+pie+ccache: + # a) append -fPIC to CFLAGS, to use it even for temporary + # build-time only static host/* bins and luajit binary itself. + # b) append -nopie to LDFLAGS + # (for same binaries and same reason) + # c) disable ccache (even in per-package basis). + # This will slow down amalgamated build, but is prefered and + # recommended by upstream method. + # So, since it is impossible to use method "c" directly from + # ebuild, I choose method "a" + # (since it is more secure on hardened systems, imho) + + # + ewarn user, that he really should disable ccache. + # append-ldflags -nopie + +# append-ldflags -nopie + append-cflags -fPIC + + ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," + ewarn "we need to either:" + ewarn " a) add -fPIC to CFLAGS, or" + ewarn " b) add -nopie to LDFLAGS, or" + ewarn " c) disable ccache (even on per-package basis)." + ewarn "" + ewarn "We suggest you to use variant 'c' and disable it via" + ewarn "/etc/portage/{,package.}env (read portage manual)" + ewarn "" + ewarn "But, since we can't do that from ebuild, we'll continue" + ewarn "with -fPIC (variant 'a') for now, since it gives more security" + ewarn "on hardened systems (in our opinion)." + ewarn "" + ewarn "But, anyway, we still *HIGHLY* recommend you" + ewarn "to disable ccache instead." + fi + + emake \ + Q= \ + HOST_CC="$(tc-getBUILD_CC)" \ + STATIC_CC="$(tc-getCC)" \ + DYNAMIC_CC="$(tc-getCC) -fPIC" \ + TARGET_LD="$(tc-getCC)" \ + TARGET_AR="$(tc-getAR) rcus" \ + TARGET_STRIP="true" \ + XCFLAGS="$(usex lua52compat "-DLUAJIT_ENABLE_LUA52COMPAT" "")" \ + "${opt}" +} + +src_install() { + default + base_src_install_docs + + host-is-pax && pax-mark m "${ED}usr/bin/${PN}-${MY_PV}" + dosym "${PN}-${MY_PV}" "/usr/bin/${PN}" + newbin "${FILESDIR}/luac.jit" "luac-${MY_PV}" +}
\ No newline at end of file |