From 2b01fc5e4fde5be72f9cc3a0b469c71ba950187f Mon Sep 17 00:00:00 2001 From: Neel Chauhan Date: Wed, 3 Mar 2021 23:09:48 +0000 Subject: NEW PORT: shells/bashc: GNU Bourne Again shell extended with two-panel file manager Bash Commander is a fork of GNU Bourne Again Shell. It's main feature is a visual two-panel mode, much like Midnight Commander and other text-mode visual shells. WWW: https://github.com/sergev/bash-commander Also add bashc to the CONFLICTS section of shells/bash. PR: 253783, 253784 Submitted by: Igor Pokrovsky --- shells/Makefile | 1 + shells/bash/Makefile | 5 +- shells/bashc/Makefile | 103 ++++++++++++++++++ shells/bashc/distinfo | 3 + shells/bashc/files/patch-Makefile.in | 13 +++ shells/bashc/files/patch-config-top.h | 11 ++ shells/bashc/files/patch-doc_bash.1 | 32 ++++++ shells/bashc/files/patch-doc_bashref.texi | 28 +++++ shells/bashc/files/patch-lib_readline_display.c | 13 +++ shells/bashc/files/pkg-message.in | 15 +++ shells/bashc/pkg-descr | 5 + shells/bashc/pkg-plist | 134 ++++++++++++++++++++++++ 12 files changed, 361 insertions(+), 2 deletions(-) create mode 100644 shells/bashc/Makefile create mode 100644 shells/bashc/distinfo create mode 100644 shells/bashc/files/patch-Makefile.in create mode 100644 shells/bashc/files/patch-config-top.h create mode 100644 shells/bashc/files/patch-doc_bash.1 create mode 100644 shells/bashc/files/patch-doc_bashref.texi create mode 100644 shells/bashc/files/patch-lib_readline_display.c create mode 100644 shells/bashc/files/pkg-message.in create mode 100644 shells/bashc/pkg-descr create mode 100644 shells/bashc/pkg-plist (limited to 'shells') diff --git a/shells/Makefile b/shells/Makefile index ee29d0340b4f..e5bf1f4012ef 100644 --- a/shells/Makefile +++ b/shells/Makefile @@ -11,6 +11,7 @@ SUBDIR += bash SUBDIR += bash-completion SUBDIR += bash-static + SUBDIR += bashc SUBDIR += bicon SUBDIR += ch SUBDIR += dash diff --git a/shells/bash/Makefile b/shells/bash/Makefile index ea917fd655c0..ca709d5197e1 100644 --- a/shells/bash/Makefile +++ b/shells/bash/Makefile @@ -59,10 +59,11 @@ CONFIGURE_ARGS+= --without-bash-malloc \ MAKE_ARGS+= TERMCAP_LIB=-lncursesw .if empty(PKGNAMESUFFIX) -CONFLICTS+= bash-static-[0-9]* +CONFLICTS+= bash-static-[0-9]* .else -CONFLICTS+= bash-[0-9]* +CONFLICTS+= bash-[0-9]* .endif +CONFLICTS+= bashc .include diff --git a/shells/bashc/Makefile b/shells/bashc/Makefile new file mode 100644 index 000000000000..68d915294eef --- /dev/null +++ b/shells/bashc/Makefile @@ -0,0 +1,103 @@ +# Created by: Igor Pokrovsky +# $FreeBSD$ + +PORTNAME= bashc +PORTVERSION= 5.0.9 +CATEGORIES= shells + +MAINTAINER= ip@unixway.org +COMMENT= GNU Bourne Again shell extended with two-panel file manager + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/COPYING + +USES= bison cpe gmake iconv localbase makeinfo pathfix +GNU_CONFIGURE= yes +OPTIONS_SUB= yes +CPE_VENDOR= gnu + +USE_GITHUB= yes +GH_ACCOUNT= sergev +GH_PROJECT= bash-commander +GH_TAGNAME= f707afab3e299d9b9e557923d355e14d2fe1291a + +OPTIONS_DEFINE= DOCS FDESCFS HELP NLS STATIC SYSBASHRC SYSLOG +FDESCFS_DESC= Enable use of /dev/fd +HELP_DESC= Enable builtin help +SYSBASHRC_DESC= Enable system-wide rc files + +OPTIONS_DEFAULT= HELP + +FDESCFS_CONFIGURE_ENV_OFF= bash_cv_dev_fd=absent + +HELP_CONFIGURE_ENABLE= help-builtin +NLS_CONFIGURE_ENABLE= nls +NLS_USES= gettext + +INFO= bash + +PORTDOCS= CHANGES COMPAT FAQ INTRO NEWS POSIX RBASH README bash.html \ + bashref.html +DOCSDIR= ${PREFIX}/share/doc/bash +SUB_FILES= pkg-message + +CONFIGURE_ARGS+= --disable-rpath \ + --enable-disabled-builtins \ + --with-libiconv-prefix=${ICONV_PREFIX} \ + --without-bash-malloc + +CONFLICTS+= bash-[0-9]* bash-static-[0-9]* + +.include + +.if ${PORT_OPTIONS:MSTATIC} || defined(NO_DYNAMICROOT) || (defined(NOSHARED) && ${NOSHARED:tl} != "no") +CONFIGURE_ARGS+= --enable-static-link +LLD_UNSAFE= yes +.else +CONFIGURE_ARGS+= --disable-static-link +# Bash symbols must be exported in order to link runtime plugins, i.e., +# "enable -f". (Plugins are not supported for bash-static.) +LDFLAGS+= -Wl,-export-dynamic +.endif +STANDARD_PATH= /sbin:/bin:/usr/sbin:/usr/bin +CPPFLAGS+= -DDEFAULT_PATH_VALUE='\"${STANDARD_PATH}:${LOCALBASE}/sbin:${LOCALBASE}/bin\"' \ + -DSTANDARD_UTILS_PATH='\"${STANDARD_PATH}\"' + +post-patch: +# Ensure y.tab.c is regenerated + ${TOUCH} ${WRKSRC}/parse.y + ${RM} ${WRKSRC}/y.tab.c + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/doc/bash.1 +.if ${PORT_OPTIONS:MSYSLOG} + @${REINPLACE_CMD} \ + -e "s|/\*.*#define SYSLOG_HISTORY .*\*/|#define SYSLOG_HISTORY|g" \ + -e "s|/\*.*#define SYSLOG_SHOPT .*\*/|#define SYSLOG_SHOPT 1|g" \ + ${WRKSRC}/config-top.h +.endif + +post-patch-SYSBASHRC-on: + @${REINPLACE_CMD} \ + -e "s|.*\(#define SYS_BASH.*\)\(/etc/.*\"\).*|\1${PREFIX}\2|" \ + ${WRKSRC}/config-top.h + +post-configure: + @${FIND} ${WRKSRC} -name Makefile -print0 | ${XARGS} -0 \ + ${REINPLACE_CMD} -e "s|^DESTDIR *=|& ${DESTDIR}|" + +pre-build: + @${ECHO_CMD} $$((${PORTREVISION}-1)) > ${WRKSRC}/.build + +post-install: + ${LN} -sf ${PORTNAME} ${STAGEDIR}${PREFIX}/bin/rbash + ${LN} -sf ${PORTNAME} ${STAGEDIR}${PREFIX}/bin/bash + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/doc/FAQ \ + ${WRKSRC}/doc/INTRO ${STAGEDIR}${DOCSDIR} + for d in ${PORTDOCS:NFAQ:NINTRO:N*html}; do \ + ${INSTALL_DATA} ${WRKSRC}/$${d} ${STAGEDIR}${DOCSDIR}; \ + done + +regress: build + cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} test + +.include diff --git a/shells/bashc/distinfo b/shells/bashc/distinfo new file mode 100644 index 000000000000..069a7b3ffffc --- /dev/null +++ b/shells/bashc/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1613744521 +SHA256 (sergev-bash-commander-5.0.9-f707afab3e299d9b9e557923d355e14d2fe1291a_GH0.tar.gz) = a32b8770a9b68420baa4bb05dbe84120c12835ad28dc82f8ec745bbce6d2acb8 +SIZE (sergev-bash-commander-5.0.9-f707afab3e299d9b9e557923d355e14d2fe1291a_GH0.tar.gz) = 10112494 diff --git a/shells/bashc/files/patch-Makefile.in b/shells/bashc/files/patch-Makefile.in new file mode 100644 index 000000000000..2c0bc50654bf --- /dev/null +++ b/shells/bashc/files/patch-Makefile.in @@ -0,0 +1,13 @@ +--- Makefile.in.orig 2021-02-19 17:35:54 UTC ++++ Makefile.in +@@ -774,8 +774,8 @@ pathnames.h: Makefile $(srcdir)/pathnames.h.in + @${RM} pathnames.tmp + + # comment out for distribution +-#$(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/config.h.in +-# cd $(srcdir) && autoconf ++$(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/config.h.in ++ cd $(srcdir) && autoconf + + # for chet + reconfig: force diff --git a/shells/bashc/files/patch-config-top.h b/shells/bashc/files/patch-config-top.h new file mode 100644 index 000000000000..659cc69f1bb4 --- /dev/null +++ b/shells/bashc/files/patch-config-top.h @@ -0,0 +1,11 @@ +--- config-top.h.orig 2019-08-29 22:16:15 UTC ++++ config-top.h +@@ -78,7 +78,7 @@ + #endif + + /* Default primary and secondary prompt strings. */ +-#define PPROMPT "\\s-\\v\\$ " ++#define PPROMPT "[\\u@\\h \\w]\\$ " + #define SPROMPT "> " + + /* Undefine this if you don't want the ksh-compatible behavior of reprinting diff --git a/shells/bashc/files/patch-doc_bash.1 b/shells/bashc/files/patch-doc_bash.1 new file mode 100644 index 000000000000..ecfb819a9c8d --- /dev/null +++ b/shells/bashc/files/patch-doc_bash.1 @@ -0,0 +1,32 @@ +--- doc/bash.1.orig 2019-08-29 22:16:15 UTC ++++ doc/bash.1 +@@ -31,9 +31,9 @@ + .\" .ll \\n(LLu + .\" .in \\n()Ru+\\n(INu+\\n()Iu + .\" .ti \\n(INu +-.\" .ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X ++.\" .ie !\\n()Iu+\\n()Ru-\w\\*(]Xu-3p \{\\*(]X + .\" .br\} +-.\" .el \\*(]X\h|\\n()Iu+\\n()Ru\c ++.\" .el \\*(]X\h|\\n()Iu+\\n()Ru\c + .\" .}f + .\" .. + .\" +@@ -2444,7 +2444,7 @@ The value of this parameter is expanded (see + .SM + .B PROMPTING + below) and used as the primary prompt string. The default value is +-``\fB\es\-\ev\e$ \fP''. ++``\fB\eu\@\eh\e$ \fP''. + .TP + .B PS2 + The value of this parameter is expanded as with +@@ -10880,7 +10880,7 @@ http://tiswww.case.edu/~chet/bash/POSIX -- a descripti + .SH FILES + .PD 0 + .TP +-.FN /bin/bash ++.FN /usr/local/bin/bash + The \fBbash\fP executable + .TP + .FN /etc/profile diff --git a/shells/bashc/files/patch-doc_bashref.texi b/shells/bashc/files/patch-doc_bashref.texi new file mode 100644 index 000000000000..5975199958f5 --- /dev/null +++ b/shells/bashc/files/patch-doc_bashref.texi @@ -0,0 +1,28 @@ +--- doc/bashref.texi.orig 2019-08-29 22:16:15 UTC ++++ doc/bashref.texi +@@ -1,6 +1,6 @@ + \input texinfo.tex @c -*- texinfo -*- + @c %**start of header +-@setfilename bashref.info ++@setfilename bash.info + @settitle Bash Reference Manual + + @include version.texi +@@ -8,7 +8,7 @@ + + @copying + This text is a brief description of the features that are present in +-the Bash shell (version @value{VERSION}, @value{UPDATED}). ++the Bash shell (version @value{VERSION}, @value{UPDATED}) + + This is Edition @value{EDITION}, last updated @value{UPDATED}, + of @cite{The GNU Bash Reference Manual}, +@@ -5598,7 +5598,7 @@ A null directory name may appear as two adjacent colon + or trailing colon. + + @item PS1 +-The primary prompt string. The default value is @samp{\s-\v\$ }. ++The primary prompt string. The default value is @samp{[\u@@\h \w]\$ }. + @xref{Controlling the Prompt}, for the complete list of escape + sequences that are expanded before @env{PS1} is displayed. + diff --git a/shells/bashc/files/patch-lib_readline_display.c b/shells/bashc/files/patch-lib_readline_display.c new file mode 100644 index 000000000000..b69b08410b1a --- /dev/null +++ b/shells/bashc/files/patch-lib_readline_display.c @@ -0,0 +1,13 @@ +--- lib/readline/display.c.orig 2018-10-01 01:37:48 UTC ++++ lib/readline/display.c +@@ -837,7 +837,10 @@ rl_redisplay (void) + the line breaks in the prompt string in expand_prompt, taking invisible + characters into account, and if lpos exceeds the screen width, we copy + the data in the loop below. */ ++ if (local_prompt) + lpos = prompt_physical_chars + modmark; ++ else ++ lpos = 0; + + #if defined (HANDLE_MULTIBYTE) + memset (line_state_invisible->wrapped_line, 0, line_state_invisible->wbsize * sizeof (int)); diff --git a/shells/bashc/files/pkg-message.in b/shells/bashc/files/pkg-message.in new file mode 100644 index 000000000000..535884ce35a2 --- /dev/null +++ b/shells/bashc/files/pkg-message.in @@ -0,0 +1,15 @@ +[ +{ type: install + message: <