git: b8ade68801ea - main - lang/s7-nrepl: notcurses-based repl for lang/s7

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 20 Dec 2024 11:39:41 UTC
The branch main has been updated by fuz:

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

commit b8ade68801ea34a9a2e3a39de431de311e3b480e
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2024-12-19 16:57:37 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-12-20 11:39:11 +0000

    lang/s7-nrepl: notcurses-based repl for lang/s7
    
    This slave port has the s7-nrepl binary from lang/s7 so it can be
    installed independently by binary package users.  s7-repl remains in
    lang/s7 as it's only ~6 kB in size and doesn't hurt to always install.
---
 lang/Makefile           |  1 +
 lang/s7-nrepl/Makefile  | 18 ++++++++++++++++++
 lang/s7-nrepl/pkg-descr |  5 +++++
 lang/s7/Makefile        | 38 ++------------------------------------
 lang/s7/Makefile.master | 30 ++++++++++++++++++++++++++++++
 lang/s7/pkg-plist       |  1 -
 6 files changed, 56 insertions(+), 37 deletions(-)

diff --git a/lang/Makefile b/lang/Makefile
index 272e0cee08f5..93a545c55643 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -340,6 +340,7 @@
     SUBDIR += rust182
     SUBDIR += rustpython
     SUBDIR += s7
+    SUBDIR += s7-nrepl
     SUBDIR += sagittarius-scheme
     SUBDIR += sather-specification
     SUBDIR += sather-tutorial
diff --git a/lang/s7-nrepl/Makefile b/lang/s7-nrepl/Makefile
new file mode 100644
index 000000000000..3ce4300ee03f
--- /dev/null
+++ b/lang/s7-nrepl/Makefile
@@ -0,0 +1,18 @@
+PKGNAMESUFFIX=	-nrepl
+
+COMMENT=	Notcurses REPL for s7
+
+LIB_DEPENDS=	libnotcurses-core.so:devel/notcurses \
+		libs7.so:lang/s7
+
+MASTERDIR=	${.CURDIR}/../../lang/s7
+
+PLIST_FILES=	bin/s7-nrepl
+
+do-build:
+	${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o ${WRKDIR}/s7-nrepl ${WRKSRC}/nrepl.c -ls7 -lnotcurses-core
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKDIR}/s7-nrepl ${STAGEDIR}${PREFIX}/bin/
+
+.include "${MASTERDIR}/Makefile.master"
diff --git a/lang/s7-nrepl/pkg-descr b/lang/s7-nrepl/pkg-descr
new file mode 100644
index 000000000000..a8bc964a80dc
--- /dev/null
+++ b/lang/s7-nrepl/pkg-descr
@@ -0,0 +1,5 @@
+Nrepl is a notcurses-based repl for S7.
+
+Unlike repl, nrepl has support for the mouse, traversable, scrollable,
+and resizable panes, built-in ties to lint.scm, debug.scm, and
+profile.scm, and various other enhancements.
diff --git a/lang/s7/Makefile b/lang/s7/Makefile
index 8fa4ad76e7f8..85a63f07b62b 100644
--- a/lang/s7/Makefile
+++ b/lang/s7/Makefile
@@ -1,49 +1,21 @@
-PORTNAME=	s7
-# S7_MAJOR_VERSION / S7_MINOR_VERSION / S7_DATE from s7.h
-PORTVERSION=	11.2.g20241220
-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=	a5515d455f5aca49d5275a5a35ac88935f3ad401
 USE_LDCONFIG=	yes
-
-CFLAGS+=	-DS7_LOAD_PATH=\"${DATADIR}\" \
-		-DHAVE_COMPLEX_NUMBERS \
-		-DHAVE_COMPLEX_TRIG \
-		-DWITH_SYSTEM_EXTRAS \
-		-DWITH_C_LOADER \
-		-fno-math-errno \
-		-Wno-parentheses-equality
-
-LDFLAGS+=	-Wl,-export-dynamic
 LIBS+=		-lm
 LIBS7=		${WRKDIR}/libs7.so.0
 S7LIBS=		c dl m
 
