From 449b7851a5f3a7a09f121827d614808ca070e93d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 10 Oct 2013 11:44:13 +0200 Subject: [PATCH] Resurrect lua 5.1.x as lua51 (still required by some pkgs). --- common/shlibs | 1 + srcpkgs/lua51-devel | 1 + srcpkgs/lua51/patches/lua-5.1-cflags.diff | 12 +++++ srcpkgs/lua51/patches/lua-arch.patch | 63 ++++++++++++++++++++++ srcpkgs/lua51/template | 66 +++++++++++++++++++++++ 5 files changed, 143 insertions(+) create mode 120000 srcpkgs/lua51-devel create mode 100644 srcpkgs/lua51/patches/lua-5.1-cflags.diff create mode 100644 srcpkgs/lua51/patches/lua-arch.patch create mode 100644 srcpkgs/lua51/template diff --git a/common/shlibs b/common/shlibs index c4cd1122b6f..9a82e7e132f 100644 --- a/common/shlibs +++ b/common/shlibs @@ -768,6 +768,7 @@ libgc.so.1 gc-7.1_1 libgslcblas.so.0 gsl-1.15_1 libgsl.so.0 gsl-1.15_1 liblua.so.5.2 lua-5.2.2_1 +liblua5.1.so.5.1 lua51-5.1.5_1 libburn.so.4 libburn-0.7.2_1 libgdkmm-2.4.so.1 gtkmm2-2.24.0_1 libgtkmm-2.4.so.1 gtkmm2-2.24.0_1 diff --git a/srcpkgs/lua51-devel b/srcpkgs/lua51-devel new file mode 120000 index 00000000000..56a174393ce --- /dev/null +++ b/srcpkgs/lua51-devel @@ -0,0 +1 @@ +lua51 \ No newline at end of file diff --git a/srcpkgs/lua51/patches/lua-5.1-cflags.diff b/srcpkgs/lua51/patches/lua-5.1-cflags.diff new file mode 100644 index 00000000000..9944da56ce8 --- /dev/null +++ b/srcpkgs/lua51/patches/lua-5.1-cflags.diff @@ -0,0 +1,12 @@ +--- src/Makefile 2006-02-16 16:45:09.000000000 +0100 ++++ src/Makefile 2006-03-01 14:55:29.000000000 +0100 +@@ -8,7 +8,8 @@ + PLAT= none + + CC= gcc +-CFLAGS= -O2 -Wall $(MYCFLAGS) ++CFLAGS ?= -O2 -Wall ++CFLAGS += $(MYCFLAGS) + AR= ar rcu + RANLIB= ranlib + RM= rm -f diff --git a/srcpkgs/lua51/patches/lua-arch.patch b/srcpkgs/lua51/patches/lua-arch.patch new file mode 100644 index 00000000000..431b855e937 --- /dev/null +++ b/srcpkgs/lua51/patches/lua-arch.patch @@ -0,0 +1,63 @@ +--- etc/lua.pc 2008-08-08 14:46:11.000000000 +0200 ++++ etc/lua.pc 2012-02-23 18:25:34.000000000 +0100 +@@ -8,6 +8,6 @@ + + # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' +-prefix= /usr/local ++prefix= /usr + INSTALL_BIN= ${prefix}/bin + INSTALL_INC= ${prefix}/include + INSTALL_LIB= ${prefix}/lib +--- src/luaconf.h 2008-02-11 17:25:08.000000000 +0100 ++++ src/luaconf.h 2012-02-23 18:25:34.000000000 +0100 +@@ -94,7 +94,7 @@ + ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" + + #else +-#define LUA_ROOT "/usr/local/" ++#define LUA_ROOT "/usr/" + #define LUA_LDIR LUA_ROOT "share/lua/5.1/" + #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" + #define LUA_PATH_DEFAULT \ +--- src/Makefile 2008-01-19 20:37:58.000000000 +0100 ++++ src/Makefile 2012-02-23 18:26:43.000000000 +0100 +@@ -23,6 +23,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 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 +@@ -36,7 +37,7 @@ + LUAC_O= luac.o print.o + + ALL_O= $(CORE_O) $(LIB_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) + + default: $(PLAT) +@@ -51,6 +52,11 @@ + $(AR) $@ $? + $(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 $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + +--- Makefile 2008-08-12 02:40:48.000000000 +0200 ++++ Makefile 2012-02-23 19:06:32.000000000 +0100 +@@ -53,7 +53,7 @@ + all: $(PLAT) + + $(PLATS) clean: +- cd src && $(MAKE) $@ ++ cd src && $(MAKE) $@ V=$(V) R=$(R) + + test: dummy + src/lua test/hello.lua diff --git a/srcpkgs/lua51/template b/srcpkgs/lua51/template new file mode 100644 index 00000000000..08dc2e6c05b --- /dev/null +++ b/srcpkgs/lua51/template @@ -0,0 +1,66 @@ +# Template file for 'lua51' +pkgname=lua51 +version=5.1.5 +revision=1 +wrksrc="lua-${version}" +makedepends="ncurses-devel readline-devel" +short_desc="Powerful, fast, lightweight, embeddable scripting language (5.1.x)" +maintainer="Juan RP " +homepage="http://www.lua.org" +license="MIT" +distfiles="http://www.lua.org/ftp/lua-$version.tar.gz" +checksum=2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333 +long_desc=" + Lua combines simple procedural syntax with powerful data description + constructs based on associative arrays and extensible semantics. Lua + is dynamically typed, runs by interpreting bytecode for a register-based + virtual machine, and has automatic memory management with incremental + garbage collection, making it ideal for configuration, scripting, and + rapid prototyping." + +do_build() { + export CFLAGS="$CFLAGS -fPIC" + sed -e 's:llua:llua5.1:' -e 's:/include:/include/lua5.1:' -i etc/lua.pc + sed -r -e '/^LUA_(SO|A|T)=/ s/lua/lua5.1/' -e '/^LUAC_T=/ s/luac/luac5.1/' -i src/Makefile + make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" \ + CC="$CC" RANLIB="$RANLIB" \ + INSTALL_DATA="cp -d" LUA_SO=liblua5.1.so ${makejobs} linux +} + +do_install() { + make INSTALL_DATA="cp -d" INSTALL_TOP="${DESTDIR}/usr" \ + TO_BIN="lua5.1 luac5.1" \ + TO_LIB="liblua5.1.a liblua5.1.so liblua5.1.so.5.1 liblua5.1.so.${version}" \ + INSTALL_INC="${DESTDIR}/usr/include/lua5.1" \ + INSTALL_MAN="${DESTDIR}/usr/share/man/man1" install + + install -Dm644 etc/lua.pc ${DESTDIR}/usr/lib/pkgconfig/lua5.1.pc + + # Install the documentation + vmkdir usr/share/doc/lua51 + cp -R doc/* ${DESTDIR}/usr/share/doc/lua51 + + ln -s liblua5.1.so ${DESTDIR}/usr/lib/liblua.so.5.1 + ln -s liblua5.1.so ${DESTDIR}/usr/lib/liblua.so.${version} + cd ${DESTDIR}/usr/share/man/man1 + mv lua.1 lua5.1.1 + mv luac.1 luac5.1.1 +} + +lua51-devel_package() { + depends="ncurses-devel readline-devel lua51>=${version}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + vmove usr/share/doc + } +} + +lua51_package() { + pkg_install() { + vmove all + } +}