lua: Update to 5.3

This drops the autotool patch which is unnecessary and hard
to carry around.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer 2019-03-26 11:52:44 +00:00
parent 30ab70abe2
commit 9ddd3984eb
4 changed files with 108 additions and 43683 deletions

View File

@ -4,8 +4,9 @@
###############################################################################
name = lua
version = 5.1.4
release = 3
major_version = 5.3
version = %{major_version}.5
release = 1
groups = Development/Languages
url = http://www.lua.org/
@ -23,41 +24,47 @@ description
configuration, scripting, and rapid prototyping.
end
source_dl =
source_dl = http://www.lua.org/ftp/
build
requires
perl-Carp
autoconf
automake
libtool
ncurses-devel
readline-devel
end
prepare_cmds
chmod u+x autogen.sh config.guess config.sub configure \
depcomp install-sh missing
sh autogen.sh
# Lua 5.3.4 has wrong release version in its Makefile
sed "s/^R= \$V.4/R= \$V.5/" -i Makefile
end
configure_options += \
--mandir=/usr/share/man \
--with-readline
make_build_targets += \
MYCFLAGS="%{CFLAGS} -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1" \
MYLDFLAGS="%{LDFLAGS}" \
linux
# hack so that only /usr/bin/lua gets linked with readline as it is the
# only one which needs this and otherwise we get License troubles
make_build_targets = LIBS="-ldl" luac_LDADD="liblua.la -lm -ldl"
test
make test
end
# Remove readline from lua.pc
build_cmds
sed -i 's/-lreadline -lncurses //g' etc/lua.pc
make_install_targets += \
TO_LIB="liblua.so.%{version}" \
INSTALL_TOP="%{BUILDROOT}%{prefix}" \
INSTALL_LIB="%{BUILDROOT}%{libdir}" \
INSTALL_MAN="%{BUILDROOT}%{mandir}/man1"
install_cmds
# Install library links
ln -svf liblua.so.%{version} %{BUILDROOT}%{libdir}/liblua.so.%{major_version}
ln -svf liblua.so.%{major_version} %{BUILDROOT}%{libdir}/liblua.so
# Install pkgconfig file
mkdir -pv %{BUILDROOT}%{libdir}/pkgconfig
sed "s/%VER%/%{major_version}/g;s/%REL%/%{version}/g" \
< %{DIR_SOURCE}/lua.pc > %{BUILDROOT}%{libdir}/pkgconfig/lua.pc
end
end
packages
package %{name}
end
package %{name}-devel
template DEVEL
@ -65,8 +72,6 @@ packages
package %{name}-libs
template LIBS
files += /usr/lib*/liblua-5.1.so
end
package %{name}-debuginfo

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}

View File

@ -0,0 +1,60 @@
diff --git a/Makefile b/Makefile
index 7fa91c8..dccf485 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ R= $V.0
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) $@ V=$(V) R=$(R)
test: dummy
src/lua -v
diff --git a/src/Makefile b/src/Makefile
index 2e7a412..fa5769f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -29,6 +29,7 @@ MYOBJS=
PLATS= aix bsd c89 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_T= luac
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 @@ $(LUA_A): $(BASE_O)
$(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)
diff --git a/src/luaconf.h b/src/luaconf.h
index fd28d21..e2662cc 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -175,7 +175,7 @@
#else /* }{ */
-#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 \

File diff suppressed because it is too large Load Diff