pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/time add time/lua-chronos



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9a3f66e3c79e
branches:  trunk
changeset: 375048:9a3f66e3c79e
user:      nia <nia%pkgsrc.org@localhost>
date:      Sun Mar 06 08:58:20 2022 +0000

description:
add time/lua-chronos

High resolution monotonic timers for Lua

diffstat:

 time/Makefile                   |   3 ++-
 time/lua-chronos/DESCR          |   1 +
 time/lua-chronos/Makefile       |  31 +++++++++++++++++++++++++++++++
 time/lua-chronos/PLIST          |   2 ++
 time/lua-chronos/distinfo       |   5 +++++
 time/lua-chronos/files/Makefile |   9 +++++++++
 time/lua-chronos/files/test.lua |   8 ++++++++
 7 files changed, 58 insertions(+), 1 deletions(-)

diffs (97 lines):

diff -r 31f1f06f5c80 -r 9a3f66e3c79e time/Makefile
--- a/time/Makefile     Sun Mar 06 08:46:18 2022 +0000
+++ b/time/Makefile     Sun Mar 06 08:58:20 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.228 2021/12/24 16:08:52 wiz Exp $
+# $NetBSD: Makefile,v 1.229 2022/03/06 08:58:20 nia Exp $
 #
 
 COMMENT=       Clocks, calendars, daily planners and other time related applications
@@ -57,6 +57,7 @@
 SUBDIR+=       libical
 SUBDIR+=       lmclock
 SUBDIR+=       logtime
+SUBDIR+=       lua-chronos
 SUBDIR+=       lua-date
 SUBDIR+=       lua-tz
 SUBDIR+=       memo
diff -r 31f1f06f5c80 -r 9a3f66e3c79e time/lua-chronos/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/lua-chronos/DESCR    Sun Mar 06 08:58:20 2022 +0000
@@ -0,0 +1,1 @@
+High resolution monotonic timers for Lua
diff -r 31f1f06f5c80 -r 9a3f66e3c79e time/lua-chronos/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/lua-chronos/Makefile Sun Mar 06 08:58:20 2022 +0000
@@ -0,0 +1,31 @@
+# $NetBSD: Makefile,v 1.1 2022/03/06 08:58:21 nia Exp $
+
+DISTNAME=      chronos-0.2.4
+PKGNAME=       ${LUA_PKGPREFIX}-${DISTNAME}
+CATEGORIES=    time lua
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=ldrumm/}
+GITHUB_PROJECT=        chronos
+GITHUB_TAG=    v0.2-4
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/ldrumm/chronos
+COMMENT=       High resolution monotonic timers for Lua
+LICENSE=       mit
+
+INSTALLATION_DIRS+=    ${LUA_CDIR}
+
+BUILD_DIRS+=           src
+
+pre-build:
+       ${CP} -f ${FILESDIR}/Makefile ${WRKSRC}/src/Makefile
+
+do-install:
+       ${INSTALL_LIB} ${WRKSRC}/src/chronos.so \
+               ${DESTDIR}${PREFIX}/${LUA_CDIR}/chronos.so
+
+do-test:
+       LUA_CPATH=${WRKSRC}/src/?.so \
+           ${LUA_INTERPRETER} ${FILESDIR}/test.lua
+
+.include "../../lang/lua/module.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 31f1f06f5c80 -r 9a3f66e3c79e time/lua-chronos/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/lua-chronos/PLIST    Sun Mar 06 08:58:20 2022 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2022/03/06 08:58:21 nia Exp $
+${LUA_CDIR}/chronos.so
diff -r 31f1f06f5c80 -r 9a3f66e3c79e time/lua-chronos/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/lua-chronos/distinfo Sun Mar 06 08:58:20 2022 +0000
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1 2022/03/06 08:58:21 nia Exp $
+
+BLAKE2s (chronos-0.2.4.tar.gz) = 3e1bf2b49d1ceb18a47a0f665ac7914b5e5c634263f743a64d31aeb3e0a7a12d
+SHA512 (chronos-0.2.4.tar.gz) = b7d88351ce3bac20ef4b5cbaffcee281cbfc8cdb2210c7e9076fc36bfa69a5d81d68da89704c6103bc94e90e591d36b6a1f4fba199da69f03fc26cb5a3f49c6f
+Size (chronos-0.2.4.tar.gz) = 4807 bytes
diff -r 31f1f06f5c80 -r 9a3f66e3c79e time/lua-chronos/files/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/lua-chronos/files/Makefile   Sun Mar 06 08:58:20 2022 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2022/03/06 08:58:21 nia Exp $
+
+all: chronos.so
+
+.c.o:
+       $(CC) $(CFLAGS) -fPIC -c $<
+
+chronos.so: chronos.o
+       $(CC) $(LDFLAGS) -shared -o $@ chronos.o
diff -r 31f1f06f5c80 -r 9a3f66e3c79e time/lua-chronos/files/test.lua
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/time/lua-chronos/files/test.lua   Sun Mar 06 08:58:20 2022 +0000
@@ -0,0 +1,8 @@
+local chronos = require("chronos")
+
+
+local start = chronos.nanotime()
+os.execute("sleep 1")
+local stop = chronos.nanotime()
+
+print(("sleep took %s seconds"):format(stop - start))



Home | Main Index | Thread Index | Old Index