add upstream patches
authorMatti Bickel <mabi@gentoo.org>
Tue, 23 Feb 2010 12:19:36 +0000 (12:19 +0000)
committerMatti Bickel <mabi@gentoo.org>
Tue, 23 Feb 2010 12:19:36 +0000 (12:19 +0000)
Package-Manager: portage-2.1.7.16/cvs/Linux i686

dev-lang/lua/ChangeLog
dev-lang/lua/Manifest
dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch [new file with mode: 0644]
dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch [new file with mode: 0644]
dev-lang/lua/lua-5.1.4-r5.ebuild [new file with mode: 0644]

index a3f128452a25504d03e970c075e09b0208510a6c..74778f0a48e30e9e76664756529944618ef1f14f 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for dev-lang/lua
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.144 2010/01/10 18:27:53 nixnut Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.145 2010/02/23 12:19:34 mabi Exp $
+
+*lua-5.1.4-r5 (23 Feb 2010)
+
+  23 Feb 2010; <mabi@gentoo.org>
+  +files/5.1.4/03_all_debug_getfenv.upstream.patch, +lua-5.1.4-r5.ebuild,
+  +files/5.1.4/04_all_gc_performance.upstream.patch:
+  add upstream patches
 
   10 Jan 2010; nixnut <nixnut@gentoo.org> lua-5.1.4-r4.ebuild:
   ppc stable #295134
index 136627a60967bd1fd63ad43b9cece2b022b37f19..66b9dfd247c7cca80d3d144e0eedbffce688c82c 100644 (file)
@@ -12,6 +12,8 @@ AUX 5.1.3/11_all_module.upstream.patch 575 RMD160 cff7cdb7790fc9c78221181564b509
 AUX 5.1.3/12_all_svalue.upstream.patch 303 RMD160 383d68a00fc2d3f451def70f4629dfed5d691014 SHA1 e09c0442eba74c7acd8e08167bcc8b91c248f5eb SHA256 d5fabc1c89ef473d141a6663f6adeb25579102a975dbbd5ce57a8ac883cc48ec
 AUX 5.1.4/01_all_boolean_expression.upstream.patch 1064 RMD160 7c10f8cf7aa842cdfd43fd8f8db5d6fbdf76459b SHA1 4cc7050fe4d5f16b4103b7b83ecd54c087f46396 SHA256 9506fa6932454abe735b9d620ca0b322b4e2eb03b38a5d3d717823508110620e
 AUX 5.1.4/02_all_table.upstream.patch 643 RMD160 340ccc72f65cf6a82e76b3f641e0dcf5d97d3db0 SHA1 7a91ffb6258e59c1e2a1f150e73a639bc46e3d59 SHA256 e55930ccbfadf384b2b981da3454b0dfd8544ffcb29e10ad07c7404142447b09
+AUX 5.1.4/03_all_debug_getfenv.upstream.patch 232 RMD160 1c3a0bdeff3ab07bcaa185079d19bf90e83de0c5 SHA1 c9d685ab40f5964082927cb245373ca717b2823f SHA256 a6aa45a96ba44f04fd516851fc4188d89ad0c6d2b927d3be9faf84808c4a138d
+AUX 5.1.4/04_all_gc_performance.upstream.patch 414 RMD160 1dacd5f58d96a053cbea3041d1f2f87b134a2232 SHA1 8e735c8a03ad630ea1bde735f6cab2821b0ef690 SHA256 cba9899e1f940b21c1a25f65279004ee64d78a4c48db3501677c106266bc23dd
 AUX lua-5.1-make-r1.patch 2229 RMD160 9dfd3494f93a673e724e642f10543b80466dd547 SHA1 0896a440ad823c55f0a7a3354a09f4e29bceccf7 SHA256 bf691afd2480a496bfa9b2c46fcbb396e7034ea58e94399788e05ab7872ae46f
 AUX lua-5.1-make.patch 2209 RMD160 03d6ff5c31aa2ea8cb4dec871ae4ba4d711d2240 SHA1 103efb333cef67ab3f521e49bda56f647c633f7a SHA256 3ffa297c79ad7ba378eba3de2b730670e60c7ea28181fcca4e0d0e25612997c4
 AUX lua-5.1-make_static-r1.patch 644 RMD160 fc1d837228066f987c09a7bf7c536de31f25685a SHA1 814a3429fabc12836b4520918df6b04bb68cfcf8 SHA256 077f5da55b9b354b8b901d8a769c92aad104d79ba0a6acee0096c9a5d94b259a
