Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang lang: Add lua54.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/95d63f588f0b
branches:  trunk
changeset: 435074:95d63f588f0b
user:      nia <nia%pkgsrc.org@localhost>
date:      Tue Jun 30 13:16:14 2020 +0000

description:
lang: Add lua54.

Note: this is slightly different than other Lua packages and, among
other things, implements its own install target. This is becuase I
wanted to minimize the amount of patching to Makefiles to make it
fit into the pkgsrc world.

Lua is a powerful, fast, lightweight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description
constructs based on associative arrays and extensible semantics. Lua is
dynamically typed, runs by interpreting bytecode for a register-based
virtual machine, and has automatic memory management with incremental
garbage collection, making it ideal for configuration, scripting, and
rapid prototyping.

This version is a preferred choice for new Lua modules.

diffstat:

 lang/Makefile                         |   3 +-
 lang/lua54/ALTERNATIVES               |   2 +
 lang/lua54/DESCR                      |  10 +++
 lang/lua54/Makefile                   |  94 +++++++++++++++++++++++++++++++++++
 lang/lua54/PLIST                      |  20 +++++++
 lang/lua54/buildlink3.mk              |  22 ++++++++
 lang/lua54/distinfo                   |   7 ++
 lang/lua54/files/lua.pc.in            |  21 +++++++
 lang/lua54/patches/patch-src_Makefile |  88 ++++++++++++++++++++++++++++++++
 lang/lua54/version.mk                 |   6 ++
 10 files changed, 272 insertions(+), 1 deletions(-)

diffs (truncated from 323 to 300 lines):

diff -r c5e02bb5b8ab -r 95d63f588f0b lang/Makefile
--- a/lang/Makefile     Tue Jun 30 13:03:45 2020 +0000
+++ b/lang/Makefile     Tue Jun 30 13:16:14 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.567 2020/05/21 15:53:30 taca Exp $
+# $NetBSD: Makefile,v 1.568 2020/06/30 13:16:14 nia Exp $
 #
 
 COMMENT=       Programming languages
@@ -150,6 +150,7 @@
 SUBDIR+=       lua51
 SUBDIR+=       lua52
 SUBDIR+=       lua53
