Patchwork [meta-oe] lua5.1: apply lua.org patches for lua-5.1.5

login
register
mail settings
Submitter Marko Lindqvist
Date Oct. 25, 2013, 8:56 a.m.
Message ID <1382691396-3929-1-git-send-email-cazfi74@gmail.com>
Download mbox | patch
Permalink /patch/60513/
State Accepted, archived
Commit e9759bfafb9f19b4dafb8c4888097690030ea616
Headers show

Comments

Marko Lindqvist - Oct. 25, 2013, 8:56 a.m.
Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch | 18 +++++++++
 meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch | 44 ++++++++++++++++++++++
 meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb       |  4 +-
 3 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
 create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
Martin Jansa - Oct. 25, 2013, 9:52 a.m.
There is also alternative patch for 5.2.2 proposed to be merged in oe-core



On Fri, Oct 25, 2013 at 10:56 AM, Marko Lindqvist <cazfi74@gmail.com> wrote:

> Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
> ---
>  meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch | 18 +++++++++
>  meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch | 44
> ++++++++++++++++++++++
>  meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb       |  4 +-
>  3 files changed, 65 insertions(+), 1 deletion(-)
>  create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>  create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>
> diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
> b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
> new file mode 100644
> index 0000000..b64a6a2
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
> @@ -0,0 +1,18 @@
> +lua.org patch 1 for lua-5.1.5.
> +from http://www.lua.org/bugs.html
> +
> +Upstream-Status: Backport
> +
> +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
> +diff -Nurd lua-5.1.5/src/Makefile lua-5.1.5/src/Makefile
> +--- lua-5.1.5/src/Makefile     2012-02-13 22:41:22.000000000 +0200
> ++++ lua-5.1.5/src/Makefile     2013-10-25 11:29:49.769540434 +0300
> +@@ -48,7 +48,7 @@
> + a:    $(ALL_A)
> +
> + $(LUA_A): $(CORE_O) $(LIB_O)
> +-      $(AR) $@ $(CORE_O) $(LIB_O)     # DLL needs all object files
> ++      $(AR) $@ $(CORE_O) $(LIB_O)
> +       $(RANLIB) $@
> +
> + $(LUA_T): $(LUA_O) $(LUA_A)
> diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
> b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
> new file mode 100644
> index 0000000..0c48ea2
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
> @@ -0,0 +1,44 @@
> +lua.org patch 2 for lua-5.1.5.
> +from http://www.lua.org/bugs.html
> +
> +Upstream-Status: Backport
> +
> +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
> +diff -Nurd lua-5.1.5/src/lzio.c lua-5.1.5/src/lzio.c
> +--- lua-5.1.5/src/lzio.c       2007-12-27 15:02:25.000000000 +0200
> ++++ lua-5.1.5/src/lzio.c       2013-10-25 11:32:45.773536572 +0300
> +@@ -22,10 +22,14 @@
> +   size_t size;
> +   lua_State *L = z->L;
> +   const char *buff;
> ++  if (z->eoz) return EOZ;
> +   lua_unlock(L);
> +   buff = z->reader(L, z->data, &size);
> +   lua_lock(L);
> +-  if (buff == NULL || size == 0) return EOZ;
> ++  if (buff == NULL || size == 0) {
> ++    z->eoz = 1;  /* avoid calling reader function next time */
> ++    return EOZ;
> ++  }
> +   z->n = size - 1;
> +   z->p = buff;
> +   return char2int(*(z->p++));
> +@@ -51,6 +55,7 @@
> +   z->data = data;
> +   z->n = 0;
> +   z->p = NULL;
> ++  z->eoz = 0;
> + }
> +
> +
> +diff -Nurd lua-5.1.5/src/lzio.h lua-5.1.5/src/lzio.h
> +--- lua-5.1.5/src/lzio.h       2007-12-27 15:02:25.000000000 +0200
> ++++ lua-5.1.5/src/lzio.h       2013-10-25 11:31:50.301537789 +0300
> +@@ -59,6 +59,7 @@
> +   lua_Reader reader;
> +   void* data;                 /* additional data */
> +   lua_State *L;                       /* Lua state (for reader) */
> ++  int eoz;                    /* true if reader has no more data */
> + };
> +
> +
> diff --git a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bbb/meta-oe/recipes-devtools/lua/
> lua5.1_5.1.5.bb
> index 19fee01..f946994 100644
> --- a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
> +++ b/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
> @@ -4,12 +4,14 @@ LICENSE = "MIT"
>  LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=59bdd99bb82238f238cf5c65c21604fd"
>  HOMEPAGE = "http://www.lua.org/"
>
> -PR = "r1"
> +PR = "r2"
>
>  DEPENDS += "readline"
>  SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz \
>             file://bitwise_operators.patch \
>             file://lua5.1.pc \
> +           file://luaorg_1.patch \
> +           file://luaorg_2.patch \
>  "
>  S = "${WORKDIR}/lua-${PV}"
>
> --
> 1.8.4.rc3
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
Martin Jansa - Oct. 25, 2013, 9:53 a.m.
Sorry sent before finish