@@ -25,6 +27,7 @@ EBUILD lua-5.1.4-r1.ebuild 3012 RMD160 e1c82ed3d00d328d252d69e3f8cd2cf87be4deba
 EBUILD lua-5.1.4-r2.ebuild 3075 RMD160 189a712c32fd3b0f69317dc0228ceaa570f48282 SHA1 a2627e7ae9e801940180d462afd4692ae7740c89 SHA256 df3b33b7b787399fcc038e07d5c007720e1c66744f97c3b7a45eec164575f89c
 EBUILD lua-5.1.4-r3.ebuild 3130 RMD160 c666caa144581f6998eb1db440352c655617635a SHA1 8213f0675c61a2feb84e5d27f372cd490c7f945f SHA256 5bc42367d96709851459856f34a4498110bae768ee7572104f98b07f43254152
 EBUILD lua-5.1.4-r4.ebuild 3124 RMD160 2bf649bc136ca38e6850077d0828dd0f9d7fd714 SHA1 44294f794799fc5796f86a0c90b68072f4492427 SHA256 5b829f15b27aba6d8d92eda2ab242bc77b8b57fa78cfb987789f2797cfd8b5c8
+EBUILD lua-5.1.4-r5.ebuild 3130 RMD160 fb0ae91b8e3252cc4be075f11ca092a9cf4a087d SHA1 9b10df7b0959249f6ea22b6896745fdfb87d28f5 SHA256 1f23b893cf8406bd2daf6cbaa4654c0788a4d167a612db5cb7425f7c6c961330
 EBUILD lua-5.1.4.ebuild 2994 RMD160 637f425e9ec4034ede44dee36061693f006bee48 SHA1 f1406a740a642647a106f77f22ffa5a4aec45b93 SHA256 d44847b8f322ef735ce8786cba2af466110e30154583a5479bd6029cc9b119bd
-MISC ChangeLog 21281 RMD160 27ef602fa11bb7a72bc61363bbcbdf47a3a13fad SHA1 23ed7773415e4e75965d5ffd92c9be6ac6e2f4ec SHA256 05574599cf63ed0c13d4f75b9002dd533663debcec28664a36051c262f806073
+MISC ChangeLog 21492 RMD160 bb71519e19767e7171ae562bab20b990e19776e2 SHA1 8a7a4941d33d6ef8ee713a6939fef7d53aac90f3 SHA256 684410d6ee7b158c32db040a4ae5774749810174df3bb83a09ed6b4d785d80ec
 MISC metadata.xml 339 RMD160 0d536a77658ffb6d8bccff7183a5bf4722d0a82d SHA1 f5bd1085f69b6e9d81e42cd711a7846ccb267e31 SHA256 6b3bedf093395def984b71f7c74ce59742c5df6592ad50f1b96c8a2499f27c8b