+SUBDIR+=       lua54
 SUBDIR+=       lush
 SUBDIR+=       maude
 SUBDIR+=       mawk
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/ALTERNATIVES
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/ALTERNATIVES   Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,2 @@
+bin/lua @PREFIX@/bin/lua5.4
+bin/luac @PREFIX@/bin/luac5.4
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/DESCR  Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,10 @@
+Lua is a powerful, fast, lightweight, embeddable scripting language.
+
+Lua combines simple procedural syntax with powerful data description
+constructs based on associative arrays and extensible semantics. Lua is
+dynamically typed, runs by interpreting bytecode for a register-based
+virtual machine, and has automatic memory management with incremental
+garbage collection, making it ideal for configuration, scripting, and
+rapid prototyping.
+
+This version is a preferred choice for new Lua modules.
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/Makefile       Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,94 @@
+# $NetBSD: Makefile,v 1.1 2020/06/30 13:16:14 nia Exp $
+
+DISTNAME=      lua-${LUA_VERSION}
+PKGNAME=       lua54-${LUA_VERSION}
+CATEGORIES=    lang
+MASTER_SITES=  https://www.lua.org/ftp/
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://www.lua.org/
+COMMENT=       Powerful light-weight language for extending applications
+LICENSE=       mit
+
+.include "../../lang/lua54/version.mk"
+
+CONFLICTS+=    lua-[0-9]*
+
+USE_TOOLS+=    gmake
+USE_LIBTOOL=   yes
+
+.include "../../mk/bsd.prefs.mk"
+
+MAKE_FLAGS+=   MYCFLAGS="-DLUA_USE_READLINE"
+MAKE_FLAGS+=   INSTALL_TOP=${PREFIX}
+MAKE_FLAGS+=   INSTALL_INC=${PREFIX}/include/lua-5.4
+MAKE_FLAGS+=   INSTALL_MAN=${PREFIX}/${PKGMANDIR}/man1
+
+# Address pkg/47587 lua not linked to pthread causes issues with modules
+PTHREAD_OPTS+=         native
+
+.include "../../mk/pthread.buildlink3.mk"
+
+.if defined(PTHREAD_TYPE) && ${PTHREAD_TYPE} == "native"
+CFLAGS+=       -pthread
+LDFLAGS+=      -pthread
+.endif
+
+.if !empty(OPSYS:M*BSD*) || ${OPSYS} == "DragonFly"
+BUILD_TARGET=  bsd
+.elif ${OPSYS} == "Linux"
+BUILD_TARGET=  linux-noreadline
+.elif ${OPSYS} == "Darwin"
+BUILD_TARGET=  macosx
+.elif ${OPSYS} == "SunOS"
+BUILD_TARGET=  solaris
+.elif ${OPSYS} == "AIX"
+BUILD_TARGET=  aix
+.else
+BUILD_TARGET=  posix
+.endif
+
+DOCDIR=                ${PREFIX}/share/doc/lua-5.4
+
+SUBST_CLASSES+=                prefix
+SUBST_STAGE.prefix=    pre-configure
+SUBST_FILES.prefix+=   src/luaconf.h
+SUBST_SED.prefix+=     -e "s,/usr/local,${PREFIX},g"
+
+PKGCONFIG_OVERRIDE=    lua.pc
+INSTALLATION_DIRS+=    bin lib include/lua-5.4
+INSTALLATION_DIRS+=    ${PKGMANDIR}/man1
+INSTALLATION_DIRS+=    lib/pkgconfig share/doc/lua-5.4
+
+pre-configure:
+       sed     -e 's,@PREFIX@,${PREFIX},g' \
+               -e 's,@VER@,${PKGVERSION_NOREV:R},g' \
+               -e 's,@REV@,${PKGVERSION_NOREV},g' \
+               ${FILESDIR}/lua.pc.in > ${WRKSRC}/lua.pc
+       cp ${WRKSRC}/doc/lua.1  ${WRKSRC}/doc/lua5.4.1
+       cp ${WRKSRC}/doc/luac.1 ${WRKSRC}/doc/luac5.4.1
+
+do-install:
+       ${LIBTOOL} --quiet --tag=CC --mode=install \
+           ${INSTALL_PROGRAM} ${WRKSRC}/src/lua ${DESTDIR}${PREFIX}/bin/lua5.4
+       ${LIBTOOL} --quiet --tag=CC --mode=install \
+           ${INSTALL_PROGRAM} ${WRKSRC}/src/luac ${DESTDIR}${PREFIX}/bin/luac5.4
+       ${LIBTOOL} --quiet --tag=CC --mode=install \
+           ${INSTALL_LIB} ${WRKSRC}/src/liblua5.4.la ${DESTDIR}${PREFIX}/lib
+       cd ${WRKSRC}/src && ${INSTALL_DATA} lua.h luaconf.h lualib.h lauxlib.h lua.hpp \
+           ${DESTDIR}${PREFIX}/include/lua-5.4
+       cd ${WRKSRC}/doc && ${INSTALL_MAN} lua.1 luac.1 \
+           ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+       ${INSTALL_DATA} ${WRKSRC}/doc/*.[a-z][a-z][a-z] \
+           ${WRKSRC}/doc/*.html ${DESTDIR}${DOCDIR}
+       ${INSTALL_DATA} ${WRKSRC}/lua.pc \
+           ${DESTDIR}${PREFIX}/lib/pkgconfig/lua-5.4.pc
+
+.include "../../mk/readline.buildlink3.mk"
+.if ${READLINE_TYPE} == "editline"
+MAKE_FLAGS+=   MYLIBS="-L${BUILDLINK_PREFIX.editlinereadline} -ledit"
+.else
+MAKE_FLAGS+=   MYLIBS="-L${BUILDLINK_PREFIX.editlinereadline} -lreadline"
+.endif
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/PLIST  Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,20 @@
+@comment $NetBSD: PLIST,v 1.1 2020/06/30 13:16:14 nia Exp $
+bin/lua5.4
+bin/luac5.4
+include/lua-5.4/lauxlib.h
+include/lua-5.4/lua.h
+include/lua-5.4/lua.hpp
+include/lua-5.4/luaconf.h
+include/lua-5.4/lualib.h
+lib/liblua5.4.la
+lib/pkgconfig/lua-5.4.pc
+man/man1/lua.1
+man/man1/luac.1
+share/doc/lua-5.4/contents.html
+share/doc/lua-5.4/index.css
+share/doc/lua-5.4/logo.gif
+share/doc/lua-5.4/lua.css
+share/doc/lua-5.4/manual.css
+share/doc/lua-5.4/manual.html
+share/doc/lua-5.4/osi-certified-72x60.png
+share/doc/lua-5.4/readme.html
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/buildlink3.mk  Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,22 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/06/30 13:16:14 nia Exp $
+
+BUILDLINK_TREE+=       lua54
+
+.if !defined(LUA54_BUILDLINK3_MK)
+LUA54_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.lua54+=  lua54>=5.4.0<5.4
+BUILDLINK_PKGSRCDIR.lua54?=    ../../lang/lua54
+
+.if defined(BUILDLINK_DEPMETHOD.lua)
+BUILDLINK_DEPMETHOD.lua54?=    ${BUILDLINK_DEPMETHOD.lua}
+.endif
+
+# -llua -> -llua5.4
+BUILDLINK_TRANSFORM+=          l:lua:lua5.4
+BUILDLINK_INCDIRS.lua54+=      include/lua-5.4
+
+.include "../../mk/readline.buildlink3.mk"
+.endif # LUA54_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -lua54
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/distinfo       Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2020/06/30 13:16:14 nia Exp $
+
+SHA1 (lua-5.4.0.tar.gz) = 8cdbffa8a214a23d190d7c45f38c19518ae62e89
+RMD160 (lua-5.4.0.tar.gz) = cb188956351b40f7a1420067e90d309cdcf8ea45
+SHA512 (lua-5.4.0.tar.gz) = 22aa0f9fcf953fc49c97bf50a4cee708b458e8a95447f881037b2c6ddd60e40368a807f2575671c6cd7497cedc2cf5716a8959c196445bf9a359fe7ebcd65465
+Size (lua-5.4.0.tar.gz) = 349308 bytes
+SHA1 (patch-src_Makefile) = e481eced298e45cb45276e294a9b39e3b7d52046
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/files/lua.pc.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/files/lua.pc.in        Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,21 @@
+# $NetBSD: lua.pc.in,v 1.1 2020/06/30 13:16:14 nia Exp $
+# lua.pc is not any longer distributed, but is still required by other packages.
+
+prefix= @PREFIX@
+INSTALL_BIN= ${prefix}/bin
+INSTALL_INC= ${prefix}/include
+INSTALL_LIB= ${prefix}/lib
+INSTALL_MAN= ${prefix}/man/man1
+INSTALL_LMOD= ${prefix}/share/lua/@VER@
+INSTALL_CMOD= ${prefix}/lib/lua/@VER@
+
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/lua-5.4
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: @REV@
+Requires: 
+Libs: -L${libdir} -llua5.4 -lm
+Cflags: -I${includedir}
diff -r c5e02bb5b8ab -r 95d63f588f0b lang/lua54/patches/patch-src_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/lua54/patches/patch-src_Makefile     Tue Jun 30 13:16:14 2020 +0000
@@ -0,0 +1,88 @@
+$NetBSD: patch-src_Makefile,v 1.1 2020/06/30 13:16:14 nia Exp $
+
+- Don't override CC/CFLAGS/LDFLAGS.
+- Use libtool to build shared libraries.
+
+--- src/Makefile.orig  2020-04-15 13:00:29.000000000 +0000
++++ src/Makefile
+@@ -6,9 +6,8 @@
+ # Your platform. See PLATS for possible values.
+ PLAT= guess
+ 
+-CC= gcc -std=gnu99
+-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
+-LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
++CFLAGS+= -std=gnu99 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
++LDFLAGS+= $(SYSLDFLAGS) $(MYLDFLAGS)
+ LIBS= -lm $(SYSLIBS) $(MYLIBS)
+ 
+ AR= ar rcu
+@@ -25,23 +24,20 @@ MYLDFLAGS=
+ MYLIBS=
+ MYOBJS=
+ 
+-# Special flags for compiler modules; -Os reduces code size.
+-CMCFLAGS= -Os
+-
+ # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
+ 
+ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+ 
+-LUA_A=        liblua.a
++LUA_A=        liblua5.4.la
+ CORE_O=       lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
+ LIB_O=        lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
+-BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
++BASE_O= $(CORE_O:.o=.lo) $(LIB_O:.o=.lo) $(MYOBJS:.o=.lo)
+ 
+ LUA_T=        lua
+-LUA_O=        lua.o
++LUA_O=        lua.lo
+ 
+ LUAC_T=       luac
+-LUAC_O=       luac.o
++LUAC_O=       luac.lo
+ 
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+ ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+@@ -56,15 +52,19 @@ o: $(ALL_O)
+ 
+ a:    $(ALL_A)
+ 
++.SUFFIXES: .lo
++
++.c.lo:
++      $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $<
++
+ $(LUA_A): $(BASE_O)
+-      $(AR) $@ $(BASE_O)
+-      $(RANLIB) $@
++      $(LIBTOOL) --quiet --tag=CC --mode=link $(CC) -o $@ $(LDFLAGS) $(BASE_O) -rpath $(PREFIX)/lib -version-info 5:4 $(LIBS)
+ 
+ $(LUA_T): $(LUA_O) $(LUA_A)
+-      $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++      $(LIBTOOL) --quiet --tag=CC --mode=link $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ 
+ $(LUAC_T): $(LUAC_O) $(LUA_A)
+-      $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
++      $(LIBTOOL) --quiet --tag=CC --mode=link $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ 
+ test:
+       ./lua -v
+@@ -141,16 +141,6 @@ SunOS solaris:
+ # Targets that do not create files (not all makes understand .PHONY).
+ .PHONY: all $(PLATS) help test clean default o a depend echo
+ 



Home | Main Index | Thread Index | Old Index