http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085502.html

can we just upgrade to 5.2.2 in meta-oe instead of patching 5.1.5? Does it
work for your use-case?


On Fri, Oct 25, 2013 at 11:52 AM, Martin Jansa <martin.jansa@gmail.com>wrote:

> There is also alternative patch for 5.2.2 proposed to be merged in oe-core
>
>
>
>
> On Fri, Oct 25, 2013 at 10:56 AM, Marko Lindqvist <cazfi74@gmail.com>wrote:
>
>> Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
>> ---
>>  meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch | 18 +++++++++
>>  meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch | 44
>> ++++++++++++++++++++++
>>  meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb       |  4 +-
>>  3 files changed, 65 insertions(+), 1 deletion(-)
>>  create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>>  create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>>
>> diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>> b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>> new file mode 100644
>> index 0000000..b64a6a2
>> --- /dev/null
>> +++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>> @@ -0,0 +1,18 @@
>> +lua.org patch 1 for lua-5.1.5.
>> +from http://www.lua.org/bugs.html
>> +
>> +Upstream-Status: Backport
>> +
>> +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
>> +diff -Nurd lua-5.1.5/src/Makefile lua-5.1.5/src/Makefile
>> +--- lua-5.1.5/src/Makefile     2012-02-13 22:41:22.000000000 +0200
>> ++++ lua-5.1.5/src/Makefile     2013-10-25 11:29:49.769540434 +0300
>> +@@ -48,7 +48,7 @@
>> + a:    $(ALL_A)
>> +
>> + $(LUA_A): $(CORE_O) $(LIB_O)
>> +-      $(AR) $@ $(CORE_O) $(LIB_O)     # DLL needs all object files
>> ++      $(AR) $@ $(CORE_O) $(LIB_O)
>> +       $(RANLIB) $@
>> +
>> + $(LUA_T): $(LUA_O) $(LUA_A)
>> diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>> b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>> new file mode 100644
>> index 0000000..0c48ea2
>> --- /dev/null
>> +++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>> @@ -0,0 +1,44 @@
>> +lua.org patch 2 for lua-5.1.5.
>> +from http://www.lua.org/bugs.html
>> +
>> +Upstream-Status: Backport
>> +
>> +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
>> +diff -Nurd lua-5.1.5/src/lzio.c lua-5.1.5/src/lzio.c
>> +--- lua-5.1.5/src/lzio.c       2007-12-27 15:02:25.000000000 +0200
>> ++++ lua-5.1.5/src/lzio.c       2013-10-25 11:32:45.773536572 +0300
>> +@@ -22,10 +22,14 @@
>> +   size_t size;
>> +   lua_State *L = z->L;
>> +   const char *buff;
>> ++  if (z->eoz) return EOZ;
>> +   lua_unlock(L);
>> +   buff = z->reader(L, z->data, &size);
>> +   lua_lock(L);
>> +-  if (buff == NULL || size == 0) return EOZ;
>> ++  if (buff == NULL || size == 0) {
>> ++    z->eoz = 1;  /* avoid calling reader function next time */
>> ++    return EOZ;
>> ++  }
>> +   z->n = size - 1;
>> +   z->p = buff;
>> +   return char2int(*(z->p++));
>> +@@ -51,6 +55,7 @@
>> +   z->data = data;
>> +   z->n = 0;
>> +   z->p = NULL;
>> ++  z->eoz = 0;
>> + }
>> +
>> +
>> +diff -Nurd lua-5.1.5/src/lzio.h lua-5.1.5/src/lzio.h
>> +--- lua-5.1.5/src/lzio.h       2007-12-27 15:02:25.000000000 +0200
>> ++++ lua-5.1.5/src/lzio.h       2013-10-25 11:31:50.301537789 +0300
>> +@@ -59,6 +59,7 @@
>> +   lua_Reader reader;
>> +   void* data;                 /* additional data */
>> +   lua_State *L;                       /* Lua state (for reader) */
>> ++  int eoz;                    /* true if reader has no more data */
>> + };
>> +
>> +
>> diff --git a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bbb/meta-oe/recipes-devtools/lua/
>> lua5.1_5.1.5.bb
>> index 19fee01..f946994 100644
>> --- a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
>> +++ b/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
>> @@ -4,12 +4,14 @@ LICENSE = "MIT"
>>  LIC_FILES_CHKSUM =
>> "file://COPYRIGHT;md5=59bdd99bb82238f238cf5c65c21604fd"
>>  HOMEPAGE = "http://www.lua.org/"
>>
>> -PR = "r1"
>> +PR = "r2"
>>
>>  DEPENDS += "readline"
>>  SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz \
>>             file://bitwise_operators.patch \
>>             file://lua5.1.pc \
>> +           file://luaorg_1.patch \
>> +           file://luaorg_2.patch \
>>  "
>>  S = "${WORKDIR}/lua-${PV}"
>>
>> --
>> 1.8.4.rc3
>>
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>>
>
>
Marko Lindqvist - Oct. 25, 2013, 10:06 a.m.
On 25 October 2013 12:53, Martin Jansa <martin.jansa@gmail.com> wrote:
> Sorry sent before finish
>
> http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085502.html
>
> can we just upgrade to 5.2.2 in meta-oe instead of patching 5.1.5? Does it
> work for your use-case?

 lua-5.1 and lua-5.2 are somewhat incompatible. For example freeciv <=
