summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Bickel <mabi@gentoo.org>2009-03-22 09:46:48 +0000
committerMatti Bickel <mabi@gentoo.org>2009-03-22 09:46:48 +0000
commiteeb3ab3d9c9c0692bb00f6a2b000d9694d2f7bf7 (patch)
tree712fdf9fb90223019632dbbe16928ea56c912853 /dev-lang
parentRemove GRUB device ID translation code (bug #260547). (diff)
downloadgentoo-2-eeb3ab3d9c9c0692bb00f6a2b000d9694d2f7bf7.tar.gz
gentoo-2-eeb3ab3d9c9c0692bb00f6a2b000d9694d2f7bf7.tar.bz2
gentoo-2-eeb3ab3d9c9c0692bb00f6a2b000d9694d2f7bf7.zip
fix bug #260008 (new makefile!)
(Portage version: 2.1.6.9/cvs/Linux ppc)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/lua/ChangeLog6
-rw-r--r--dev-lang/lua/files/lua-5.1-make-r1.patch60
-rw-r--r--dev-lang/lua/files/lua-5.1-make_static-r1.patch12
-rw-r--r--dev-lang/lua/lua-5.1.4-r1.ebuild112
4 files changed, 189 insertions, 1 deletions
diff --git a/dev-lang/lua/ChangeLog b/dev-lang/lua/ChangeLog
index 3d58318f9adf..3f77aee55849 100644
--- a/dev-lang/lua/ChangeLog
+++ b/dev-lang/lua/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-lang/lua
# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.122 2009/03/21 12:42:02 mabi Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.123 2009/03/22 09:46:47 mabi Exp $
+
+ 22 Mar 2009; Matti Bickel <mabi@gentoo.org> +files/lua-5.1-make-r1.patch,
+ +files/lua-5.1-make_static-r1.patch, +lua-5.1.4-r1.ebuild:
+ fix bug #260008 (new makefile!)
21 Mar 2009; Matti Bickel <mabi@gentoo.org> files/lua-5.1-make.patch,
lua-5.1.4.ebuild:
diff --git a/dev-lang/lua/files/lua-5.1-make-r1.patch b/dev-lang/lua/files/lua-5.1-make-r1.patch
new file mode 100644
index 000000000000..b50620099564
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1-make-r1.patch
@@ -0,0 +1,60 @@
+--- lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200
++++ lua-5.1.1/Makefile 2006-11-16 02:16:53.000000000 +0100
+@@ -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
++ test/lua.static test/hello.lua
++
++gentoo_install:
++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua luac $(INSTALL_BIN)
++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB)
+--- lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100
++++ lua-5.1.1/src/Makefile 2006-11-16 02:10:27.000000000 +0100
+@@ -176,3 +176,33 @@
+ 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.
++
++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_OBJS)
++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O::.o=.lo) $(LUA_LIBS) -llua
++
++lua_test: $(LUA_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
++
++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
++
++gentoo_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua luac
++
++gentoo_all: $(LIB_NAME) $(LIB_NAME:.la=.a) $(LUA_T) lua_test $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.1-make_static-r1.patch b/dev-lang/lua/files/lua-5.1-make_static-r1.patch
new file mode 100644
index 000000000000..2d3d1d31d6c4
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.1-make_static-r1.patch
@@ -0,0 +1,12 @@
+diff -ru lua-5.1.1.orig/src/Makefile lua-5.1.1/src/Makefile
+--- lua-5.1.1.orig/src/Makefile 2006-11-21 07:19:31 +0000
++++ lua-5.1.1/src/Makefile 2006-11-21 07:19:52 +0000
+@@ -196,7 +196,7 @@
+ -rpath $(RPATH) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
+
+ $(LUA_T): $(LUA_O) $(LIB_NAME)
+- $(LIBTOOL) --mode=link $(CC) -export-dynamic -o $@ $(LUA_O:.o=.lo) $(LUA_LIBS) -llua
++ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
+
+ $(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
+ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
diff --git a/dev-lang/lua/lua-5.1.4-r1.ebuild b/dev-lang/lua/lua-5.1.4-r1.ebuild
new file mode 100644
index 000000000000..ba0e5854a793
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.4-r1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/lua-5.1.4-r1.ebuild,v 1.3 2009/03/22 09:46:48 mabi Exp $
+
+EAPI="1"
+
+inherit eutils portability versionator toolchain-funcs
+
+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="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="+deprecated emacs readline static"
+
+DEPEND="readline? ( sys-libs/readline )"
+
+src_unpack() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-module_paths.patch
+
+ # EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:4:1/' src/Makefile
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
+
+ if ! use deprecated ; then
+ epatch "${FILESDIR}"/${P}-deprecated.patch
+ epatch "${FILESDIR}"/${P}-test.patch
+ fi
+
+ if ! use readline ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-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
+ # Not that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make_static-r1.patch
+ fi
+
+ # We want packages to find our things...
+ sed -i -e 's:/usr/local:/usr:' etc/lua.pc
+}
+
+src_compile() {
+ tc-export CC
+ myflags=
+ # what to link to liblua
+ liblibs="-lm"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ if use readline; then
+ mylibs="-lreadline"
+ fi
+
+ cd src
+ emake CC="${CC}" CFLAGS="-DLUA_USE_LINUX ${CFLAGS}" \
+ RPATH="${ROOT}/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=${PV} \
+ gentoo_all || die "emake failed"
+
+ mv lua_test ../test/lua.static
+}
+
+src_install() {
+ emake INSTALL_TOP="${D}/usr/" INSTALL_LIB="${D}/usr/$(get_libdir)/" \
+ 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
+
+ doman doc/lua.1 doc/luac.1
+}
+
+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 || die "test $test failed"
+ done
+
+ for test in ${negative}; do
+ test/lua.static test/${test}.lua && die "test $test failed"
+ done
+}