diff --git a/shells/Makefile b/shells/Makefile index aad04461265f..6edba1d03e3c 100644 --- a/shells/Makefile +++ b/shells/Makefile @@ -1,80 +1,81 @@ COMMENT = Shells SUBDIR += 44bsd-csh SUBDIR += anongitssh SUBDIR += antibody SUBDIR += ast-ksh SUBDIR += atuin SUBDIR += bash SUBDIR += bash-completion SUBDIR += bash-completion-freebsd SUBDIR += bash-static SUBDIR += bashc SUBDIR += bicon SUBDIR += bosh SUBDIR += carapace SUBDIR += ch SUBDIR += dash SUBDIR += elvish SUBDIR += envy SUBDIR += es SUBDIR += etsh SUBDIR += fd SUBDIR += fish SUBDIR += git-prompt.zsh SUBDIR += heirloom-sh SUBDIR += ibsh SUBDIR += ion SUBDIR += jailkit SUBDIR += klish SUBDIR += ksh SUBDIR += ksh-devel SUBDIR += ksh93 SUBDIR += mksh SUBDIR += modernish SUBDIR += murex SUBDIR += nologinmsg SUBDIR += nsh SUBDIR += nu_plugin_formats SUBDIR += nu_plugin_gstat SUBDIR += nu_plugin_inc SUBDIR += nu_plugin_polars SUBDIR += nu_plugin_query SUBDIR += nushell SUBDIR += ohmyzsh SUBDIR += oil SUBDIR += oksh SUBDIR += p5-Bash-Completion SUBDIR += p5-Shell-Perl SUBDIR += p5-Term-Bash-Completion-Generator SUBDIR += p5-Term-ShellUI SUBDIR += pdksh SUBDIR += pear-PHP_Shell SUBDIR += psh SUBDIR += rc SUBDIR += rubygem-shellwords SUBDIR += rush SUBDIR += sash + SUBDIR += schemesh SUBDIR += scponly SUBDIR += sheldon SUBDIR += shell-hist SUBDIR += shellharden SUBDIR += starship SUBDIR += switchBashZsh SUBDIR += tcshrc SUBDIR += v7sh SUBDIR += viewglob SUBDIR += vshnu SUBDIR += wcd SUBDIR += xonsh SUBDIR += yash SUBDIR += zsh SUBDIR += zsh-antigen SUBDIR += zsh-autosuggestions SUBDIR += zsh-completions SUBDIR += zsh-fast-syntax-highlighting SUBDIR += zsh-navigation-tools SUBDIR += zsh-syntax-highlighting SUBDIR += zsh-you-should-use .include 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 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.