-MAKE_ENV+=	LD_LIBRARY_PATH=${WRKDIR}
-
 PORTDOCS=	s7.html s7-ffi.html s7-scm.html
 
-OPTIONS_DEFINE=	DOCS GMP REPL NREPL
+OPTIONS_DEFINE=	DOCS GMP REPL
 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} -Wl,--soname=libs7.so.0 \
@@ -53,9 +25,6 @@ do-build:
 	(cd ${WRKDIR} && ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${WRKDIR}/s7-repl ${WRKSRC}/lib$l.scm)
 .endfor
 
-post-build-NREPL-on:
-	${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o ${WRKDIR}/s7-nrepl ${WRKSRC}/nrepl.c ${LIBS7} -lnotcurses-core
-
 do-install:
 	${INSTALL_LIB} ${LIBS7} ${STAGEDIR}${PREFIX}/lib/libs7.so.0.0.0
 	${RLN} ${STAGEDIR}${PREFIX}/lib/libs7.so.0.0.0 ${STAGEDIR}${PREFIX}/lib/libs7.so.0
@@ -74,9 +43,6 @@ do-install-DOCS-on:
 	${INSTALL_DATA} ${WRKSRC}/$f ${STAGEDIR}${DOCSDIR}/
 .endfor
 
-do-install-NREPL-on:
-	${INSTALL_PROGRAM} ${WRKDIR}/s7-nrepl ${STAGEDIR}${PREFIX}/bin/
-
 do-install-REPL-on:
 	${INSTALL_PROGRAM} ${WRKDIR}/s7-repl ${STAGEDIR}${PREFIX}/bin/
 
@@ -86,4 +52,4 @@ do-test:
 	${MKDIR} ${WRKDIR}/test
 	(cd ${WRKSRC} && ${SETENVI} ${WRK_ENV} ${TEST_ENV} ${WRKDIR}/s7-repl s7test.scm)
 
-.include <bsd.port.mk>
+.include "Makefile.master"
diff --git a/lang/s7/Makefile.master b/lang/s7/Makefile.master
new file mode 100644
index 000000000000..13950759b9f6
--- /dev/null
+++ b/lang/s7/Makefile.master
@@ -0,0 +1,30 @@
+PORTNAME=	s7
+CATEGORIES=	lang lisp
+# S7_MAJOR_VERSION / S7_MINOR_VERSION / S7_DATE from s7.h
+PORTVERSION=	11.2.g20241220
+
+MAINTAINER?=	fuz@FreeBSD.org
+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=	a5515d455f5aca49d5275a5a35ac88935f3ad401
+
+CFLAGS+=	-DS7_LOAD_PATH=\"${DATADIR}\" \
+		-DHAVE_COMPLEX_NUMBERS \
+		-DHAVE_COMPLEX_TRIG \
+		-DWITH_SYSTEM_EXTRAS \
+		-DWITH_C_LOADER \
+		-fno-math-errno \
+		-Wno-parentheses-equality
+LDFLAGS+=	-Wl,-export-dynamic
+MAKE_ENV+=	LD_LIBRARY_PATH=${WRKDIR}
+
+DESCR?=		${.CURDIR}/pkg-descr
+PLIST?=		${.CURDIR}/pkg-plist
+
+.include <bsd.port.mk>
diff --git a/lang/s7/pkg-plist b/lang/s7/pkg-plist
index e615b1463ac4..957ea1032f90 100644
--- a/lang/s7/pkg-plist
+++ b/lang/s7/pkg-plist
@@ -1,4 +1,3 @@
-%%NREPL%%bin/s7-nrepl
 %%REPL%%bin/s7-repl
 include/s7.h
 lib/libs7.so