aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua5.3
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-04-01 19:24:39 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-04-01 19:24:39 +0000
commitc3417b96b30d2bf77cccf960a13d4e920c1dba15 (patch)
tree6957462b7b276b1fe8607bfa2b457e002232b6ae /main/lua5.3
parent99241c94dbde19b1764a1a86a8f23a1058560d88 (diff)
downloadaports-c3417b96b30d2bf77cccf960a13d4e920c1dba15.tar.bz2
aports-c3417b96b30d2bf77cccf960a13d4e920c1dba15.tar.xz
main/lua5.3: move to main
Diffstat (limited to 'main/lua5.3')
-rw-r--r--main/lua5.3/APKBUILD144
-rw-r--r--main/lua5.3/lua-5.3-make.patch74
-rw-r--r--main/lua5.3/lua-5.3-module_paths.patch27
3 files changed, 245 insertions, 0 deletions
diff --git a/main/lua5.3/APKBUILD b/main/lua5.3/APKBUILD
new file mode 100644
index 0000000000..153aab6e5c
--- /dev/null
+++ b/main/lua5.3/APKBUILD
@@ -0,0 +1,144 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=lua5.3
+pkgver=5.3.0
+_luaver=${pkgname#lua}
+pkgrel=1
+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.3-make.patch
+ lua-5.3-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 \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ || return 1
+ 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 \
+ "$pkgdir"/usr/lib/$pkgname/*.a \
+ || 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
+
+}
+
+dev() {
+ default_dev
+ mkdir -p "$subpkgdir"/usr/$pkgname
+ ln -s ../include/$pkgname "$subpkgdir"/usr/$pkgname/include || return 1
+ ln -s ../lib/$pkgname "$subpkgdir"/usr/$pkgname/lib || return 1
+}
+
+libs() {
+ pkgdesc="Lua dynamic library runtime"
+ replaces="lua"
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
+}
+
+md5sums="a1b0a7e92d0c85bbff7a8d27bf29f8af lua-5.3.0.tar.gz
+67acac7d9e37da67806f6a08c8100599 lua-5.3-make.patch
+eefd0de61b6993c62a880dc218c9abd6 lua-5.3-module_paths.patch"
+sha256sums="ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01 lua-5.3.0.tar.gz
+64eafd1d2945623fe807384f9967f94d485b4b9b620ed977b3faca80548444ce lua-5.3-make.patch
+d2e2d96d3b10e72dda2c78cb7f478d655c730195d46ab466c961a7846793c644 lua-5.3-module_paths.patch"
+sha512sums="2b423e70c4c992a08d28ef12f1d0b078f2ee7043cda302d93e9d59ff6ab79152bb4971455d37666a98cf5cfe3cafd3d16e30b33a11fd585743d5d817424a2d51 lua-5.3.0.tar.gz
+1bc6c623024c1738155b30ff9c0edcce0f336edc25aa20c3a1400c859421ea2015d75175cce8d515e055ac3e96028426b74812e04022af18a0ed4c4601556027 lua-5.3-make.patch
+313ff823ed871f380a2cb0ba1f0afbba5cfa9b98da40e6e5e8f3c7a2e5993b13c2577efbe7147b79e3903ff27d5a814fa782c1c925092b08510cb4ce02abf464 lua-5.3-module_paths.patch"
diff --git a/main/lua5.3/lua-5.3-make.patch b/main/lua5.3/lua-5.3-make.patch
new file mode 100644
index 0000000000..3492186072
--- /dev/null
+++ b/main/lua5.3/lua-5.3-make.patch
@@ -0,0 +1,74 @@
+diff --git a/Makefile b/Makefile
+index 7fa91c8..c85ede2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -112,3 +112,18 @@ pc:
+ .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
+
+ # (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)
+diff --git a/src/Makefile b/src/Makefile
+index 2e7a412..a72f342 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -59,10 +59,10 @@ $(LUA_A): $(BASE_O)
+ $(AR) $@ $(BASE_O)
+ $(RANLIB) $@
+
+-$(LUA_T): $(LUA_O) $(LUA_A)
++origin$(LUA_T): $(LUA_O) $(LUA_A)
+ $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++origin$(LUAC_T): $(LUAC_O) $(LUA_A)
+ $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+
+ clean:
+@@ -194,4 +194,33 @@ lvm.o: lvm.c lprefix.h lua.h luaconf.h ldebug.h lstate.h lobject.h \
+ lzio.o: lzio.c lprefix.h 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 $(V) \
++ -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)
+ # (end of Makefile)
diff --git a/main/lua5.3/lua-5.3-module_paths.patch b/main/lua5.3/lua-5.3-module_paths.patch
new file mode 100644
index 0000000000..4015fcfa28
--- /dev/null
+++ b/main/lua5.3/lua-5.3-module_paths.patch
@@ -0,0 +1,27 @@
+diff --git a/src/luaconf.h b/src/luaconf.h
+index fd28d21..4c65295 100644
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -178,12 +178,21 @@
+ #define LUA_ROOT "/usr/local/"
+ #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
++
++#define LUA_VENDOR_ROOT "/usr/"
++#define LUA_VENDOR_LDIR LUA_VENDOR_ROOT "share/lua/" LUA_VDIR "/"
++#define LUA_VENDOR_CDIR LUA_VENDOR_ROOT "lib/lua/" LUA_VDIR "/"
++
+ #define LUA_PATH_DEFAULT \
+ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
+ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
++ LUA_VENDOR_LDIR"?.lua;" LUA_VENDOR_LDIR"?/init.lua;" \
++ LUA_VENDOR_CDIR"?.lua;" LUA_VENDOR_CDIR"?/init.lua;" \
+ "./?.lua;" "./?/init.lua"
+ #define LUA_CPATH_DEFAULT \
+- LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
++ LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" \
++ LUA_VENDOR_CDIR"?.so;" LUA_VENDOR_CDIR"loadall.so;" \
++ "./?.so"
+ #endif /* } */
+
+