diff options
-rw-r--r-- | dev-lang/lua/files/digest-lua-5.1.1 | 3 | ||||
-rw-r--r-- | dev-lang/lua/files/lua-5.1.1-make.patch | 74 | ||||
-rw-r--r-- | dev-lang/lua/files/lua-5.1.1-module_paths.patch | 30 | ||||
-rw-r--r-- | dev-lang/lua/files/lua-5.1.1-readline.patch | 10 | ||||
-rw-r--r-- | dev-lang/lua/lua-5.1.1.ebuild | 86 |
5 files changed, 203 insertions, 0 deletions
diff --git a/dev-lang/lua/files/digest-lua-5.1.1 b/dev-lang/lua/files/digest-lua-5.1.1 new file mode 100644 index 000000000000..5a0845c161bb --- /dev/null +++ b/dev-lang/lua/files/digest-lua-5.1.1 @@ -0,0 +1,3 @@ +MD5 22f4f912f20802c11006fe9b84d5c461 lua-5.1.1.tar.gz 207810 +RMD160 0b9cc31cca1a0f4c2ebb62f177dc157677953a4c lua-5.1.1.tar.gz 207810 +SHA256 c5daeed0a75d8e4dd2328b7c7a69888247868154acbda69110e97d4a6e17d1f0 lua-5.1.1.tar.gz 207810 diff --git a/dev-lang/lua/files/lua-5.1.1-make.patch b/dev-lang/lua/files/lua-5.1.1-make.patch new file mode 100644 index 000000000000..7522e56bb08c --- /dev/null +++ b/dev-lang/lua/files/lua-5.1.1-make.patch @@ -0,0 +1,74 @@ +--- /home/mabi/gentoo/lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200 ++++ ./Makefile 2006-11-16 02:16:53.000000000 +0100 +@@ -22,10 +22,10 @@ + # How to install. You may prefer "install" instead of "cp" if you have it. + # To remove debug information from binaries, use "install -s" in INSTALL_EXEC. + # +-INSTALL_EXEC= $(CP) +-INSTALL_DATA= $(CP) +-#INSTALL_EXEC= $(INSTALL) -m 0755 +-#INSTALL_DATA= $(INSTALL) -m 0644 ++#INSTALL_EXEC= $(CP) ++#INSTALL_DATA= $(CP) ++INSTALL_EXEC= $(INSTALL) -m 0755 ++INSTALL_DATA= $(INSTALL) -m 0644 + + # Utilities. + CP= cp +@@ -127,3 +127,21 @@ + .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer + + # (end of Makefile) ++ ++# Use libtool for binary installs, etc. ++ ++export V ++export LIBTOOL = libtool --quiet --tag=CC ++# See libtool manual about how to set this ++ ++gentoo_clean: ++ cd src; $(MAKE) $@ ++ ++gentoo_test: gentoo_linux ++ src/lua-$(V) test/hello.lua ++ ++gentoo_install: ++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) ++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua-$(V) luac-$(V) $(INSTALL_BIN) ++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) ++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB) +--- /home/mabi/gentoo/lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100 ++++ ./src/Makefile 2006-11-16 02:10:27.000000000 +0100 +@@ -176,3 +176,32 @@ + ltm.h lzio.h lmem.h lopcodes.h lundump.h + + # (end of Makefile) ++ ++export LIBTOOL = libtool --quiet --tag=CC ++export LIB_VERSION = 6:1:1 ++ ++# The following rules use libtool for compiling and linking in order to ++# provide shared library support. While we are at it, our desired version ++# suffixes are added to the targets, preventing conflicts with rules in ++# the upstream makefile. ++ ++LIB_NAME = liblua.la ++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo) ++ ++%.lo %.o: %.c ++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< ++ ++$(LIB_NAME) $(LIB_NAME:.la=.a): $(LIB_OBJS) ++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \ ++ -rpath $(RPATH) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS) ++ ++lua-$(V): $(LUA_O) $(LIB_NAME) ++ $(LIBTOOL) --mode=link $(CC) -static -Wl,-E -o $@ $(LUA_O) $(LIB_NAME) $(LUA_LIBS) ++ ++luac-$(V): $(LUAC_O) $(LIB_NAME) ++ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LUAC_O) $(LIB_NAME) ++ ++gentoo_clean: ++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua-$(V) luac-$(V) ++ ++gentoo_all: $(LIB_NAME) lua-$(V) luac-$(V) diff --git a/dev-lang/lua/files/lua-5.1.1-module_paths.patch b/dev-lang/lua/files/lua-5.1.1-module_paths.patch new file mode 100644 index 000000000000..29ac4c3bf4bd --- /dev/null +++ b/dev-lang/lua/files/lua-5.1.1-module_paths.patch @@ -0,0 +1,30 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## src_luaconf.h.dpatch by John V. Belmonte <jbelmonte@debian.org> +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Set Lua's default PATH and CPATH. + +@DPATCH@ +diff -urNad trunk~/src/luaconf.h trunk/src/luaconf.h +--- trunk~/src/luaconf.h 2006-02-10 12:44:06.000000000 -0500 ++++ trunk/src/luaconf.h 2006-02-17 21:32:55.000000000 -0500 +@@ -83,13 +83,17 @@ + + #else + #define LUA_ROOT "/usr/local/" ++#define LUA_ROOT2 "/usr/" + #define LUA_LDIR LUA_ROOT "share/lua/5.1/" ++#define LUA_LDIR2 LUA_ROOT2 "share/lua/5.1/" + #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" ++#define LUA_CDIR2 LUA_ROOT2 "lib/lua/5.1/" + #define LUA_PATH_DEFAULT \ + "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ +- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" ++ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ ++ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua" + #define LUA_CPATH_DEFAULT \ +- "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so" ++ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR2"?.so;" LUA_CDIR"loadall.so" + #endif + + diff --git a/dev-lang/lua/files/lua-5.1.1-readline.patch b/dev-lang/lua/files/lua-5.1.1-readline.patch new file mode 100644 index 000000000000..f144861efb6b --- /dev/null +++ b/dev-lang/lua/files/lua-5.1.1-readline.patch @@ -0,0 +1,10 @@ +--- lua-5.1.1.orig/src/luaconf.h 2006-04-10 20:27:23.000000000 +0200 ++++ lua-5.1.1/src/luaconf.h 2006-11-15 14:53:07.000000000 +0100 +@@ -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 */ + #endif + + #if defined(LUA_USE_MACOSX) diff --git a/dev-lang/lua/lua-5.1.1.ebuild b/dev-lang/lua/lua-5.1.1.ebuild new file mode 100644 index 000000000000..2d9605814654 --- /dev/null +++ b/dev-lang/lua/lua-5.1.1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/lua-5.1.1.ebuild,v 1.1 2006/11/17 21:23:12 mabi Exp $ + +inherit eutils portability + +DESCRIPTION="A powerful light-weight programming language designed for extending applications" +HOMEPAGE="http://www.lua.org/" +SRC_URI="http://www.lua.org/ftp/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~ppc" +IUSE="readline" + +RDEPEND="readline? ( sys-libs/readline )" +DEPEND="${RDEPEND}" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${P}-make.patch + epatch "${FILESDIR}"/${P}-module_paths.patch + + sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html + + if ! use readline ; then + epatch "${FILESDIR}"/${P}-readline.patch + fi +} + +src_compile() { + myflags= + # what to link to liblua + liblibs="-lm" + if use ppc-macos; then + mycflags="${mycflags} -DLUA_USE_MACOSX" + else # building for standard linux (and bsd too) + mycflags="${mycflags} -DLUA_USE_LINUX" + liblibs="${liblibs} -ldl" + fi + + # what to link to the executables + mylibs= + if use readline; then + mylibs="-lreadline" + fi + + cd src + emake CFLAGS="${mycflags} ${CFLAGS}" \ + RPATH="/usr/$(get_libdir)/" \ + LUA_LIBS="${mylibs}" \ + LIB_LIBS="${liblibs}" \ + V=${PV} \ + gentoo_all || die "emake failed" +} + +src_install() { + emake INSTALL_TOP="${D}/usr/" V=${PV} gentoo_install \ + || die "emake install gentoo_install failed" + + dodoc HISTORY README + dohtml doc/*.html doc/*.gif + + insinto /usr/share/pixmaps + doins etc/lua.ico + insinto /usr/$(get_libdir)/pkgconfig + doins etc/lua.pc +} + +src_test() { + local positive="bisect cf echo env factorial fib fibfor hello printf sieve + sort trace-calls trace-globals" + local negative="readonly" + local test + + cd "${S}" + for test in ${positive}; do + src/${P} test/${test}.lua &> /dev/null || die "test $test failed" + done + + for test in ${negative}; do + src/${P} test/${test}.lua &> /dev/null && die "test $test failed" + done +} |