This will allow installing Lua 5.1 and newer versions at the same time.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
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/ \
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
--- /dev/null
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@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@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)
--- a/Makefile
+++ b/Makefile
-@@ -42,7 +42,7 @@
+@@ -42,7 +42,7 @@ 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_INC= lua.h luaconf.h lualib.h lauxlib.h lnum_config.h ../etc/lua.hpp
TO_LIB= liblua.a
- TO_MAN= lua.1 luac.1
+ TO_MAN= lua$V.1 luac$V.1
--- a/src/Makefile
+++ b/src/Makefile
--- /dev/null
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@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@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)
@@ -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
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