removing old version, adding slotted versions
authorMatti Bickel <mabi@gentoo.org>
Sat, 13 Jan 2007 14:28:52 +0000 (14:28 +0000)
committerMatti Bickel <mabi@gentoo.org>
Sat, 13 Jan 2007 14:28:52 +0000 (14:28 +0000)
Package-Manager: portage-2.1.1-r2

dev-lang/lua/ChangeLog
dev-lang/lua/files/digest-lua-5.0.3-r1 [new file with mode: 0644]
dev-lang/lua/files/digest-lua-5.1.1-r1 [new file with mode: 0644]
dev-lang/lua/files/lua-5.1.1-Makefile.patch [new file with mode: 0644]
dev-lang/lua/files/lua-5.1.1-make_static.patch
dev-lang/lua/lua-5.0.3-r1.ebuild [new file with mode: 0644]
dev-lang/lua/lua-5.1.1-r1.ebuild [new file with mode: 0644]
dev-lang/lua/metadata.xml

index 3d741ac1144a499d808f108ce213868ac5159256..10b7cf435e3dc423764c3c58a0e3a90b561417bd 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for dev-lang/lua
-# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.58 2006/12/27 01:47:14 redhatter Exp $
+# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.59 2007/01/13 14:28:52 mabi Exp $
+
+*lua-5.1.1-r1 (10 Jan 2007)
+*lua-5.0.3-r1 (10 Jan 2007)
+
+  10 Jan 2007; Matti Bickel <mabi@gentoo.org> -files/lua-4.0-config.patch,
+  +files/lua-5.1.1-Makefile.patch, files/lua-5.1.1-make_static.patch,
+  -lua-4.0.1.ebuild, +lua-5.0.3-r1.ebuild, +lua-5.1.1-r1.ebuild:
+  Remove old version, add slotted versions of lua
 
   27 Dec 2006; Stuart Longland <redhatter@gentoo.org> lua-5.0.2.ebuild:
   Marked v5.0.2 stable on mips as per bug #150072
