[vlc-devel] [PATCH 6/6] Revert "contribs: lua 5.3"

Rafaël Carré funman at videolan.org
Mon Jul 11 12:30:40 CEST 2016


This reverts commit dc9fb25f37835829cdfef0488e96de591b79c4ff.
---
 contrib/src/lua/SHA512SUMS            |  2 +-
 contrib/src/lua/lua-ios-support.patch | 25 ++++++++++++++++++++++++
 contrib/src/lua/lua-noreadline.patch  | 25 ++++++++++++------------
 contrib/src/lua/lua.pc.in             | 20 -------------------
 contrib/src/lua/no-dylibs.patch       | 36 +++++++++++++++++------------------
 contrib/src/lua/no-localeconv.patch   | 20 ++++++++++---------
 contrib/src/lua/rules.mak             | 14 ++++++--------
 7 files changed, 73 insertions(+), 69 deletions(-)
 create mode 100644 contrib/src/lua/lua-ios-support.patch
 delete mode 100644 contrib/src/lua/lua.pc.in

diff --git a/contrib/src/lua/SHA512SUMS b/contrib/src/lua/SHA512SUMS
index df0bbbe..8b02bb7 100644
--- a/contrib/src/lua/SHA512SUMS
+++ b/contrib/src/lua/SHA512SUMS
@@ -1 +1 @@
-c8c7908ca927bcafe6739fb8b0226d77c796226c1e6770a38f1b1b577a73f7fb08ead64fe40809d5fff9a13db50e932e9f7164e4524e9d4fb3678182ec3d4d28  lua-5.3.2.tar.gz
+bc542fe8535826ac1e49b03a8f238cf049724b02c14718f8162cfeaf735a5e6c58412ff18dbe7a38e4cc4433f3d1e702554e9b24b5f021634b4280880980f40f  lua-5.1.4.tar.gz
diff --git a/contrib/src/lua/lua-ios-support.patch b/contrib/src/lua/lua-ios-support.patch
new file mode 100644
index 0000000..014a1e3
--- /dev/null
+++ b/contrib/src/lua/lua-ios-support.patch
@@ -0,0 +1,25 @@
+diff -ru lua/Makefile lua-f/Makefile
+--- lua/Makefile	2008-08-12 02:40:48.000000000 +0200
++++ lua-f/Makefile	2012-03-21 13:58:30.000000000 +0100
+@@ -38,7 +38,7 @@
+ # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
+ 
+ # Convenience platforms targets.
+-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
++PLATS= aix ansi bsd freebsd generic linux ios macosx mingw posix solaris
+ 
+ # What to install.
+ TO_BIN= lua luac
+diff -ru lua/src/Makefile lua-f/src/Makefile
+--- lua/src/Makefile	2012-03-21 13:58:59.000000000 +0100
++++ lua-f/src/Makefile	2012-03-21 13:57:08.000000000 +0100
+@@ -98,6 +98,9 @@
+ linux:
+ 	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl"
+ 
++ios:
++	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX
++
+ macosx:
+ 	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
+ # use this on Mac OS X 10.3-
diff --git a/contrib/src/lua/lua-noreadline.patch b/contrib/src/lua/lua-noreadline.patch
index 82764d6..862d3d1 100644
--- a/contrib/src/lua/lua-noreadline.patch
+++ b/contrib/src/lua/lua-noreadline.patch
@@ -1,23 +1,24 @@
 LUA: do not use readline on Linux
---- lua-5.3/src/Makefile    2016-03-16 11:53:27.008785835 +0100
-+++ lua/src/Makefile    2016-03-16 11:53:38.825752456 +0100
-@@ -107,7 +107,7 @@
- generic: $(ALL)
+diff -ru lua-5.1/src/Makefile lua/src/Makefile
+--- lua-5.1/src/Makefile	2006-02-16 17:45:09.000000000 +0200
++++ lua/src/Makefile	2009-02-09 23:35:21.000000000 +0200
+@@ -92,7 +92,7 @@
+ 	$(MAKE) all MYCFLAGS=
  
  linux:
--	$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
-+	$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
+-	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
++	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl"
  
  macosx:
