Date: Sun, 16 Feb 2025 22:22:27 GMT From: Ashish SHUKLA <ashish@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 6874ce4f7140 - main - shells/schemesh: New port: Unix shell, and LISP repl Message-ID: <202502162222.51GMMRp9007842@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by ashish: URL: https://cgit.FreeBSD.org/ports/commit/?id=6874ce4f7140fec1945e5b6bfd23e7edd968e4a7 commit 6874ce4f7140fec1945e5b6bfd23e7edd968e4a7 Author: Ashish SHUKLA <ashish@FreeBSD.org> AuthorDate: 2025-02-16 22:04:51 +0000 Commit: Ashish SHUKLA <ashish@FreeBSD.org> CommitDate: 2025-02-16 22:22:18 +0000 shells/schemesh: New port: Unix shell, and LISP repl Schemesh is an interactive shell scriptable in Lisp. It is primarily intended as a user-friendly Unix login shell, replacing bash, zsh, pdksh etc. As such, it supports interactive line editing, autocompletion, history and the familiar Unix shell syntax: it can start commands, including redirections, pipelines, job concatenation with ; && ||, groups surrounded by { }, subshells surrounded by [ ], and manage foreground/background jobs. WWW: https://github.com/cosmos72/schemesh --- shells/Makefile | 1 + shells/schemesh/Makefile | 38 ++++++++++++++++++++++++++++++ shells/schemesh/distinfo | 3 +++ shells/schemesh/files/patch-posix_posix.c | 28 ++++++++++++++++++++++ shells/schemesh/files/patch-posix_signal.h | 16 +++++++++++++ shells/schemesh/pkg-descr | 10 ++++++++ 6 files changed, 96 insertions(+) diff --git a/shells/Makefile b/shells/Makefile index aad04461265f..6edba1d03e3c 100644 --- a/shells/Makefile +++ b/shells/Makefile @@ -55,6 +55,7 @@ SUBDIR += rubygem-shellwords SUBDIR += rush SUBDIR += sash + SUBDIR += schemesh SUBDIR += scponly SUBDIR += sheldon SUBDIR += shell-hist diff --git a/shells/schemesh/Makefile b/shells/schemesh/Makefile new file mode 100644 index 000000000000..19ae74a60477 --- /dev/null +++ b/shells/schemesh/Makefile @@ -0,0 +1,38 @@ +PORTNAME= schemesh +DISTVERSIONPREFIX= v +DISTVERSION= 0.7.5 +CATEGORIES= shells + +MAINTAINER= ashish@FreeBSD.org +COMMENT= Unix shell and Lisp REPL, fused together +WWW= https://github.com/cosmos72/schemesh + +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING + +BUILD_DEPENDS= chez-scheme:lang/chez-scheme +RUN_DEPENDS= chez-scheme:lang/chez-scheme +LIB_DEPENDS= liblz4.so:archivers/liblz4 \ + libuuid.so:misc/e2fsprogs-libuuid + +USES= gmake ncurses + +USE_GITHUB= yes +GH_ACCOUNT= cosmos72 +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +USE_LDCONFIG= yes + +PLIST_FILES= bin/schemesh \ + lib/schemesh/libschemesh_${DISTVERSION}.so + +post-patch: + @${REINPLACE_CMD} -e 's,chezscheme,chez-scheme,' \ + ${WRKSRC}/utils/find_chez_scheme_dir.sh + @${REINPLACE_CMD} -r -e 's/^CC=cc/CC=${CC}/' \ + -e 's,^(prefix.+)(=.+)$$,\1= ${PREFIX},' \ + -e '/^LDFLAGS/s|$$| ${LDFLAGS}|' \ + -e '/^CFLAGS/s|$$| ${CFLAGS}|' \ + ${WRKSRC}/Makefile + +.include <bsd.port.mk> diff --git a/shells/schemesh/distinfo b/shells/schemesh/distinfo new file mode 100644 index 000000000000..46817831aeaa --- /dev/null +++ b/shells/schemesh/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1739715894 +SHA256 (cosmos72-schemesh-v0.7.5_GH0.tar.gz) = 4ea282f29e21938cece5a8d3c3f3420ff91786cdc755f80f02af26544ecb4798 +SIZE (cosmos72-schemesh-v0.7.5_GH0.tar.gz) = 254799 diff --git a/shells/schemesh/files/patch-posix_posix.c b/shells/schemesh/files/patch-posix_posix.c new file mode 100644 index 000000000000..592842e2547a --- /dev/null +++ b/shells/schemesh/files/patch-posix_posix.c @@ -0,0 +1,28 @@ +--- posix/posix.c.orig 2025-02-16 14:38:30 UTC ++++ posix/posix.c +@@ -7,10 +7,6 @@ + * (at your option) any later version. + */ + +-#define _POSIX_C_SOURCE 200809L /* fstatat() */ +-#define _DEFAULT_SOURCE /* DT_* */ +-#define _BSD_SOURCE /* DT_* */ +- + #include "posix.h" + #include "../containers/containers.h" /* schemesh_Sbytevector() */ + #include "../eval.h" /* eval() */ +@@ -817,8 +813,14 @@ static ptr c_get_hostname(void) { + + /** return Scheme string, or Scheme integer on error */ + static ptr c_get_hostname(void) { ++#ifdef __FreeBSD__ ++ int len = sysconf(_SC_HOST_NAME_MAX) + 1; ++ char* buf = alloca(len); ++ if (gethostname(buf, len) != 0) { ++#else + char buf[HOST_NAME_MAX + 1]; + if (gethostname(buf, sizeof(buf)) != 0) { ++#endif + return Sinteger(c_errno()); + } + return schemesh_Sstring_utf8b(buf, -1); diff --git a/shells/schemesh/files/patch-posix_signal.h b/shells/schemesh/files/patch-posix_signal.h new file mode 100644 index 000000000000..28774e535214 --- /dev/null +++ b/shells/schemesh/files/patch-posix_signal.h @@ -0,0 +1,16 @@ +--- posix/signal.h.orig 2025-02-16 14:43:54 UTC ++++ posix/signal.h +@@ -138,11 +138,11 @@ static ptr c_signals_list(void) { + {SIGBUS, "sigbus"}, {SIGFPE, "sigfpe"}, {SIGKILL, "sigkill"}, + {SIGUSR1, "sigusr1"}, {SIGSEGV, "sigsegv"}, {SIGUSR2, "sigusr2"}, + {SIGPIPE, "sigpipe"}, {SIGALRM, "sigalrm"}, {SIGTERM, "sigterm"}, +- {SIGSTKFLT, "sigstkflt"}, {SIGCHLD, "sigchld"}, {SIGCONT, "sigcont"}, ++ /* {SIGSTKFLT, "sigstkflt"}, */ {SIGCHLD, "sigchld"}, {SIGCONT, "sigcont"}, + {SIGSTOP, "sigstop"}, {SIGTSTP, "sigtstp"}, {SIGTTIN, "sigttin"}, + {SIGTTOU, "sigttou"}, {SIGURG, "sigurg"}, {SIGXCPU, "sigxcpu"}, + {SIGXFSZ, "sigxfsz"}, {SIGVTALRM, "sigvtalrm"}, {SIGPROF, "sigprof"}, +- {SIGWINCH, "sigwinch"}, {SIGIO, "sigio"}, {SIGPWR, "sigpwr"}, ++ {SIGWINCH, "sigwinch"}, {SIGIO, "sigio"}, /* {SIGPWR, "sigpwr"}, */ + {SIGSYS, "sigsys"}}; + + ptr ret = Snil; diff --git a/shells/schemesh/pkg-descr b/shells/schemesh/pkg-descr new file mode 100644 index 000000000000..edd50f5c1a82 --- /dev/null +++ b/shells/schemesh/pkg-descr @@ -0,0 +1,10 @@ +Schemesh is an interactive shell scriptable in Lisp. + +It is primarily intended as a user-friendly Unix login shell, +replacing bash, zsh, pdksh etc. + +As such, it supports interactive line editing, autocompletion, history +and the familiar Unix shell syntax: it can start commands, including +redirections, pipelines, job concatenation with ; && ||, groups +surrounded by { }, subshells surrounded by [ ], and manage +foreground/background jobs.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502162222.51GMMRp9007842>
