summaryrefslogtreecommitdiffstats
path: root/main/lua5.2
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-06-24 15:45:34 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-06-24 15:45:34 +0000
commitd641c9d06b687b2a89f160ad4020ab4c2f663a66 (patch)
tree5c792339e183e10557422287794edfaf4deeb119 /main/lua5.2
parent8078227b5a0d8243d98a3d61a92584f603283480 (diff)
downloadaports-d641c9d06b687b2a89f160ad4020ab4c2f663a66.tar.bz2
aports-d641c9d06b687b2a89f160ad4020ab4c2f663a66.tar.xz
main/lua5.2: moved from testing
Diffstat (limited to 'main/lua5.2')
-rw-r--r--main/lua5.2/APKBUILD131
-rw-r--r--main/lua5.2/lua-5.2-make.patch60
-rw-r--r--main/lua5.2/lua-5.2-module_paths.patch26
3 files changed, 217 insertions, 0 deletions
diff --git a/main/lua5.2/APKBUILD b/main/lua5.2/APKBUILD
new file mode 100644
index 000000000..4f4af2e5e
--- /dev/null
+++ b/main/lua5.2/APKBUILD
@@ -0,0 +1,131 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lua5.2
+pkgver=5.2.2
+_luaver=${pkgname#lua}
+pkgrel=0
+pkgdesc="Powerful light-weight programming language"
+url="http://www.lua.org/"
+arch="all"
+license="MIT"
+depends=
+ldpath="/usr/lib/$pkgname"
+makedepends="libtool autoconf automake"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
+source="http://www.lua.org/ftp/lua-$pkgver.tar.gz
+ lua-5.2-make.patch
+ lua-5.2-module_paths.patch
+ "
+
+_builddir="$srcdir"/lua-$pkgver
+prepare() {
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ patch*|*.patch)
+ msg "Applying $i"
+ patch -p1 -i "$srcdir"/$i || return 1
+ ;;
+ esac
+ done
+
+ # disable readline
+ sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h
+
+ # we use libtool
+ cat >configure.ac <<EOF
+top_buildir=.
+
+AC_INIT(src/luaconf.h)
+AC_PROG_LIBTOOL
+AC_OUTPUT()
+EOF
+ libtoolize --force --install && aclocal && autoconf
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr
+ cd src
+ make V=$pkgver \
+ CFLAGS=" -DLUA_USE_LINUX -DLUA_COMPAT_ALL" \
+ SYSLDFLAGS="$LDFLAGS" \
+ RPATH="/usr/lib" \
+ LIB_LIBS="-lpthread -lm -ldl" \
+ alpine_all || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make V=$pkgver \
+ INSTALL_TOP="$pkgdir"/usr \
+ INSTALL_INC="$pkgdir"/usr/include/$pkgname \
+ INSTALL_LIB="$pkgdir"/usr/lib/$pkgname \
+ alpine_install || return 1
+ rm "$pkgdir"/usr/lib/$pkgname/*.la || return 1
+
+ for i in "$pkgdir"/usr/bin/* ; do
+ mv $i ${i}${_luaver} || return 1
+ done
+
+ for i in "$pkgdir"/usr/lib/$pkgname/*.so.*; do
+ ln -s $pkgname/${i##*/} "$pkgdir"/usr/lib/${i##*/} || return 1
+ done
+
+ install -D -m 644 doc/lua.1 "$pkgdir"/usr/share/man/man1/lua$_luaver.1 \
+ && install -D -m 644 doc/luac.1 \
+ "$pkgdir"/usr/share/man/man1/luac$_luaver.1 \
+ || return 1
+
+ install -d "$pkgdir"/usr/lib/pkgconfig
+ cat > "$pkgdir"/usr/lib/pkgconfig/lua$_luaver.pc <<EOF
+# lua.pc -- pkg-config data for Lua
+
+# vars from install Makefile
+
+# grep '^V=' ../Makefile
+V= ${_luaver}
+# grep '^R=' ../Makefile
+R= ${pkgver}
+
+# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+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}
+
+# canonical vars
+exec_prefix=\${prefix}
+libdir=\${exec_prefix}/lib/$pkgname
+includedir=\${prefix}/include/$pkgname
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: \${R}
+Requires:
+Libs: -L\${libdir} -llua -lm
+Cflags: -I\${includedir}
+
+# (end of lua$_luaver.pc)
+EOF
+
+}
+
+libs() {
+ pkgdesc="Lua dynamic library runtime"
+ replaces="lua"
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
+}
+
+md5sums="efbb645e897eae37cad4344ce8b0a614 lua-5.2.2.tar.gz
+04df4ba7df30c617bd101aba3541c06d lua-5.2-make.patch
+c34dc7623ff3c8b9ec9dab6499c841e2 lua-5.2-module_paths.patch"
+sha256sums="3fd67de3f5ed133bf312906082fa524545c6b9e1b952e8215ffbd27113f49f00 lua-5.2.2.tar.gz
+eef3724469c62627722435b4cf30db4ebb1230e5512da11d9b9431a29b02955a lua-5.2-make.patch
+790802a33b2200064e92abfdd0faae560a2af903ae78e5b79661f4b8e19d2bb7 lua-5.2-module_paths.patch"
+sha512sums="7165c7c5cb5606abc6306338fac425604c2d432c9f1c6cef35d0cc353ebd4eb7e6ed7781d58fb1fedc4b9ac43f64055f57506d9b71d999278af9408c1f34f664 lua-5.2.2.tar.gz
+f1d5e0a1db0790fae82dd6de5742631c6c4ca009752630a612d864746990a00c8f2eacc7dbf07be2bce94d04da4ad185ed10dc317d7bf093df698bf84fea682e lua-5.2-make.patch
+062eb61132a60c10358590db30e8f5698ceb088b94bdcff840423c70c7bcdac4fe96c3ad35a068b795953f25712f28a4e0efd7a7bb29a0360285bf2c8bf7c416 lua-5.2-module_paths.patch"
diff --git a/main/lua5.2/lua-5.2-make.patch b/main/lua5.2/lua-5.2-make.patch
new file mode 100644
index 000000000..e46a226c9
--- /dev/null
+++ b/main/lua5.2/lua-5.2-make.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,18 @@
+ .PHONY: all $(PLATS) clean 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
++
++alpine_clean:
++ cd src; $(MAKE) $@
++
++alpine_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
+@@ -54,1 +54,1 @@
+-$(LUA_T): $(LUA_O) $(LUA_A)
++origin$(LUA_T): $(LUA_O) $(LUA_A)
+@@ -57,1 +57,1 @@
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
+@@ -185,3 +185,30 @@
+ lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
+ lzio.h
+
++
++export LIBTOOL = ../libtool --quiet --tag=CC
++export LIB_VERSION = 0:0:0
++
++# 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) -release 5.2 \
++ -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) $(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)
++
++alpine_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua luac
++
++alpine_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/main/lua5.2/lua-5.2-module_paths.patch b/main/lua5.2/lua-5.2-module_paths.patch
new file mode 100644
index 000000000..3d0b3c21b
--- /dev/null
+++ b/main/lua5.2/lua-5.2-module_paths.patch
@@ -0,0 +1,26 @@
+diff --git a/src/luaconf.h b/src/luaconf.h
+index df802c9..f8f64e0 100644
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -101,13 +101,19 @@
+
+ #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
+ #define LUA_ROOT "/usr/local/"
++#define LUA_ROOT2 "/usr/"
+ #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
++#define LUA_LDIR2 LUA_ROOT2 "share/lua/" LUA_VDIR
+ #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
++#define LUA_CDIR2 LUA_ROOT2 "lib/lua/" LUA_VDIR
+ #define LUA_PATH_DEFAULT \
+ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
+- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" "./?.lua"
++ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua;" \
++ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" "./?.lua;" \
++ LUA_CDIR2"?.lua;" LUA_CDIR2"?/init.lua;" "./?.lua"
+ #define LUA_CPATH_DEFAULT \
+- LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
++ LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" \
++ LUA_CDIR2"?.so;" LUA_CDIR2"loadall.so;" "./?.so"
+ #endif /* } */
+
+