diff --git a/dev-lang/lua/files/digest-lua-5.0.3-r1 b/dev-lang/lua/files/digest-lua-5.0.3-r1
new file mode 100644 (file)
index 0000000..b3c83fe
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 feee27132056de2949ce499b0ef4c480 lua-5.0.3.tar.gz 191384
+RMD160 cb3ed4320b438d73c8ff6c93a02275c9fb461883 lua-5.0.3.tar.gz 191384
+SHA256 1193a61b0e08acaa6eee0eecf29709179ee49c71baebc59b682a25c3b5a45671 lua-5.0.3.tar.gz 191384
diff --git a/dev-lang/lua/files/digest-lua-5.1.1-r1 b/dev-lang/lua/files/digest-lua-5.1.1-r1
new file mode 100644 (file)
index 0000000..5a0845c
--- /dev/null
@@ -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-Makefile.patch b/dev-lang/lua/files/lua-5.1.1-Makefile.patch
new file mode 100644 (file)
index 0000000..6b95e03
--- /dev/null
@@ -0,0 +1,138 @@
+--- Makefile.orig      2006-06-02 12:53:38.000000000 +0200
++++ Makefile   2007-01-13 00:03:46.000000000 +0100
+@@ -7,25 +7,29 @@
+ # Your platform. See PLATS for possible values.
+ PLAT= none
++# Lua version and release.
++V= 5.1
++R= 5.1.1
++
+ # Where to install. The installation starts in the src directory, so take care
+ # if INSTALL_TOP is not an absolute path. (Man pages are installed from the
+ # doc directory.)
+ #
+ INSTALL_TOP= /usr/local
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua-$V
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+-INSTALL_MAN= $(INSTALL_TOP)/man/man1
++INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+ # 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
+@@ -40,22 +44,18 @@
+ PLATS= aix ansi bsd generic linux macosx mingw posix solaris
+ # What to install.
+-TO_BIN= lua luac
++TO_BIN= lua-$V luac-$V
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+-TO_LIB= liblua.a
++TO_LIB= liblua-$V.a
+ TO_MAN= lua.1 luac.1
+-# Lua version and release.
+-V= 5.1
+-R= 5.1.1
+-
+ all:  $(PLAT)
+ $(PLATS) clean:
+       cd src && $(MAKE) $@
+ test: dummy
+-      src/lua test/hello.lua
++      src/lua-$V test/hello.lua
+ install: dummy
+       cd src && $(MKDIR) -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+@@ -127,3 +127,22 @@
+ .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
++      test/lua.static test/hello.lua
++
++gentoo_install:
++      mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN)
++      cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) $(TO_LIB:%.a=%.la) $(INSTALL_LIB)
++      cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
++      cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
++      cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+--- lua-5.1.1.orig/src/Makefile        2006-03-22 01:41:49.000000000 +0100
++++ /var/tmp/portage/lua-5.1.1-r1/work/lua-5.1.1/src/Makefile  2007-01-12 23:40:15.000000000 +0100
+@@ -29,10 +29,10 @@
+ LIB_O=        lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
+       lstrlib.o loadlib.o linit.o
+-LUA_T=        lua
++LUA_T=        lua-$V
+ LUA_O=        lua.o
+-LUAC_T=       luac
++LUAC_T=       luac-$V
+ LUAC_O=       luac.o print.o
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+@@ -176,3 +176,35 @@
+   ltm.h lzio.h lmem.h lopcodes.h lundump.h
+ # (end of Makefile)
++
++export LIBTOOL = libtool --quiet --tag=CC
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support.
++
++LIB_NAME = liblua-$V.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_OBJS)
++      $(LIBTOOL) --mode=link $(CC) \
++            -rpath $(RPATH) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++$(LIB_NAME:.la=.a): $(LIB_OBJS)
++      $(LIBTOOL) --mode=link $(CC) -static -o $(LIB_NAME:.la=.a) $(LIB_OBJS)
++
++$(LUA_T): $(LUA_O) $(LIB_NAME)
++      $(LIBTOOL) --mode=link $(CC) -Wl,-E -o $@ $(LUA_O) $(LUA_LIBS) -llua-$V
++
++lua_test: $(LUA_O) $(LIB_NAME)
++      $(LIBTOOL) --mode=link $(CC) -static -Wl,-E -o $@ $(LUA_O) $(LIB_NAME) $(LUA_LIBS)
++
++$(LUAC_T): $(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_T) $(LUAC_T)
++
++gentoo_all: $(LIB_NAME) $(LIB_NAME:.la=.a) $(LUA_T) lua_test $(LUAC_T)
index 53c5bd1a9cf8083eafc3a9b0cf3266792fc594b5..502109d1708d35dfb9d4e954fe967dca59811a44 100644 (file)
@@ -4,9 +4,9 @@ diff -ru lua-5.1.1.orig/src/Makefile lua-5.1.1/src/Makefile
 @@ -196,7 +196,7 @@
              -rpath $(RPATH) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
  
lua: $(LUA_O) $(LIB_NAME)
$(LUA_T): $(LUA_O) $(LIB_NAME)
 -      $(LIBTOOL) --mode=link $(CC) -Wl,-E -o $@ $(LUA_O) $(LUA_LIBS) -llua
 +      $(LIBTOOL) --mode=link $(CC) -static -Wl,-E -o $@ $(LUA_O) $(LIB_NAME) $(LUA_LIBS)
  
luac: $(LUAC_O) $(LIB_NAME)
$(LUAC_T): $(LUAC_O) $(LIB_NAME)
        $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LUAC_O) $(LIB_NAME)
