diff options
author | ryoon <ryoon@pkgsrc.org> | 2013-09-14 09:06:48 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2013-09-14 09:06:48 +0000 |
commit | c66d4f2d576f03ca84dc0552cab78119e09547db (patch) | |
tree | 3a34f7b2f02e8338d518ff832d32c0e9c7b98e94 /devel/lua-posix | |
parent | d3d83d61b82dfc19f8449a0ce83616375a7738b8 (diff) | |
download | pkgsrc-c66d4f2d576f03ca84dc0552cab78119e09547db.tar.gz |
Import lua-posix-31 as devel/lua-posix from pkgsrc/wip/luaposix.
A POSIX library (including curses) for lua.
Diffstat (limited to 'devel/lua-posix')
-rw-r--r-- | devel/lua-posix/DESCR | 1 | ||||
-rw-r--r-- | devel/lua-posix/Makefile | 31 | ||||
-rw-r--r-- | devel/lua-posix/PLIST | 11 | ||||
-rw-r--r-- | devel/lua-posix/distinfo | 9 | ||||
-rw-r--r-- | devel/lua-posix/patches/patch-config.h.in | 14 | ||||
-rw-r--r-- | devel/lua-posix/patches/patch-configure | 95 | ||||
-rw-r--r-- | devel/lua-posix/patches/patch-configure.ac | 19 | ||||
-rw-r--r-- | devel/lua-posix/patches/patch-ext_curses_curses.c | 27 | ||||
-rw-r--r-- | devel/lua-posix/patches/patch-ext_posix_posix.c | 43 |
9 files changed, 250 insertions, 0 deletions
diff --git a/devel/lua-posix/DESCR b/devel/lua-posix/DESCR new file mode 100644 index 00000000000..b671e772597 --- /dev/null +++ b/devel/lua-posix/DESCR @@ -0,0 +1 @@ +A POSIX library (including curses) for lua. diff --git a/devel/lua-posix/Makefile b/devel/lua-posix/Makefile new file mode 100644 index 00000000000..33332e910b9 --- /dev/null +++ b/devel/lua-posix/Makefile @@ -0,0 +1,31 @@ +# $NetBSD: Makefile,v 1.1 2013/09/14 09:06:48 ryoon Exp $ +# + +DISTNAME= luaposix-release-v31 +PKGNAME= ${DISTNAME:S/lua/${LUA_PKGPREFIX}-/:S/release-v//} +CATEGORIES= devel +MASTER_SITES= -https://github.com/luaposix/luaposix/archive/release-v31.tar.gz + +MAINTAINER= ryoon@NetBSD.org +HOMEPAGE= https://github.com/luaposix/luaposix +COMMENT= POSIX library (including curses) for lua +LICENSE= mit + +FETCH_USING= curl + +GNU_CONFIGURE= yes +USE_TOOLS+= perl:build +USE_LIBTOOL= yes + +CONFIGURE_ARGS+= --libdir=${PREFIX}/${LUA_CDIR} +CONFIGURE_ARGS+= --docdir=${PREFIX}/share/doc/${PKGNAME_NOREV} +CONFIGURE_ARGS+= --datadir=${PREFIX}/share/${PKGNAME_NOREV} + +post-install: + cd ${DESTDIR}${PREFIX}/${LUA_CDIR} && \ + ${LN} -fs ../../../share/${PKGNAME}/posix.lua && \ + ${LN} -fs ../../../share/${PKGNAME}/curses.lua + +.include "../../lang/lua/module.mk" +.include "../../mk/curses.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/devel/lua-posix/PLIST b/devel/lua-posix/PLIST new file mode 100644 index 00000000000..d9ed079bd05 --- /dev/null +++ b/devel/lua-posix/PLIST @@ -0,0 +1,11 @@ +@comment $NetBSD: PLIST,v 1.1 2013/09/14 09:06:48 ryoon Exp $ +lib/lua/5.2/curses.lua +lib/lua/5.2/curses_c.la +lib/lua/5.2/posix.lua +lib/lua/5.2/posix_c.la +share/doc/${PKGNAME}/curses.html +share/doc/${PKGNAME}/curses_c.html +share/doc/${PKGNAME}/index.html +share/doc/${PKGNAME}/ldoc.css +share/${PKGNAME}/curses.lua +share/${PKGNAME}/posix.lua diff --git a/devel/lua-posix/distinfo b/devel/lua-posix/distinfo new file mode 100644 index 00000000000..07e663017a9 --- /dev/null +++ b/devel/lua-posix/distinfo @@ -0,0 +1,9 @@ +$NetBSD: distinfo,v 1.1 2013/09/14 09:06:48 ryoon Exp $ + +SHA1 (luaposix-release-v31.tar.gz) = 8cce36b34f7b1742b14e989f26f021e14053a6dd +RMD160 (luaposix-release-v31.tar.gz) = 4a3f893f34a96570627a3840ac99a8088e230b82 +Size (luaposix-release-v31.tar.gz) = 528979 bytes +SHA1 (patch-config.h.in) = 37315685228cddfd6972c2d65684fdcfcf7407eb +SHA1 (patch-configure) = 82e396c05fc2973181eb49b68ebdc0caf2c36d74 +SHA1 (patch-ext_curses_curses.c) = fd06c59d4d4f8f69eed4233a995841496e786d32 +SHA1 (patch-ext_posix_posix.c) = f2ec88b0be842af327c13c0898de1bfe0d165477 diff --git a/devel/lua-posix/patches/patch-config.h.in b/devel/lua-posix/patches/patch-config.h.in new file mode 100644 index 00000000000..14f8bedd9ec --- /dev/null +++ b/devel/lua-posix/patches/patch-config.h.in @@ -0,0 +1,14 @@ +$NetBSD: patch-config.h.in,v 1.1 2013/09/14 09:06:48 ryoon Exp $ + +--- config.h.in.orig 2013-09-09 07:15:14.000000000 +0000 ++++ config.h.in +@@ -66,6 +66,9 @@ + /* Define to 1 if you have the `statvfs' function. */ + #undef HAVE_STATVFS + ++/* Define to 1 if you have the `mkdtemp' function. */ ++#undef HAVE_MKDTEMP ++ + /* Define to 1 if you have the <stdint.h> header file. */ + #undef HAVE_STDINT_H + diff --git a/devel/lua-posix/patches/patch-configure b/devel/lua-posix/patches/patch-configure new file mode 100644 index 00000000000..b2e649596d1 --- /dev/null +++ b/devel/lua-posix/patches/patch-configure @@ -0,0 +1,95 @@ +$NetBSD: patch-configure,v 1.1 2013/09/14 09:06:48 ryoon Exp $ + +--- configure.orig 2013-09-09 07:15:14.000000000 +0000 ++++ configure +@@ -1899,6 +1899,52 @@ $as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + + } # ac_fn_c_check_func ++ ++# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES ++# --------------------------------------------- ++# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR ++# accordingly. ++ac_fn_c_check_decl () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ as_decl_name=`echo $2|sed 's/ *(.*//'` ++ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 ++$as_echo_n "checking whether $as_decl_name is declared... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++int ++main () ++{ ++#ifndef $as_decl_name ++#ifdef __cplusplus ++ (void) $as_decl_use; ++#else ++ (void) $as_decl_name; ++#endif ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_decl + cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. +@@ -12865,7 +12911,7 @@ $as_echo "#define HAVE_CRYPT /**/" >>con + fi + + +-for ac_func in strlcpy statvfs ++for ac_func in strlcpy statvfs, mkdtemp + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +@@ -12878,6 +12924,28 @@ fi + done + + ++ac_fn_c_check_decl "$LINENO" "AI_V4MAPPED" "ac_cv_have_decl_AI_V4MAPPED" "$ac_includes_default" ++if test "x$ac_cv_have_decl_AI_V4MAPPED" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_AI_V4MAPPED $ac_have_decl ++_ACEOF ++ac_fn_c_check_decl "$LINENO" "AI_ALL" "ac_cv_have_decl_AI_ALL" "$ac_includes_default" ++if test "x$ac_cv_have_decl_AI_ALL" = xyes; then : ++ ac_have_decl=1 ++else ++ ac_have_decl=0 ++fi ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_DECL_AI_ALL $ac_have_decl ++_ACEOF ++ ++ + if test Darwin != `uname`; then + # FIXME: Make -lrt conditional on _XOPEN_REALTIME + POSIX_EXTRA_CFLAGS=-D_XOPEN_SOURCE=700 diff --git a/devel/lua-posix/patches/patch-configure.ac b/devel/lua-posix/patches/patch-configure.ac new file mode 100644 index 00000000000..592d2f7817e --- /dev/null +++ b/devel/lua-posix/patches/patch-configure.ac @@ -0,0 +1,19 @@ +$NetBSD: patch-configure.ac,v 1.1 2013/09/14 09:06:48 ryoon Exp $ + +* NetBSD does not support AI_V4MAPPED and AI_ALL. +* Do not include this patch to distinfo, make are confused (should be fixed). + +--- configure.ac.orig 2013-09-09 07:15:14.000000000 +0000 ++++ configure.ac +@@ -87,7 +87,10 @@ AC_SEARCH_LIBS([crypt], [crypt], + [AC_DEFINE([HAVE_CRYPT], [], [Define this if your system has a crypt() function])]) + + dnl Check for functions +-AC_CHECK_FUNCS([strlcpy statvfs]) ++AC_CHECK_FUNCS([strlcpy statvfs, mkdtemp]) ++ ++dnl Check for definitions ++AC_CHECK_DECLS([AI_V4MAPPED, AI_ALL]) + + dnl Compiler flags for POSIX + dnl Get this from autotools/gnulib diff --git a/devel/lua-posix/patches/patch-ext_curses_curses.c b/devel/lua-posix/patches/patch-ext_curses_curses.c new file mode 100644 index 00000000000..487037ab430 --- /dev/null +++ b/devel/lua-posix/patches/patch-ext_curses_curses.c @@ -0,0 +1,27 @@ +$NetBSD: patch-ext_curses_curses.c,v 1.1 2013/09/14 09:06:48 ryoon Exp $ + +--- ext/curses/curses.c.orig 2013-09-09 07:15:14.000000000 +0000 ++++ ext/curses/curses.c +@@ -76,6 +76,10 @@ static const char *RIPOFF_TABLE = + + #define B(v) ((((int) (v)) == OK)) + ++#ifndef true ++#define true 1 ++#endif ++ + /* ======================================================= */ + + #define LC_NUMBER(v) \ +@@ -452,7 +456,10 @@ static void register_curses_constants(lu + CC(KEY_MOVE) CC(KEY_NEXT) CC(KEY_OPEN) + CC(KEY_OPTIONS) CC(KEY_PREVIOUS) CC(KEY_REDO) + CC(KEY_REFERENCE) CC(KEY_REFRESH) CC(KEY_REPLACE) +- CC(KEY_RESIZE) CC(KEY_RESTART) CC(KEY_RESUME) ++#if defined(HAVE_DECL_KEY_RESIZE) ++ CC(KEY_RESIZE) ++#endif ++ CC(KEY_RESTART) CC(KEY_RESUME) + CC(KEY_SAVE) CC(KEY_SBEG) CC(KEY_SCANCEL) + CC(KEY_SCOMMAND) CC(KEY_SCOPY) CC(KEY_SCREATE) + CC(KEY_SDC) CC(KEY_SDL) CC(KEY_SELECT) diff --git a/devel/lua-posix/patches/patch-ext_posix_posix.c b/devel/lua-posix/patches/patch-ext_posix_posix.c new file mode 100644 index 00000000000..1a4b142d2bf --- /dev/null +++ b/devel/lua-posix/patches/patch-ext_posix_posix.c @@ -0,0 +1,43 @@ +$NetBSD: patch-ext_posix_posix.c,v 1.1 2013/09/14 09:06:48 ryoon Exp $ + +--- ext/posix/posix.c.orig 2013-09-09 07:15:14.000000000 +0000 ++++ ext/posix/posix.c +@@ -907,6 +907,7 @@ Create a unique temporary directory. + @return path on success, nil otherwise + @return error message if failed + */ ++#if defined(HAVE_MKDTEMP) + static int Pmkdtemp(lua_State *L) + { + const char *path = luaL_checkstring(L, 1); +@@ -925,6 +926,7 @@ static int Pmkdtemp(lua_State *L) + lalloc(ud, tmppath, path_len, 0); + return (res == NULL) ? pusherror(L, path) : 1; + } ++#endif + + static int runexec(lua_State *L, int use_shell) + { +@@ -3807,7 +3809,9 @@ static const luaL_Reg R[] = + MENTRY( Pmkdir ), + MENTRY( Pmkfifo ), + MENTRY( Pmkstemp ), ++#if defined(HAVE_MKDTEMP) + MENTRY( Pmkdtemp ), ++#endif + MENTRY( Pmktime ), + MENTRY( Pnice ), + MENTRY( Popen ), +@@ -4694,8 +4698,12 @@ LUALIB_API int luaopen_posix_c (lua_Stat + MENTRY( AI_PASSIVE ); + MENTRY( AI_CANONNAME ); + MENTRY( AI_NUMERICHOST ); ++#if defined(HAVE_DECL_AI_V4MAPPED) + MENTRY( AI_V4MAPPED ); ++#endif ++#if defined(HAVE_DECL_AI_ALL) + MENTRY( AI_ALL ); ++#endif + MENTRY( AI_ADDRCONFIG ); + + MENTRY( IPV6_JOIN_GROUP ); |