lua: 5.2.2 -> 5.2.3

This commit is contained in:
Danny Rawlins 2014-02-17 13:03:38 +11:00
parent f9aec5cd7d
commit 5214f2f86f
6 changed files with 93 additions and 108 deletions

View File

@ -10,8 +10,9 @@ drwxr-xr-x root/root usr/include/
-rw-r--r-- root/root usr/include/lualib.h
drwxr-xr-x root/root usr/lib/
-rw-r--r-- root/root usr/lib/liblua.a
lrwxrwxrwx root/root usr/lib/liblua.so -> liblua.so.5.2
-rw-r--r-- root/root usr/lib/liblua.so
-rw-r--r-- root/root usr/lib/liblua.so.5.2
-rw-r--r-- root/root usr/lib/liblua.so.5.2.3
drwxr-xr-x root/root usr/lib/lua/
drwxr-xr-x root/root usr/lib/lua/5.2/
drwxr-xr-x root/root usr/lib/pkgconfig/

View File

@ -1,2 +1,3 @@
efbb645e897eae37cad4344ce8b0a614 lua-5.2.2.tar.gz
51a278f9386afed2ffdd1edb841db3d5 lua.diff
bdc663c7b82ffc0b5df67611621fb625 liblua.so.patch
dc7f94ec6ff15c985d2d6ad0f1b35654 lua-5.2.3.tar.gz
e7ba6c2b695b0b84a5ea0cbff5fc9067 lua.pc

View File

@ -5,20 +5,24 @@
# Depends on: readline
name=lua
version=5.2.2
version=5.2.3
release=1
source=(http://www.lua.org/ftp/$name-$version.tar.gz
$name.diff)
liblua.so.patch lua.pc)
build() {
cd $name-$version
patch -Np1 -i $SRC/$name.diff
patch -p 1 -i $SRC/liblua.so.patch
export CFLAGS="$CFLAGS -fPIC"
make linux
make INSTALL_TOP=$PKG/usr install
make MYCFLAGS="$CFLAGS" MYLDFLAGS="$LDFLAGS" linux
make pc > lua.pc
install -D -m 0644 lua.pc $PKG/usr/lib/pkgconfig/lua.pc
make \
TO_LIB='liblua.a liblua.so liblua.so.5.2 liblua.so.5.2.3' \
INSTALL_TOP=$PKG/usr install
#make pc > lua.pc
sed "s/%VER%/${version%.*}/g;s/%REL%/$version/g" $SRC/lua.pc > lua.pc
install -m 0644 -D lua.pc $PKG/usr/lib/pkgconfig/lua.pc
}

57
lua/liblua.so.patch Normal file
View File

@ -0,0 +1,57 @@
diff -ru lua-5.2.1/Makefile lua-5.2.1.new/Makefile
--- lua-5.2.1/Makefile 2012-05-17 16:05:54.000000000 +0200
+++ lua-5.2.1.new/Makefile 2012-09-12 22:39:07.162748096 +0200
@@ -52,7 +52,7 @@
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) $@ V=$(V) R=$(R)
test: dummy
src/lua -v
diff -ru lua-5.2.1/src/luaconf.h lua-5.2.1.new/src/luaconf.h
--- lua-5.2.1/src/luaconf.h 2012-05-11 16:14:42.000000000 +0200
+++ lua-5.2.1.new/src/luaconf.h 2012-09-12 22:40:27.986622772 +0200
@@ -100,7 +100,7 @@
#else /* }{ */
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
-#define LUA_ROOT "/usr/local/"
+#define LUA_ROOT "/usr/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \
diff -ru lua-5.2.1/src/Makefile lua-5.2.1.new/src/Makefile
--- lua-5.2.1/src/Makefile 2012-03-09 17:32:16.000000000 +0100
+++ lua-5.2.1.new/src/Makefile 2012-09-12 22:38:08.591386896 +0200
@@ -29,6 +29,7 @@
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o lctype.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
@@ -43,7 +44,7 @@
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
ALL_A= $(LUA_A)
# Targets start here.
@@ -59,6 +60,12 @@
$(AR) $@ $(BASE_O)
$(RANLIB) $@
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO)
+
+
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)

View File

@ -1,98 +0,0 @@
diff -aur lua-5.2.0.orig/Makefile lua-5.2.0/Makefile
--- lua-5.2.0.orig/Makefile 2011-11-16 00:38:12.000000000 +0100
+++ lua-5.2.0/Makefile 2012-03-14 09:00:52.823998608 +0100
@@ -10,7 +10,7 @@
# so take care if INSTALL_TOP is not an absolute path. See the local target.
# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
-INSTALL_TOP= /usr/local
+INSTALL_TOP= /usr
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
@@ -41,7 +41,7 @@
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so.5.2
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -63,6 +63,7 @@
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ ln -s liblua.so.5.2 $(INSTALL_LIB)/liblua.so
uninstall:
cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)
@@ -103,10 +104,14 @@
# echo pkg-config data
pc:
- @echo "version=$R"
@echo "prefix=$(INSTALL_TOP)"
@echo "libdir=$(INSTALL_LIB)"
@echo "includedir=$(INSTALL_INC)"
+ @echo "Name: Lua"
+ @echo "Description: An Extensible Extension Language"
+ @echo "Version: $R"
+ @echo "Libs: -L$(INSTALL_LIB) -llua -lm"
+ @echo "Cflags: -I$(INSTALL_INC)"
# list targets that do not create files (but not all makes understand .PHONY)
.PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
diff -aur lua-5.2.0.orig/src/Makefile lua-5.2.0/src/Makefile
--- lua-5.2.0.orig/src/Makefile 2011-09-19 14:45:14.000000000 +0200
+++ lua-5.2.0/src/Makefile 2012-03-14 08:41:50.374000136 +0100
@@ -7,7 +7,8 @@
PLAT= none
CC= gcc
-CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
+CFLAGS ?= -O2 -Wall
+CFLAGS += -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@@ -29,6 +30,7 @@
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o lctype.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
@@ -43,7 +45,7 @@
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
ALL_A= $(LUA_A)
# Targets start here.
@@ -59,6 +61,10 @@
$(AR) $@ $?
$(RANLIB) $@
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -shared -Wl,-soname,liblua.so -o $@.5.2 $? $(MYLDFLAGS)
+ ln -s $@.5.2 $@
+
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
diff -aur lua-5.2.0.orig/src/luaconf.h lua-5.2.0/src/luaconf.h
--- lua-5.2.0.orig/src/luaconf.h 2011-12-06 17:58:36.000000000 +0100
+++ lua-5.2.0/src/luaconf.h 2012-03-14 08:42:10.370999861 +0100
@@ -100,7 +100,7 @@
#else /* }{ */
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
-#define LUA_ROOT "/usr/local/"
+#define LUA_ROOT "/usr/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \

20
lua/lua.pc Normal file
View File

@ -0,0 +1,20 @@
V=%VER%
R=%REL%
prefix=/usr
INSTALL_BIN=${prefix}/bin
INSTALL_INC=${prefix}/include
INSTALL_LIB=${prefix}/lib
INSTALL_MAN=${prefix}/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}