diff --git a/dev-lang/lua/lua-5.0.3-r1.ebuild b/dev-lang/lua/lua-5.0.3-r1.ebuild
new file mode 100644 (file)
index 0000000..d35fcd1
--- /dev/null
@@ -0,0 +1,129 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/lua-5.0.3-r1.ebuild,v 1.1 2007/01/13 14:28:52 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="1"
+KEYWORDS="~ppc ~ppc64 ~x86"
+IUSE="readline"
+
+RDEPEND="readline? ( sys-libs/readline )
+               dev-lang/lua-wrapper
+               !=dev-lang/lua-5.0.3
+               !=dev-lang/lua-5.0.2"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       epatch "${FILESDIR}"/${P}-destdir.patch
+       epatch "${FILESDIR}"/${P}-dylib.patch
+       epatch "${FILESDIR}"/${P}-shared.patch
+       epatch "${FILESDIR}"/${P}-ldflags.patch
+       epatch "${FILESDIR}"/${P}-asneeded.patch
+
+       sed -i config \
+               -e 's:^#\(LOADLIB= -DUSE_DLOPEN=1\):\1:' \
+               -e 's:^#\(POPEN= -DUSE_POPEN=1\)$:\1:' \
+               -e "s:^\(MYCFLAGS= \)-O2:\1${CFLAGS}:" \
+               -e 's:^\(INSTALL_ROOT= \)/usr/local:\1/usr:' \
+               -e 's:^\(INSTALL_INC= $(INSTALL_ROOT)/include\):\1/lua-5.0:' \
+               -e "s:^\(INSTALL_LIB= \$(INSTALL_ROOT)/\)lib:\1$(get_libdir):" \
+               -e 's:^\(INSTALL_MAN= $(INSTALL_ROOT)\)/man/man1:\1/share/man/man1:'
+
+       sed -i -e 's/^\(install: all\) strip/\1/' Makefile
+
+       # Version the lua binarys/lib
+       sed -i src/lua/Makefile \
+               -e 's:^\(T= $(BIN)/lua\):\1-5.0:' \
+               -e 's:llua :llua-5.0 :' \
+               -e 's:llualib:llualib-5.0:'
+       sed -i src/luac/Makefile \
+               -e 's:^\(T= $(BIN)/luac\):\1-5.0:' \
+               -e 's:llua :llua-5.0 :' \
+               -e 's:llualib:llualib-5.0:'
+       sed -i -e 's:^\(T= $(LIB)/liblua\).a:\1-5.0.a:' src/Makefile
+       sed -i -e 's:^\(T= $(LIB)/liblualib\).a:\1-5.0.a:' src/lib/Makefile
+
+       [[ ${ELIBC} != *BSD ]] && sed -i -e 's:^#\(DLLIB= -ldl\):\1:' config
+
+       use ppc-macos || sed -i -e 's:^#\(MYLDFLAGS= -Wl,-E\):\1:' config
+
+       sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
+
+       if use readline ; then
+               sed -i config \
+                       -e "s:^#\(USERCONF=-DLUA_USERCONFIG='\"\$(LUA)/etc/saconfig.c\"' -DUSE_READLINE\):\1:" \
+                       -e 's:^\(EXTRA_LIBS= -lm\)$:\1 -lreadline:'
+       fi
+
+       cat >etc/lua-5.0.pc <<EOF
+prefix=/usr
+exec_prefix=\${prefix}
+includedir=\${prefix}/include
+libdir=\${exec_prefix}/$(get_libdir)
+interpreter=\${exec_prefix}/bin/lua-5.0
+compiler=\${exec_prefix}/bin/luac-5.0
+
+Name: Lua
+Description: An extension programming language
+Version: ${PV}
+Cflags: -I\${includedir}
+Libs: -L\${libdir} -llua-5.0 -llualib-5.0 -lm $(dlopen_lib)
+EOF
+}
+
+src_compile() {
+       emake || die "emake failed"
+       if use ppc-macos; then
+               emake dylib || die "emake dylib failed"
+       else
+               emake so || die "emake so failed"
+       fi
+       mv bin/lua-5.0 test/lua.static
+       emake sobin || die "emake sobin failed"
+}
+
+src_install() {
+       if use ppc-macos; then
+               make DESTDIR="${D}" install dylibinstall || die "make install dylibinstall failed"
+       else
+               make DESTDIR="${D}" install soinstall || die "make install soinstall failed"
+       fi
+
+       dodoc HISTORY UPDATE
+       dohtml doc/*.html doc/*.gif
+
+       for i in `find . -name README -exec dirname '{}' \;`; do
+               docinto ${i#.}
+               dodoc ${i}/README
+       done
+
+       insinto /usr/share/lua-5.0
+       doins etc/compat.lua
+       insinto /usr/share/pixmaps
+       newins etc/lua.xpm lua-5.0.xpm
+       insinto /usr/$(get_libdir)/pkgconfig
+       doins etc/lua-5.0.pc
+}
+
+src_test() {
+       local positive="bisect cf echo env factorial fib fibfor hello printf sieve sort trace-calls"
+       local negative="readonly undefined"
+       local test
+
+       for test in ${positive}; do
+               test/lua.static test/${test}.lua || die "test $test failed"
+       done
+
+       for test in ${negative}; do
+               test/lua.static test/${test}.lua && die "test $test failed"
+       done
+}
diff --git a/dev-lang/lua/lua-5.1.1-r1.ebuild b/dev-lang/lua/lua-5.1.1-r1.ebuild
new file mode 100644 (file)
index 0000000..e000b87
--- /dev/null
@@ -0,0 +1,101 @@
+# Copyright 1999-2007 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-r1.ebuild,v 1.1 2007/01/13 14:28:52 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="2"
+KEYWORDS="~ppc ~ppc64 ~x86"
+IUSE="readline static"
+
+RDEPEND="readline? ( sys-libs/readline )
+               dev-lang/lua-wrapper
+               !=dev-lang/lua-5.1.1
+               !=dev-lang/lua-5.0.3
+               !=dev-lang/lua-5.0.2"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       epatch "${FILESDIR}"/${P}-Makefile.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
+
+       # Using dynamic linked lua is not recommended upstream for performance
+       # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+       # Mainly, this is of concern if your arch is poor with GPRs, like x86
+       # Note that the lua compiler is build statically anyway
+       if use static ; then
+               epatch "${FILESDIR}"/${P}-make_static.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} $(dlopen_lib)"
+       fi
+
+       # what to link to the executables
+       mylibs=
+       if use readline; then
+               mylibs="-lreadline"
+       fi
+
+       cd src
+       emake CFLAGS="${mycflags} ${CFLAGS}" \
+                       MYLDFLAGS="${LDFLAGS}" \
+                       RPATH="/usr/$(get_libdir)/" \
+                       LUA_LIBS="${mylibs}" \
+                       LIB_LIBS="${liblibs}" \
+                       V="${PV:0:3}" \
+                       gentoo_all || die "emake failed"
+
+       mv lua_test ../test/lua.static
+}
+
+src_install() {
+       emake INSTALL_TOP="${D}/usr/" V="${PV:0:3}" gentoo_install \
+       || die "emake install gentoo_install failed"
+
+       dodoc HISTORY README
+       dohtml doc/*.html doc/*.gif
+
+       insinto /usr/share/pixmaps
+       newins etc/lua.ico lua-5.1.ico
+       insinto /usr/$(get_libdir)/pkgconfig
+       newins etc/lua.pc lua-5.1.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
+               test/lua.static test/${test}.lua &> /dev/null || die "test $test failed"
+       done
+
+       for test in ${negative}; do
+               test/lua.static test/${test}.lua &> /dev/null && die "test $test failed"
+       done
+}
index b35b976369c30c053297080e9b73a8141b14d9d6..2e1ee3df1f9a3a90be480168995a53159b954569 100644 (file)
@@ -3,7 +3,7 @@
 <pkgmetadata>
 <herd>no-herd</herd>
 <maintainer>
-  <email>mabi@gentoo.org</email>
-  <name>Matti Bickel</name>
+       <email>mabi@gentoo.org</email>
+       <name>Matti Bickel</name>
 </maintainer>
 </pkgmetadata>