diff --git a/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch b/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch
new file mode 100644 (file)
index 0000000..fce4d47
--- /dev/null
@@ -0,0 +1,10 @@
+--- lua-5.1.4.orig/src/ldblib.c        2007/12/28 15:32:23     2.63.1.3
++++ lua-5.1.4/src/ldblib.c     2010/02/23 12:36:59
+@@ -45,6 +45,7 @@
+ 
+ 
+ static int db_getfenv (lua_State *L) {
++  luaL_checkany(L, 1);
+   lua_getfenv(L, 1);
+   return 1;
+ }
diff --git a/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch b/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch
new file mode 100644 (file)
index 0000000..3c78525
--- /dev/null
@@ -0,0 +1,14 @@
+--- lua-5.1.4.orig/src/llex.c  2007/12/28 15:32:23     2.63.1.3
++++ lua-5.1.4/src/llex.c       2010/02/23 12:36:59
+@@ -118,8 +118,10 @@
+   lua_State *L = ls->L;
+   TString *ts = luaS_newlstr(L, str, l);
+   TValue *o = luaH_setstr(L, ls->fs->h, ts);  /* entry for `str' */
+-  if (ttisnil(o))
++  if (ttisnil(o)) {
+     setbvalue(o, 1);  /* make sure `str' will not be collected */
++    luaC_checkGC(L);
++  }
+   return ts;
+ }
+ 
diff --git a/dev-lang/lua/lua-5.1.4-r5.ebuild b/dev-lang/lua/lua-5.1.4-r5.ebuild
new file mode 100644 (file)
index 0000000..0fda650
--- /dev/null
@@ -0,0 +1,117 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/lua-5.1.4-r5.ebuild,v 1.1 2010/02/23 12:19:34 mabi Exp $
+
+EAPI="1"
+
+inherit eutils multilib portability toolchain-funcs versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="+deprecated emacs readline static"
+
+DEPEND="readline? ( sys-libs/readline )"
+RDEPEND="${DEPEND}"
+PDEPEND="emacs? ( app-emacs/lua-mode )"
+
+src_unpack() {
+       local PATCH_PV=$(get_version_component_range 1-2)
+       unpack ${A}
+       cd "${S}"
+
+       epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+       epatch "${FILESDIR}"/${PN}-${PATCH_PV}-module_paths.patch
+
+       EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+       # correct lua versioning
+       sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:4:1/' src/Makefile
+
+       sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
+
+       if ! use deprecated ; then
+               epatch "${FILESDIR}"/${P}-deprecated.patch
+               epatch "${FILESDIR}"/${P}-test.patch
+       fi
+
+       if ! use readline ; then
+               epatch "${FILESDIR}"/${PN}-${PATCH_PV}-readline.patch
+       fi
+
+       # Using dynamic linked lua is not recommended upstream for performance
+       # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+       # Mainly, this is of concern if your arch is poor with GPRs, like x86
+       # Not that this only affects the interpreter binary (named lua), not the lua
+       # compiler (built statically) nor the lua libraries (both shared and static
+       # are installed)
+       if use static ; then
+               epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make_static-r1.patch
+       fi
+
+       # We want packages to find our things...
+       sed -i \
+               -e 's:/usr/local:/usr:' \
+               -e "s:/\<lib\>:/$(get_libdir):g" \
+               etc/lua.pc
+}
+
+src_compile() {
+       tc-export CC
+       myflags=
+       # what to link to liblua
+       liblibs="-lm"
+       liblibs="${liblibs} $(dlopen_lib)"
+
+       # what to link to the executables
+       mylibs=
+       if use readline; then
+               mylibs="-lreadline"
+       fi
+
+       cd src
+       emake CC="${CC}" CFLAGS="-DLUA_USE_LINUX ${CFLAGS}" \
+                       RPATH="${ROOT}/usr/$(get_libdir)/" \
+                       LUA_LIBS="${mylibs}" \
+                       LIB_LIBS="${liblibs}" \
+                       V=${PV} \
+                       gentoo_all || die "emake failed"
+
+       mv lua_test ../test/lua.static
+}
+
+src_install() {
+       emake INSTALL_TOP="${D}/usr/" INSTALL_LIB="${D}/usr/$(get_libdir)/" \
+                       V=${PV} gentoo_install \
+       || die "emake install gentoo_install failed"
+
+       dodoc HISTORY README
+       dohtml doc/*.html doc/*.gif
+
+       insinto /usr/share/pixmaps
+       doins etc/lua.ico
+       insinto /usr/$(get_libdir)/pkgconfig
+       doins etc/lua.pc
+
+       doman doc/lua.1 doc/luac.1
+}
+
+src_test() {
+       local positive="bisect cf echo env factorial fib fibfor hello printf sieve
+       sort trace-calls trace-globals"
+       local negative="readonly"
+       local test
+
+       cd "${S}"
+       for test in ${positive}; do
+               test/lua.static test/${test}.lua || die "test $test failed"
+       done
+
+       for test in ${negative}; do
+               test/lua.static test/${test}.lua && die "test $test failed"
+       done
+}