git: 33b159c02d78 - main - lang/s7: Scheme interpreter

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 27 Oct 2023 06:33:56 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=33b159c02d78b2a00a854188ce648c9c6e0314ea

commit 33b159c02d78b2a00a854188ce648c9c6e0314ea
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-10-23 23:40:48 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-27 06:32:10 +0000

    lang/s7: Scheme interpreter
    
    s7 is a Scheme interpreter intended as an extension language for other
    applications.  Although it is a descendant of tinyScheme, s7 is closest
    as a Scheme dialect to Guile 1.8. I believe it is compatible with r5rs
    and r7rs.  It has continuations, ratios, complex numbers, macros,
    keywords, hash-tables, multiprecision arithmetic, generalized set!,
    unicode, and so on. It does not have syntax-rules or any of its friends,
    and it thinks there is no such thing as an inexact integer.
    
    WWW: https://ccrma.stanford.edu/software/snd/snd/s7.html
---
 lang/Makefile     |  1 +
 lang/s7/Makefile  | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lang/s7/distinfo  |  3 +++
 lang/s7/pkg-descr |  7 +++++
 lang/s7/pkg-plist | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 166 insertions(+)

diff --git a/lang/Makefile b/lang/Makefile
index 90c1832a54bb..261aef56d5c8 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -330,6 +330,7 @@
     SUBDIR += rust
     SUBDIR += rust-bootstrap
     SUBDIR += rust-nightly
+    SUBDIR += s7
     SUBDIR += sagittarius-scheme
     SUBDIR += sather-specification
     SUBDIR += sather-tutorial