2.4 use lua-5.1 and cannot work with lua-5.2, freeciv >= 2.5
(development version) use lua-5.2 and cannot work with lua-5.1. For
some things there simply is no implementation that would work with
both 5.1 and 5.2.
 So I need we need to add lua5.2 at some point, but it cannot replace lua5.1.


 - ML
Khem Raj - Oct. 25, 2013, 12:29 p.m.
Martin

On Fri, Oct 25, 2013 at 2:53 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> Sorry sent before finish
>
> http://lists.openembedded.org/pipermail/openembedded-core/2013-October/085502.html
>
> can we just upgrade to 5.2.2 in meta-oe instead of patching 5.1.5? Does it
> work for your use-case?

5.1 and 5.2 are ABI incompatible. We need to keep both recipes since
not all apps have yet migrated to 5.2 APIs, so the OE-Core patch
proposal should be instead directed to meta-oe
and be applied as an addition to existing recipes.

and this patch is good as it is.

>
>
> On Fri, Oct 25, 2013 at 11:52 AM, Martin Jansa <martin.jansa@gmail.com>wrote:
>
>> There is also alternative patch for 5.2.2 proposed to be merged in oe-core
>>
>>
>>
>>
>> On Fri, Oct 25, 2013 at 10:56 AM, Marko Lindqvist <cazfi74@gmail.com>wrote:
>>
>>> Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
>>> ---
>>>  meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch | 18 +++++++++
>>>  meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch | 44
>>> ++++++++++++++++++++++
>>>  meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb       |  4 +-
>>>  3 files changed, 65 insertions(+), 1 deletion(-)
>>>  create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>>>  create mode 100644 meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>>>
>>> diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>>> b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>>> new file mode 100644
>>> index 0000000..b64a6a2
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
>>> @@ -0,0 +1,18 @@
>>> +lua.org patch 1 for lua-5.1.5.
>>> +from http://www.lua.org/bugs.html
>>> +
>>> +Upstream-Status: Backport
>>> +
>>> +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
>>> +diff -Nurd lua-5.1.5/src/Makefile lua-5.1.5/src/Makefile
>>> +--- lua-5.1.5/src/Makefile     2012-02-13 22:41:22.000000000 +0200
>>> ++++ lua-5.1.5/src/Makefile     2013-10-25 11:29:49.769540434 +0300
>>> +@@ -48,7 +48,7 @@
>>> + a:    $(ALL_A)
>>> +
>>> + $(LUA_A): $(CORE_O) $(LIB_O)
>>> +-      $(AR) $@ $(CORE_O) $(LIB_O)     # DLL needs all object files
>>> ++      $(AR) $@ $(CORE_O) $(LIB_O)
>>> +       $(RANLIB) $@
>>> +
>>> + $(LUA_T): $(LUA_O) $(LUA_A)
>>> diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>>> b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>>> new file mode 100644
>>> index 0000000..0c48ea2
>>> --- /dev/null
>>> +++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
>>> @@ -0,0 +1,44 @@
>>> +lua.org patch 2 for lua-5.1.5.
>>> +from http://www.lua.org/bugs.html
>>> +
>>> +Upstream-Status: Backport
>>> +
>>> +Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
>>> +diff -Nurd lua-5.1.5/src/lzio.c lua-5.1.5/src/lzio.c
>>> +--- lua-5.1.5/src/lzio.c       2007-12-27 15:02:25.000000000 +0200
>>> ++++ lua-5.1.5/src/lzio.c       2013-10-25 11:32:45.773536572 +0300
>>> +@@ -22,10 +22,14 @@
>>> +   size_t size;
>>> +   lua_State *L = z->L;
>>> +   const char *buff;
>>> ++  if (z->eoz) return EOZ;
>>> +   lua_unlock(L);
>>> +   buff = z->reader(L, z->data, &size);
>>> +   lua_lock(L);
>>> +-  if (buff == NULL || size == 0) return EOZ;
>>> ++  if (buff == NULL || size == 0) {
>>> ++    z->eoz = 1;  /* avoid calling reader function next time */
>>> ++    return EOZ;
>>> ++  }
>>> +   z->n = size - 1;
>>> +   z->p = buff;
>>> +   return char2int(*(z->p++));
>>> +@@ -51,6 +55,7 @@
>>> +   z->data = data;
>>> +   z->n = 0;
>>> +   z->p = NULL;
>>> ++  z->eoz = 0;
>>> + }
>>> +
>>> +
>>> +diff -Nurd lua-5.1.5/src/lzio.h lua-5.1.5/src/lzio.h
>>> +--- lua-5.1.5/src/lzio.h       2007-12-27 15:02:25.000000000 +0200
>>> ++++ lua-5.1.5/src/lzio.h       2013-10-25 11:31:50.301537789 +0300
>>> +@@ -59,6 +59,7 @@
>>> +   lua_Reader reader;
>>> +   void* data;                 /* additional data */
>>> +   lua_State *L;                       /* Lua state (for reader) */
>>> ++  int eoz;                    /* true if reader has no more data */
>>> + };
>>> +
>>> +
>>> diff --git a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bbb/meta-oe/recipes-devtools/lua/
>>> lua5.1_5.1.5.bb
>>> index 19fee01..f946994 100644
>>> --- a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
>>> +++ b/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
>>> @@ -4,12 +4,14 @@ LICENSE = "MIT"
>>>  LIC_FILES_CHKSUM =
>>> "file://COPYRIGHT;md5=59bdd99bb82238f238cf5c65c21604fd"
>>>  HOMEPAGE = "http://www.lua.org/"
>>>
>>> -PR = "r1"
>>> +PR = "r2"
>>>
>>>  DEPENDS += "readline"
>>>  SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz \
>>>             file://bitwise_operators.patch \
>>>             file://lua5.1.pc \
>>> +           file://luaorg_1.patch \
>>> +           file://luaorg_2.patch \
>>>  "
>>>  S = "${WORKDIR}/lua-${PV}"
>>>
>>> --
>>> 1.8.4.rc3
>>>
>>> _______________________________________________
>>> Openembedded-devel mailing list
>>> Openembedded-devel@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>>>
>>
>>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Patch

diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
new file mode 100644
index 0000000..b64a6a2
--- /dev/null
+++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_1.patch
@@ -0,0 +1,18 @@ 
+lua.org patch 1 for lua-5.1.5.
+from http://www.lua.org/bugs.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd lua-5.1.5/src/Makefile lua-5.1.5/src/Makefile
+--- lua-5.1.5/src/Makefile	2012-02-13 22:41:22.000000000 +0200
++++ lua-5.1.5/src/Makefile	2013-10-25 11:29:49.769540434 +0300
+@@ -48,7 +48,7 @@
+ a:	$(ALL_A)
+ 
+ $(LUA_A): $(CORE_O) $(LIB_O)
+-	$(AR) $@ $(CORE_O) $(LIB_O)	# DLL needs all object files
++	$(AR) $@ $(CORE_O) $(LIB_O)
+ 	$(RANLIB) $@
+ 
+ $(LUA_T): $(LUA_O) $(LUA_A)
diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
new file mode 100644
index 0000000..0c48ea2
--- /dev/null
+++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch
@@ -0,0 +1,44 @@ 
+lua.org patch 2 for lua-5.1.5.
+from http://www.lua.org/bugs.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd lua-5.1.5/src/lzio.c lua-5.1.5/src/lzio.c
+--- lua-5.1.5/src/lzio.c	2007-12-27 15:02:25.000000000 +0200
++++ lua-5.1.5/src/lzio.c	2013-10-25 11:32:45.773536572 +0300
+@@ -22,10 +22,14 @@
+   size_t size;
+   lua_State *L = z->L;
+   const char *buff;
++  if (z->eoz) return EOZ;
+   lua_unlock(L);
+   buff = z->reader(L, z->data, &size);
+   lua_lock(L);
+-  if (buff == NULL || size == 0) return EOZ;
++  if (buff == NULL || size == 0) {
++    z->eoz = 1;  /* avoid calling reader function next time */
++    return EOZ;
++  }
+   z->n = size - 1;
+   z->p = buff;
+   return char2int(*(z->p++));
+@@ -51,6 +55,7 @@
+   z->data = data;
+   z->n = 0;
+   z->p = NULL;
++  z->eoz = 0;
+ }
+ 
+ 
+diff -Nurd lua-5.1.5/src/lzio.h lua-5.1.5/src/lzio.h
+--- lua-5.1.5/src/lzio.h	2007-12-27 15:02:25.000000000 +0200
++++ lua-5.1.5/src/lzio.h	2013-10-25 11:31:50.301537789 +0300
+@@ -59,6 +59,7 @@
+   lua_Reader reader;
+   void* data;			/* additional data */
+   lua_State *L;			/* Lua state (for reader) */
++  int eoz;			/* true if reader has no more data */
+ };
+ 
+ 
diff --git a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb b/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
index 19fee01..f946994 100644
--- a/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
+++ b/meta-oe/recipes-devtools/lua/lua5.1_5.1.5.bb
@@ -4,12 +4,14 @@  LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=59bdd99bb82238f238cf5c65c21604fd"
 HOMEPAGE = "http://www.lua.org/"
 
-PR = "r1"
+PR = "r2"
 
 DEPENDS += "readline"
 SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz \
            file://bitwise_operators.patch \
            file://lua5.1.pc \
+           file://luaorg_1.patch \
+           file://luaorg_2.patch \
 "
 S = "${WORKDIR}/lua-${PV}"