- 	$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc
---- lua-5.3/src/luaconf.h.orig	2016-03-16 12:29:35.600387048 +0100
-+++ lua/src/luaconf.h	2016-03-16 12:29:51.140780084 +0100
-@@ -61,7 +61,7 @@
+ 	$(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
+diff -ru lua-5.1/src/luaconf.h lua/src/luaconf.h
+--- lua-5.1/src/luaconf.h	2006-02-10 19:44:06.000000000 +0200
++++ lua/src/luaconf.h	2009-02-09 23:33:29.000000000 +0200
+@@ -36,7 +36,6 @@
  #if defined(LUA_USE_LINUX)
  #define LUA_USE_POSIX
  #define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
 -#define LUA_USE_READLINE	/* needs some extra libraries */
-+//#define LUA_USE_READLINE	/* needs some extra libraries */
  #endif
  
- 
+ #if defined(LUA_USE_MACOSX)
diff --git a/contrib/src/lua/lua.pc.in b/contrib/src/lua/lua.pc.in
deleted file mode 100644
index 4043d10..0000000
--- a/contrib/src/lua/lua.pc.in
+++ /dev/null
@@ -1,20 +0,0 @@
-V=@VERSION_MAJOR@
-R=@VERSION@
-
-prefix=/usr
-INSTALL_BIN=${prefix}/bin
-INSTALL_INC=${prefix}/include
-INSTALL_LIB=${prefix}/lib
-INSTALL_MAN=${prefix}/share/man/man1
-INSTALL_LMOD=${prefix}/share/lua/${V}
-INSTALL_CMOD=${prefix}/lib/lua/${V}
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-
-Name: Lua
-Description: An Extensible Extension Language
-Version: ${R}
-Requires:
-Libs: -L${libdir} -llua -lm
-Cflags: -I${includedir}
diff --git a/contrib/src/lua/no-dylibs.patch b/contrib/src/lua/no-dylibs.patch
index 24ce73e..e925f2d 100644
--- a/contrib/src/lua/no-dylibs.patch
+++ b/contrib/src/lua/no-dylibs.patch
@@ -1,27 +1,25 @@
---- lua/src/luaconf.h.orig	2016-03-16 12:10:53.502005950 +0100
-+++ lua/src/luaconf.h	2016-03-16 12:12:59.848535297 +0100
-@@ -53,21 +53,21 @@
+--- lua/src/luaconf.h.orig	2013-05-09 15:29:05.797554571 +0200
++++ lua/src/luaconf.h	2013-05-09 15:29:10.337554380 +0200
+@@ -42,7 +42,7 @@
  
- 
- #if defined(LUA_USE_WINDOWS)
--#define LUA_DL_DLL	/* enable support for DLL */
-+//#define LUA_DL_DLL	/* enable support for DLL */
- #define LUA_USE_C89	/* broadly, Windows is C89 */
+ #if defined(LUA_USE_MACOSX)
+ #define LUA_USE_POSIX
+-#define LUA_DL_DYLD		/* does not need extra library */
++//#define LUA_DL_DYLD		/* does not need extra library */
  #endif
  
  
- #if defined(LUA_USE_LINUX)
- #define LUA_USE_POSIX
--#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
-+//#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
- //#define LUA_USE_READLINE	/* needs some extra libraries */
+@@ -691,11 +691,11 @@
+ ** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD.
+ */
+ #if defined(LUA_USE_DLOPEN)
+-#define LUA_DL_DLOPEN
++//#define LUA_DL_DLOPEN
  #endif
  
- 
- #if defined(LUA_USE_MACOSX)
- #define LUA_USE_POSIX
--#define LUA_USE_DLOPEN		/* MacOS does not need -ldl */
-+//#define LUA_USE_DLOPEN		/* MacOS does not need -ldl */
- #define LUA_USE_READLINE	/* needs an extra library: -lreadline */
+ #if defined(LUA_WIN)
+-#define LUA_DL_DLL
++//#define LUA_DL_DLL
  #endif
  
+ 
diff --git a/contrib/src/lua/no-localeconv.patch b/contrib/src/lua/no-localeconv.patch
index 240398d..02d67c0 100644
--- a/contrib/src/lua/no-localeconv.patch
+++ b/contrib/src/lua/no-localeconv.patch
@@ -1,11 +1,13 @@
---- lua/src/llex.c.orig	2016-03-16 12:21:12.567664718 +0100
-+++ lua/src/llex.c	2016-03-16 12:21:39.361675706 +0100
-@@ -226,7 +226,7 @@
- */
- static void trydecpoint (LexState *ls, TValue *o) {
+--- lua/src/llex.c.orig	2011-12-25 23:39:35.254829002 -0500
++++ lua/src/llex.c	2011-12-25 23:39:59.662829001 -0500
+@@ -176,9 +176,8 @@
+ 
+ static void trydecpoint (LexState *ls, SemInfo *seminfo) {
+   /* format error: try to update decimal point separator */
+-  struct lconv *cv = localeconv();
    char old = ls->decpoint;
--  ls->decpoint = lua_getlocaledecpoint();
-+  //ls->decpoint = lua_getlocaledecpoint();
-   buffreplace(ls, old, ls->decpoint);  /* try new decimal separator */
-   if (luaO_str2num(luaZ_buffer(ls->buff), o) == 0) {
+-  ls->decpoint = (cv ? cv->decimal_point[0] : '.');
++  ls->decpoint = '.';
+   buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
+   if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
      /* format error with correct decimal point: no more options */
diff --git a/contrib/src/lua/rules.mak b/contrib/src/lua/rules.mak
index 512c3c3..8be4af2 100644
--- a/contrib/src/lua/rules.mak
+++ b/contrib/src/lua/rules.mak
@@ -1,7 +1,6 @@
-# Lua 5.3
+# Lua 5.1
 
-LUA_VERSION := 5.3.2
-LUA_VERSION_MAJOR := 5.3
+LUA_VERSION := 5.1.4
 LUA_URL := http://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz
 
 # Reverse priority order
@@ -27,9 +26,6 @@ endif
 
 # Feel free to add autodetection if you need to...
 PKGS += lua
-ifeq ($(call need_pkg,"lua5.3"),)
-PKGS_FOUND += lua
-endif
 ifeq ($(call need_pkg,"lua5.2"),)
 PKGS_FOUND += lua
 endif
@@ -46,7 +42,9 @@ lua: lua-$(LUA_VERSION).tar.gz .sum-lua
 	$(UNPACK)
 	$(APPLY) $(SRC)/lua/lua-noreadline.patch
 	$(APPLY) $(SRC)/lua/no-dylibs.patch
+	$(APPLY) $(SRC)/lua/luac-32bits.patch
 	$(APPLY) $(SRC)/lua/no-localeconv.patch
+	$(APPLY) $(SRC)/lua/lua-ios-support.patch
 ifdef HAVE_DARWIN_OS
 	(cd $(UNPACK_DIR) && \
 	sed -e 's%gcc%$(CC)%' \
@@ -74,10 +72,10 @@ ifdef HAVE_WIN32
 	cd $</src && $(HOSTVARS) $(MAKE) liblua.a
 endif
 	cd $< && $(HOSTVARS) $(MAKE) install INSTALL_TOP="$(PREFIX)"
-	mkdir -p -- "$(PREFIX)/lib/pkgconfig"
-	sed -e 's/@VERSION_MAJOR@/$(LUA_VERSION_MAJOR)/g' -e 's/@VERSION@/$(LUA_VERSION)/g' <  $(SRC)/lua/lua.pc.in > "$(PREFIX)/lib/pkgconfig/lua.pc"
 ifdef HAVE_WIN32
 	cd $< && $(RANLIB) "$(PREFIX)/lib/liblua.a"
+	mkdir -p -- "$(PREFIX)/lib/pkgconfig"
+	cp $</etc/lua.pc "$(PREFIX)/lib/pkgconfig/"
 endif
 ifdef HAVE_CROSS_COMPILE
 	cd $</src && $(MAKE) clean && $(MAKE) liblua.a && ranlib liblua.a && $(MAKE) luac
-- 
2.7.4



More information about the vlc-devel mailing list