diff --git a/lang/s7/Makefile b/lang/s7/Makefile
new file mode 100644
index 000000000000..830449938691
--- /dev/null
+++ b/lang/s7/Makefile
@@ -0,0 +1,75 @@
+PORTNAME=	s7
+PORTVERSION=	g20231023
+CATEGORIES=	lang lisp
+
+MAINTAINER=	fuz@FreeBSD.org
+COMMENT=	Scheme interpreter
+WWW=		https://ccrma.stanford.edu/software/snd/snd/s7.html
+
+LICENSE=	BSD0CLAUSE
+
+USES=		localbase:ldflags
+USE_GITLAB=	yes
+GL_SITE=	https://cm-gitlab.stanford.edu/
+GL_ACCOUNT=	bil
+GL_TAGNAME=	5bba8bca5d6c22001bcf87e63a246eb69163b020
+USE_LDCONFIG=	yes
+
+CFLAGS+=	-DS7_LOAD_PATH=\"${DATADIR}\" \
+		-DHAVE_COMPLEX_NUMBERS \
+		-DHAVE_COMPLEX_TRIG \
+		-DWITH_SYSTEM_EXTRAS \
+		-DWITH_C_LOADER
+
+LDFLAGS+=	-Wl,-export-dynamic
+LIBS+=		-lm
+S7LIBS=		c dl m
+
+PORTDOCS=	s7.html
+
+OPTIONS_DEFINE=	DOCS GMP REPL NREPL
+OPTIONS_DEFAULT=	GMP REPL
+OPTIONS_SUB=	yes
+NREPL_DESC=	install notcurses repl (s7-nrepl)
+REPL_DESC=	install simple repl (s7-repl)
+GMP_LIB_DEPENDS=	libgmp.so:math/gmp \
+			libmpfr.so:math/mpfr \
+			libmpc.so:math/mpc
+GMP_CFLAGS=	-DWITH_GMP
+GMP_LIBS=	-lmpc -lmpfr -lgmp
+NREPL_LIB_DEPENDS=	libnotcurses-core.so:devel/notcurses
+
+do-build:
+	${CC} -fpic -shared ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o ${WRKDIR}/libs7.so ${WRKSRC}/s7.c ${LIBS}
+	${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -L${WRKDIR} -o ${WRKDIR}/s7-repl ${WRKSRC}/repl.c -ls7
+.for l in ${S7LIBS}
+	(cd ${WRKDIR} && ${SETENV} LD_LIBRARY_PATH=${WRKDIR} ${WRKDIR}/s7-repl ${WRKSRC}/lib$l.scm)
+.endfor
+
+post-build-NREPL-on:
+	${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -L${WRKDIR} -o ${WRKDIR}/s7-nrepl ${WRKSRC}/nrepl.c -ls7 -lnotcurses-core
+
+do-install:
+	${INSTALL_LIB} ${WRKDIR}/libs7.so ${STAGEDIR}${PREFIX}/lib/
+	${INSTALL_DATA} ${WRKSRC}/s7.h ${STAGEDIR}${PREFIX}/include/
+	${MKDIR} ${STAGEDIR}${DATADIR}/tools
+.for l in ${S7LIBS}
+	${INSTALL_LIB} ${WRKDIR}/lib$l_s7.so ${STAGEDIR}${DATADIR}/
+.endfor
+	${INSTALL_DATA} ${WRKSRC}/*.scm ${STAGEDIR}/${DATADIR}/
+	${INSTALL_DATA} ${WRKSRC}/tools/*.scm ${STAGEDIR}/${DATADIR}/tools
+
+do-install-DOCS-on:
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/s7.html ${STAGEDIR}${DOCSDIR}/
+
+do-install-NREPL-on:
+	${INSTALL_PROGRAM} ${WRKDIR}/s7-nrepl ${STAGEDIR}${PREFIX}/bin/
+
+do-install-REPL-on:
+	${INSTALL_PROGRAM} ${WRKDIR}/s7-repl ${STAGEDIR}${PREFIX}/bin/
+
+do-test:
+	(cd ${WRKSRC} && ${SETENV} LD_LIBRARY_PATH=${WRKDIR} ${WRKDIR}/s7-repl s7test.scm)
+
+.include <bsd.port.mk>
diff --git a/lang/s7/distinfo b/lang/s7/distinfo
new file mode 100644
index 000000000000..6cb075cfb021
--- /dev/null
+++ b/lang/s7/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1698095508
+SHA256 (bil-s7-5bba8bca5d6c22001bcf87e63a246eb69163b020_GL0.tar.gz) = f48d4864b827d2f4be6d00dd8f72ee825e8fabd75c934ef1d5590e8fde934174
+SIZE (bil-s7-5bba8bca5d6c22001bcf87e63a246eb69163b020_GL0.tar.gz) = 2686623
diff --git a/lang/s7/pkg-descr b/lang/s7/pkg-descr
new file mode 100644
index 000000000000..2752043196e9
--- /dev/null
+++ b/lang/s7/pkg-descr
@@ -0,0 +1,7 @@
+s7 is a Scheme interpreter intended as an extension language for other
+applications.  Although it is a descendant of tinyScheme, s7 is closest
+as a Scheme dialect to Guile 1.8. I believe it is compatible with r5rs
+and r7rs.  It has continuations, ratios, complex numbers, macros,
+keywords, hash-tables, multiprecision arithmetic, generalized set!,
+unicode, and so on. It does not have syntax-rules or any of its friends,
+and it thinks there is no such thing as an inexact integer.
diff --git a/lang/s7/pkg-plist b/lang/s7/pkg-plist
new file mode 100644
index 000000000000..69d90a3d361d
--- /dev/null
+++ b/lang/s7/pkg-plist
@@ -0,0 +1,80 @@
+%%NREPL%%bin/s7-nrepl
+%%REPL%%bin/s7-repl
+include/s7.h
+lib/libs7.so
+%%DATADIR%%/case.scm
+%%DATADIR%%/cload.scm
+%%DATADIR%%/debug.scm
+%%DATADIR%%/dup.scm
+%%DATADIR%%/json.scm
+%%DATADIR%%/libc.scm
+%%DATADIR%%/libc_s7.so
+%%DATADIR%%/libdl.scm
+%%DATADIR%%/libdl_s7.so
+%%DATADIR%%/libgdbm.scm
+%%DATADIR%%/libgsl.scm
+%%DATADIR%%/libm.scm
+%%DATADIR%%/libm_s7.so
+%%DATADIR%%/libutf8proc.scm
+%%DATADIR%%/lint.scm
+%%DATADIR%%/loop.scm
+%%DATADIR%%/mockery.scm
+%%DATADIR%%/nrepl.scm
+%%DATADIR%%/profile.scm
+%%DATADIR%%/r7rs.scm
+%%DATADIR%%/reactive.scm
+%%DATADIR%%/repl.scm
+%%DATADIR%%/s7test.scm
+%%DATADIR%%/snd-lint.scm
+%%DATADIR%%/stuff.scm
+%%DATADIR%%/tools/auto-tester.scm
+%%DATADIR%%/tools/compare-calls.scm
+%%DATADIR%%/tools/concordance.scm
+%%DATADIR%%/tools/dup.scm
+%%DATADIR%%/tools/fbench.scm
+%%DATADIR%%/tools/make-nrepl-bits.scm
+%%DATADIR%%/tools/t101.scm
+%%DATADIR%%/tools/table.scm
+%%DATADIR%%/tools/tall.scm
+%%DATADIR%%/tools/tari.scm
+%%DATADIR%%/tools/tauto.scm
+%%DATADIR%%/tools/tbig.scm
+%%DATADIR%%/tools/tcase.scm
+%%DATADIR%%/tools/tclo.scm
+%%DATADIR%%/tools/tcopy.scm
+%%DATADIR%%/tools/teq.scm
+%%DATADIR%%/tools/texit.scm
+%%DATADIR%%/tools/tfft.scm
+%%DATADIR%%/tools/tform.scm
+%%DATADIR%%/tools/tgc.scm
+%%DATADIR%%/tools/tgen.scm
+%%DATADIR%%/tools/tgsl.scm
+%%DATADIR%%/tools/thash.scm
+%%DATADIR%%/tools/thook.scm
+%%DATADIR%%/tools/timp.scm
+%%DATADIR%%/tools/tio.scm
+%%DATADIR%%/tools/titer.scm
+%%DATADIR%%/tools/tlamb.scm
+%%DATADIR%%/tools/tleft.scm
+%%DATADIR%%/tools/tlet.scm
+%%DATADIR%%/tools/tlist.scm
+%%DATADIR%%/tools/tload.scm
+%%DATADIR%%/tools/tmac.scm
+%%DATADIR%%/tools/tmap.scm
+%%DATADIR%%/tools/tmat.scm
+%%DATADIR%%/tools/tmisc.scm
+%%DATADIR%%/tools/tmock.scm
+%%DATADIR%%/tools/tnum.scm
+%%DATADIR%%/tools/tobj.scm
+%%DATADIR%%/tools/tpeak.scm
+%%DATADIR%%/tools/trclo.scm
+%%DATADIR%%/tools/tread.scm
+%%DATADIR%%/tools/trec.scm
+%%DATADIR%%/tools/tref.scm
+%%DATADIR%%/tools/tset.scm
+%%DATADIR%%/tools/tshoot.scm
+%%DATADIR%%/tools/tsort.scm
+%%DATADIR%%/tools/tstar.scm
+%%DATADIR%%/tools/tvect.scm
+%%DATADIR%%/tools/valcall.scm
+%%DATADIR%%/write.scm