[OpenWrt-Devel] [PATCH V2 1/2] lua: include version number in installed files
Rafał Miłecki
zajec5 at gmail.com
Sat Jun 22 08:11:34 EDT 2019
From: Rafał Miłecki <rafal at milecki.pl>
This will allow installing Lua 5.1 and newer versions at the same time.
Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
V2: Bump PKG_RELEASE
---
package/utils/lua/Makefile | 8 ++--
.../001-include-version-number.patch | 48 +++++++++++++++++++
.../patches/001-include-version-number.patch | 48 +++++++++++++++++++
.../013-lnum-strtoul-parsing-fixes.patch | 11 +----
.../utils/lua/patches/020-shared_liblua.patch | 8 ++--
5 files changed, 107 insertions(+), 16 deletions(-)
create mode 100644 package/utils/lua/patches-host/001-include-version-number.patch
create mode 100644 package/utils/lua/patches/001-include-version-number.patch
diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
index 077a60fbf3..c911c6a913 100644
--- a/package/utils/lua/Makefile
+++ b/package/utils/lua/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=lua
PKG_VERSION:=5.1.5
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
@@ -154,12 +154,14 @@ endef
define Package/lua/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua5.1 $(1)/usr/bin/
+ $(LN) lua5.1 $(1)/usr/bin/lua
endef
define Package/luac/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac5.1 $(1)/usr/bin/
+ $(LN) luac5.1 $(1)/usr/bin/luac
endef
define Package/lua-examples/install
diff --git a/package/utils/lua/patches-host/001-include-version-number.patch b/package/utils/lua/patches-host/001-include-version-number.patch
new file mode 100644
index 0000000000..b7056fd47c
--- /dev/null
+++ b/package/utils/lua/patches-host/001-include-version-number.patch
@@ -0,0 +1,48 @@
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 21 Jun 2019 14:08:38 +0200
+Subject: [PATCH] include version number
+
+Including it allows multiple lua versions to coexist.
+
+Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
+---
+
+diff --git a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -41,10 +41,10 @@ RANLIB= ranlib
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+
+ # What to install.
+-TO_BIN= lua luac
++TO_BIN= lua$V luac$V
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+ TO_LIB= liblua.a
+-TO_MAN= lua.1 luac.1
++TO_MAN= lua$V.1 luac$V.1
+
+ # Lua version and release.
+ V= 5.1
+diff --git a/doc/lua.1 b/doc/lua5.1.1
+rename from doc/lua.1
+rename to doc/lua5.1.1
+diff --git a/doc/luac.1 b/doc/luac5.1.1
+rename from doc/luac.1
+rename to doc/luac5.1.1
+diff --git a/src/Makefile b/src/Makefile
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -29,10 +29,10 @@ CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
+ LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
+ lstrlib.o loadlib.o linit.o
+
+-LUA_T= lua
++LUA_T= lua$V
+ LUA_O= lua.o
+
+-LUAC_T= luac
++LUAC_T= luac$V
+ LUAC_O= luac.o print.o
+
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
diff --git a/package/utils/lua/patches/001-include-version-number.patch b/package/utils/lua/patches/001-include-version-number.patch
new file mode 100644
index 0000000000..b7056fd47c
--- /dev/null
+++ b/package/utils/lua/patches/001-include-version-number.patch
@@ -0,0 +1,48 @@
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 21 Jun 2019 14:08:38 +0200
+Subject: [PATCH] include version number
+
+Including it allows multiple lua versions to coexist.
+
+Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
+---
+
+diff --git a/Makefile b/Makefile
+--- a/Makefile
++++ b/Makefile
+@@ -41,10 +41,10 @@ RANLIB= ranlib
+ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+
+ # What to install.
+-TO_BIN= lua luac
++TO_BIN= lua$V luac$V
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+ TO_LIB= liblua.a
+-TO_MAN= lua.1 luac.1
++TO_MAN= lua$V.1 luac$V.1
+
+ # Lua version and release.
+ V= 5.1
+diff --git a/doc/lua.1 b/doc/lua5.1.1
+rename from doc/lua.1
+rename to doc/lua5.1.1
+diff --git a/doc/luac.1 b/doc/luac5.1.1
+rename from doc/luac.1
+rename to doc/luac5.1.1
+diff --git a/src/Makefile b/src/Makefile
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -29,10 +29,10 @@ CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
+ LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
+ lstrlib.o loadlib.o linit.o
+
+-LUA_T= lua
++LUA_T= lua$V
+ LUA_O= lua.o
+
+-LUAC_T= luac
++LUAC_T= luac$V
+ LUAC_O= luac.o print.o
+
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
diff --git a/package/utils/lua/patches/013-lnum-strtoul-parsing-fixes.patch b/package/utils/lua/patches/013-lnum-strtoul-parsing-fixes.patch
index 7f00c8c3a2..8887229589 100644
--- a/package/utils/lua/patches/013-lnum-strtoul-parsing-fixes.patch
+++ b/package/utils/lua/patches/013-lnum-strtoul-parsing-fixes.patch
@@ -1,8 +1,6 @@
-diff --git a/src/lnum.c b/src/lnum.c
-index 1456b6a2ed23..b0632b04c2b7 100644
--- a/src/lnum.c
+++ b/src/lnum.c
-@@ -127,6 +127,8 @@ static int luaO_str2i (const char *s, lua_Integer *res, char **endptr_ref) {
+@@ -127,6 +127,8 @@ static int luaO_str2i (const char *s, lu
#else
return 0; /* Reject the number */
#endif
@@ -11,7 +9,7 @@ index 1456b6a2ed23..b0632b04c2b7 100644
}
} else if ((v > LUA_INTEGER_MAX) || (*endptr && (!isspace(*endptr)))) {
return TK_NUMBER; /* not in signed range, or has '.', 'e' etc. trailing */
-@@ -310,3 +312,13 @@ int try_unmint( lua_Integer *r, lua_Integer ib ) {
+@@ -310,3 +312,13 @@ int try_unmint( lua_Integer *r, lua_Inte
return 0;
}
@@ -25,8 +23,6 @@ index 1456b6a2ed23..b0632b04c2b7 100644
+ return (unsigned LUA_INTEGER)v;
+}
+#endif
-diff --git a/src/lnum_config.h b/src/lnum_config.h
-index 19d7a4231a49..1092eead6629 100644
--- a/src/lnum_config.h
+++ b/src/lnum_config.h
@@ -141,7 +141,12 @@
@@ -43,6 +39,3 @@ index 19d7a4231a49..1092eead6629 100644
#endif
#ifndef LUA_INTEGER_MIN
# define LUA_INTEGER_MIN (-LUA_INTEGER_MAX -1) /* -2^16|32 */
---
-1.9.1
-
diff --git a/package/utils/lua/patches/020-shared_liblua.patch b/package/utils/lua/patches/020-shared_liblua.patch
index 64f683ddbe..f67ee2b3c7 100644
--- a/package/utils/lua/patches/020-shared_liblua.patch
+++ b/package/utils/lua/patches/020-shared_liblua.patch
@@ -3,12 +3,12 @@
@@ -42,8 +42,8 @@ PLATS= aix ansi bsd freebsd generic linu
# What to install.
- TO_BIN= lua luac
+ TO_BIN= lua$V luac$V
-TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
-TO_LIB= liblua.a
+TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp lnum_config.h
+TO_LIB= liblua.a liblua.so.$R
- TO_MAN= lua.1 luac.1
+ TO_MAN= lua$V.1 luac$V.1
# Lua version and release.
@@ -63,6 +63,7 @@ install: dummy
@@ -87,10 +87,10 @@
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
lundump.o lvm.o lzio.o lnum.o
-@@ -33,11 +34,12 @@ LUA_T= lua
+@@ -33,11 +34,12 @@ LUA_T= lua$V
LUA_O= lua.o
- LUAC_T= luac
+ LUAC_T= luac$V
-LUAC_O= luac.o print.o
+LUAC_O= luac.o print.o lopcodes.o
--
2.21.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list