From bc43b87c90b7ed73c9a5637014b18b0fdbc0eb2e Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Wed, 4 Apr 1984 00:44:18 +0000 Subject: a minor patch for tcsh(1) --- README | 11 +++ app-shells/tcsh/Manifest | 3 + app-shells/tcsh/files/tcsh-6.18.01-aix.patch | 14 +++ .../tcsh/files/tcsh-6.20.00-debian-dircolors.patch | 21 +++++ .../files/tcsh-6.20.00-use-ncurses-tinfo.patch | 11 +++ .../tcsh/files/tcsh-6.21.00-fno-common.patch | 22 +++++ app-shells/tcsh/files/tcsh-6.21.00-no-nls.patch | 17 ++++ .../tcsh/files/tcsh-6.21.00-use-ncurses.patch | 11 +++ .../tcsh/files/tcsh-lynXified-delete-path.patch | 33 +++++++ app-shells/tcsh/metadata.xml | 15 +++ app-shells/tcsh/tcsh-6.20.00.ebuild | 102 ++++++++++++++++++++ app-shells/tcsh/tcsh-6.21.00-r1.ebuild | 104 +++++++++++++++++++++ 12 files changed, 364 insertions(+) create mode 100644 app-shells/tcsh/Manifest create mode 100644 app-shells/tcsh/files/tcsh-6.18.01-aix.patch create mode 100644 app-shells/tcsh/files/tcsh-6.20.00-debian-dircolors.patch create mode 100644 app-shells/tcsh/files/tcsh-6.20.00-use-ncurses-tinfo.patch create mode 100644 app-shells/tcsh/files/tcsh-6.21.00-fno-common.patch create mode 100644 app-shells/tcsh/files/tcsh-6.21.00-no-nls.patch create mode 100644 app-shells/tcsh/files/tcsh-6.21.00-use-ncurses.patch create mode 100644 app-shells/tcsh/files/tcsh-lynXified-delete-path.patch create mode 100644 app-shells/tcsh/metadata.xml create mode 100644 app-shells/tcsh/tcsh-6.20.00.ebuild create mode 100644 app-shells/tcsh/tcsh-6.21.00-r1.ebuild diff --git a/README b/README index cb3a0a7..202c9cc 100644 --- a/README +++ b/README @@ -79,6 +79,17 @@ without this all these years? [ask ng0] +== app-shells/tcsh == + +Removing a long path specification from the command line +can be tedious with tcsh as it has no notion of file names +containing whitespace while editing the command line. +My patch makes CTRL-W aka kill-region do this whenever no +mark has been set (which is the default), instead of giving +an error. Back when tcsh was created, no sane Unix person +would put whitespace into filenames! Filesystems had barely +just learned to even be capable of such perversions. + == dev-db/cayley == A graph database written in Go. Borrowed the ebuild from diff --git a/app-shells/tcsh/Manifest b/app-shells/tcsh/Manifest new file mode 100644 index 0000000..4862d06 --- /dev/null +++ b/app-shells/tcsh/Manifest @@ -0,0 +1,3 @@ +DIST tcsh-6.20.00.tar.gz 1001696 BLAKE2B dfebde21c70f236e1070a93621a331ce1a53efab4496c44f25b51e98e843a8d0e3ca503da46a4fc0177b57b682e3ecc07f8120cde25ecf466c8ff094df5f9463 SHA512 c5635393c22341e62fb9a0b953ddf8871a876ab09deb08c98237f93afa9257b4a3381d1db65eefe769e22ef845db29ab7bc78773f1f609d73c8205689a6683e9 +DIST tcsh-6.21.00.tar.gz 1001909 BLAKE2B 7f2be382a3a344d55e0785eace79377e20dd2cd2eb9e9533168fbb6286631cdcd35bdc06cd42d9439a29a7cd1a911416bfe6b0245065535aebdf5adb58d2c301 SHA512 d7f46588a35b9cd01cfa33d0f9bbae09e9692605b5c045c2b58e66dba958ab904ddfe45aa7361767034e6cc03a34ad9ba4d14fa836df723bade29f3f6a18a46c +DIST tcsh-gentoo-patches-r1.9.tar.bz2 2488 BLAKE2B 58924e623c75068cdc686be61755bdbcf8d0949a2141ac532ac089f80ff083b2c9f6767038b9fc52171a00ed82c558b83216327c87b41f51c3648343869cd5b6 SHA512 9903e9c3e2279abcac09a3235f3c5db9f42156c18137eb651ede195ca2b069f0b5bc6105fed33666b69796c4ebf03e4efe63cd9beba1898bac7297a2f74bfd3d diff --git a/app-shells/tcsh/files/tcsh-6.18.01-aix.patch b/app-shells/tcsh/files/tcsh-6.18.01-aix.patch new file mode 100644 index 0000000..669d206 --- /dev/null +++ b/app-shells/tcsh/files/tcsh-6.18.01-aix.patch @@ -0,0 +1,14 @@ +Upstream report, without better patch yet: +http://bugs.gw.com/view.php?id=366 + +--- tc.who.c.orig 2014-06-26 11:21:43 +0200 ++++ tc.who.c 2014-06-26 11:21:58 +0200 +@@ -60,6 +60,8 @@ + # define TCSH_PATH_UTMP _PATH_UTMPX + # elif defined(UTMPX_FILE) + # define TCSH_PATH_UTMP UTMPX_FILE ++# elif defined(UTMP_FILE) ++# define TCSH_PATH_UTMP UTMP_FILE + # elif __FreeBSD_version >= 900000 + # /* Why isn't this defined somewhere? */ + # define TCSH_PATH_UTMP "/var/run/utx.active" diff --git a/app-shells/tcsh/files/tcsh-6.20.00-debian-dircolors.patch b/app-shells/tcsh/files/tcsh-6.20.00-debian-dircolors.patch new file mode 100644 index 0000000..3b18f1c --- /dev/null +++ b/app-shells/tcsh/files/tcsh-6.20.00-debian-dircolors.patch @@ -0,0 +1,21 @@ +forward-ported 6.14 to 6.20 patch from Debian + +--- tcsh-6.20.00/tw.color.c ++++ tcsh-6.20.00/tw.color.c +@@ -382,13 +382,10 @@ + if ((Char)variables[i].variable[0] == (v[0] & CHAR) && + (Char)variables[i].variable[1] == (v[1] & CHAR)) + break; +- if (i < nvariables) { +- v += 3; ++ v += 3; ++ if (i < nvariables) + getstring(&c, &v, &variables[i].color, ':'); +- continue; +- } +- else +- stderror(ERR_BADCOLORVAR, v[0], v[1]); ++ continue; + } + break; + } diff --git a/app-shells/tcsh/files/tcsh-6.20.00-use-ncurses-tinfo.patch b/app-shells/tcsh/files/tcsh-6.20.00-use-ncurses-tinfo.patch new file mode 100644 index 0000000..e178418 --- /dev/null +++ b/app-shells/tcsh/files/tcsh-6.20.00-use-ncurses-tinfo.patch @@ -0,0 +1,11 @@ +--- tcsh-6.20.00/configure.ac ++++ tcsh-6.20.00/configure.ac +@@ -317,7 +317,7 @@ + dnl Checks for libraries + AC_SEARCH_LIBS(crypt, crypt) + AC_SEARCH_LIBS(getspnam, sec) +-AC_SEARCH_LIBS([tgetent], [termlib termcap curses ncurses], [], [ ++AC_SEARCH_LIBS([tgetent], [ncurses tinfo], [], [ + AC_MSG_ERROR([unable to find the tgetent() function]) + ]) + AC_SEARCH_LIBS(gethostbyname, nsl) diff --git a/app-shells/tcsh/files/tcsh-6.21.00-fno-common.patch b/app-shells/tcsh/files/tcsh-6.21.00-fno-common.patch new file mode 100644 index 0000000..b5a0cf0 --- /dev/null +++ b/app-shells/tcsh/files/tcsh-6.21.00-fno-common.patch @@ -0,0 +1,22 @@ +From 6974bc35a5cda6eab748e364bd76a860ca66968b Mon Sep 17 00:00:00 2001 +From: zoulasc +Date: Sat, 11 Jan 2020 11:16:51 -0500 +Subject: [PATCH] Remove extra variable definition that cause -fno-common build + to fail (Werner Fink) + +--- + tc.sig.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tc.sig.c b/tc.sig.c +index 77659ca..576605a 100644 +--- a/tc.sig.c ++++ b/tc.sig.c +@@ -56,7 +56,6 @@ int alrmcatch_disabled; /* = 0; */ + int phup_disabled; /* = 0; */ + int pchild_disabled; /* = 0; */ + int pintr_disabled; /* = 0; */ +-int handle_interrupt; /* = 0; */ + + int + handle_pending_signals(void) diff --git a/app-shells/tcsh/files/tcsh-6.21.00-no-nls.patch b/app-shells/tcsh/files/tcsh-6.21.00-no-nls.patch new file mode 100644 index 0000000..a01ebfb --- /dev/null +++ b/app-shells/tcsh/files/tcsh-6.21.00-no-nls.patch @@ -0,0 +1,17 @@ +GetCmdChar: fix compilation with --disable-nls + +Bug: https://bugs.gentoo.org/689904 + +--- a/ed.inputl.c ++++ b/ed.inputl.c +@@ -669,8 +669,8 @@ + { + #ifndef WINNT_NATIVE // We use more than 256 for various extended keys +- wint_t c = ch & CHAR; ++ eChar c = ch & CHAR; + #else +- wint_t c = ch; ++ eChar c = ch; + #endif + return c < NT_NUM_KEYS ? CurrentKeyMap[c] : F_INSERT; + } diff --git a/app-shells/tcsh/files/tcsh-6.21.00-use-ncurses.patch b/app-shells/tcsh/files/tcsh-6.21.00-use-ncurses.patch new file mode 100644 index 0000000..d268474 --- /dev/null +++ b/app-shells/tcsh/files/tcsh-6.21.00-use-ncurses.patch @@ -0,0 +1,11 @@ +--- tcsh-6.21.00/configure.ac ++++ tcsh-6.21.00/configure.ac +@@ -317,7 +317,7 @@ + dnl Checks for libraries + AC_SEARCH_LIBS(crypt, crypt) + AC_SEARCH_LIBS(getspnam, sec) +-AC_SEARCH_LIBS([tgetent], [termlib tinfo termcap curses ncurses], [], [ ++AC_SEARCH_LIBS([tgetent], [tinfo ncurses], [], [ + AC_MSG_ERROR([unable to find the tgetent() function]) + ]) + AC_SEARCH_LIBS(gethostbyname, nsl) diff --git a/app-shells/tcsh/files/tcsh-lynXified-delete-path.patch b/app-shells/tcsh/files/tcsh-lynXified-delete-path.patch new file mode 100644 index 0000000..ffc9971 --- /dev/null +++ b/app-shells/tcsh/files/tcsh-lynXified-delete-path.patch @@ -0,0 +1,33 @@ +--- ed.chared.c-orig 2020-02-21 10:46:54.518972312 +0100 ++++ ed.chared.c 2020-02-21 12:47:14.091944771 +0100 +@@ -2632,9 +2632,28 @@ + CCRETVAL + e_killregion(Char c) + { ++ Char *cp; ++ + USE(c); +- if (!Mark) +- return(CC_ERROR); ++ if (!Mark || Mark == InputBuf || Mark == Cursor) { ++ /* ++ * proposed default behavior: backward-delete of a file path ++ * accepting either double quote or backslash syntaxes ++ * --symlynX 2020 ++ */ ++ for (cp = Cursor-2; cp >= InputBuf && *cp != '"'; cp--) { ++// xprintf("Looking at '%c'\n", *cp); ++ } ++ if (cp > InputBuf) Mark = cp; ++ else { ++ for (cp = Cursor-3; cp >= InputBuf && (cp[1] != ' ' || *cp == '\\'); cp--) { ++// xprintf("Then at '%c'\n", *cp); ++ } ++ if (++cp > InputBuf) Mark = cp+1; ++ else return(CC_ERROR); ++ } ++// xprintf("Mark set at '%c'\n", *Mark); ++ } + + if (Mark > Cursor) { + c_push_kill(Cursor, Mark); /* copy it */ diff --git a/app-shells/tcsh/metadata.xml b/app-shells/tcsh/metadata.xml new file mode 100644 index 0000000..1e378f9 --- /dev/null +++ b/app-shells/tcsh/metadata.xml @@ -0,0 +1,15 @@ + + + + + grobian@gentoo.org + Fabian Groffen + + + Tcsh is an enhanced, but completely compatible version of the Berkeley + UNIX C shell (csh). It is a command language interpreter usable both as + an interactive login shell and a shell script command processor. It + includes a command-line editor, programmable word completion, spelling + correction, a history mechanism, job control and a C-like syntax. + + diff --git a/app-shells/tcsh/tcsh-6.20.00.ebuild b/app-shells/tcsh/tcsh-6.20.00.ebuild new file mode 100644 index 0000000..1c2a4f2 --- /dev/null +++ b/app-shells/tcsh/tcsh-6.20.00.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils flag-o-matic autotools prefix + +CONFVER="1.9" + +DESCRIPTION="Enhanced version of the Berkeley C shell (csh)" +HOMEPAGE="http://www.tcsh.org/" +SRC_URI=" + ftp://ftp.astron.com/pub/tcsh/${P}.tar.gz + https://dev.gentoo.org/~grobian/distfiles/tcsh-gentoo-patches-r${CONFVER}.tar.bz2" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="nls doc" +RESTRICT="test" + +# we need gettext because we run autoconf (AM_ICONV) +RDEPEND=" + >=sys-libs/ncurses-5.1:0= + virtual/libiconv" +DEPEND="${RDEPEND} + sys-devel/gettext + doc? ( dev-lang/perl )" + +CONFDIR=${WORKDIR}/tcsh-gentoo-patches-r${CONFVER} + +PATCHES=( + "${FILESDIR}"/${PN}-6.20.00-debian-dircolors.patch # bug #120792 + "${FILESDIR}"/${PN}-6.20.00-use-ncurses-tinfo.patch + "${FILESDIR}"/${PN}-6.18.01-aix.patch + "${FILESDIR}"/tcsh-lynXified-delete-path.patch +) + +src_prepare() { + epatch "${PATCHES[@]}" + + eautoreconf + + # fix gencat usage + sed \ + -e 's/cat \$\^ \$> | \$(GENCAT) \$@/rm -f $@; $(GENCAT) $@ $> $^/' \ + -i nls/Makefile.in || die + + # use sysmalloc (for larger alloc sets) on Darwin also + sed -i -e 's/__MACHTEN__/__MACH__/' config_f.h || die + + # unify ECHO behaviour + echo "#undef ECHO_STYLE" >> config_f.h + echo "#define ECHO_STYLE BOTH_ECHO" >> config_f.h + + eprefixify "${CONFDIR}"/* + # activate the right default PATH + if [[ -z ${EPREFIX} ]] ; then + sed -i \ + -e 's/^#MAIN//' -e '/^#PREFIX/d' \ + "${CONFDIR}"/csh.login || die + else + sed -i \ + -e 's/^#PREFIX//' -e '/^#MAIN/d' \ + "${CONFDIR}"/csh.login || die + fi + + eapply_user +} + +src_configure() { + # make tcsh look and live along the lines of the prefix + append-cppflags -D_PATH_DOTCSHRC="'"'"${EPREFIX}/etc/csh.cshrc"'"'" + append-cppflags -D_PATH_DOTLOGIN="'"'"${EPREFIX}/etc/csh.login"'"'" + append-cppflags -D_PATH_DOTLOGOUT="'"'"${EPREFIX}/etc/csh.logout"'"'" + append-cppflags -D_PATH_USRBIN="'"'"${EPREFIX}/usr/bin"'"'" + append-cppflags -D_PATH_BIN="'"'"${EPREFIX}/bin"'"'" + + econf \ + --prefix="${EPREFIX:-}" \ + --datarootdir='${prefix}/usr/share' \ + $(use_enable nls) +} + +src_install() { + emake DESTDIR="${D}" install install.man + + DOCS=( FAQ Fixes NewThings Ported README WishList Y2K ) + if use doc ; then + perl tcsh.man2html tcsh.man || die + HTML_DOCS=( tcsh.html/*.html ) + fi + einstalldocs + + insinto /etc + doins \ + "${CONFDIR}"/csh.cshrc \ + "${CONFDIR}"/csh.login + + # bug #119703: add csh -> tcsh symlink + dosym tcsh /bin/csh +} diff --git a/app-shells/tcsh/tcsh-6.21.00-r1.ebuild b/app-shells/tcsh/tcsh-6.21.00-r1.ebuild new file mode 100644 index 0000000..59b8936 --- /dev/null +++ b/app-shells/tcsh/tcsh-6.21.00-r1.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils flag-o-matic autotools prefix + +CONFVER="1.9" + +DESCRIPTION="Enhanced version of the Berkeley C shell (csh)" +HOMEPAGE="http://www.tcsh.org/" +SRC_URI=" + ftp://ftp.astron.com/pub/tcsh/${P}.tar.gz + https://dev.gentoo.org/~grobian/distfiles/tcsh-gentoo-patches-r${CONFVER}.tar.bz2" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="nls doc" +RESTRICT="test" + +# we need gettext because we run autoconf (AM_ICONV) +RDEPEND=" + >=sys-libs/ncurses-5.1:0= + virtual/libiconv" +DEPEND="${RDEPEND} + sys-devel/gettext + doc? ( dev-lang/perl )" + +CONFDIR=${WORKDIR}/tcsh-gentoo-patches-r${CONFVER} + +PATCHES=( + "${FILESDIR}"/${PN}-6.20.00-debian-dircolors.patch # bug #120792 + "${FILESDIR}"/${PN}-6.18.01-aix.patch + "${FILESDIR}"/${PN}-6.21.00-no-nls.patch + "${FILESDIR}"/${PN}-6.21.00-use-ncurses.patch + "${FILESDIR}"/${PN}-6.21.00-fno-common.patch # upstream + "${FILESDIR}"/tcsh-lynXified-delete-path.patch +) + +src_prepare() { + epatch "${PATCHES[@]}" + + eautoreconf + + # fix gencat usage + sed \ + -e 's/cat \$\^ \$> | \$(GENCAT) \$@/rm -f $@; $(GENCAT) $@ $> $^/' \ + -i nls/Makefile.in || die + + # use sysmalloc (for larger alloc sets) on Darwin also + sed -i -e 's/__MACHTEN__/__MACH__/' config_f.h || die + + # unify ECHO behaviour + echo "#undef ECHO_STYLE" >> config_f.h + echo "#define ECHO_STYLE BOTH_ECHO" >> config_f.h + + eprefixify "${CONFDIR}"/* + # activate the right default PATH + if [[ -z ${EPREFIX} ]] ; then + sed -i \ + -e 's/^#MAIN//' -e '/^#PREFIX/d' \ + "${CONFDIR}"/csh.login || die + else + sed -i \ + -e 's/^#PREFIX//' -e '/^#MAIN/d' \ + "${CONFDIR}"/csh.login || die + fi + + eapply_user +} + +src_configure() { + # make tcsh look and live along the lines of the prefix + append-cppflags -D_PATH_DOTCSHRC="'"'"${EPREFIX}/etc/csh.cshrc"'"'" + append-cppflags -D_PATH_DOTLOGIN="'"'"${EPREFIX}/etc/csh.login"'"'" + append-cppflags -D_PATH_DOTLOGOUT="'"'"${EPREFIX}/etc/csh.logout"'"'" + append-cppflags -D_PATH_USRBIN="'"'"${EPREFIX}/usr/bin"'"'" + append-cppflags -D_PATH_BIN="'"'"${EPREFIX}/bin"'"'" + + econf \ + --prefix="${EPREFIX:-}" \ + --datarootdir='${prefix}/usr/share' \ + $(use_enable nls) +} + +src_install() { + emake DESTDIR="${D}" install install.man + + DOCS=( FAQ Fixes NewThings Ported README.md WishList Y2K ) + if use doc ; then + perl tcsh.man2html tcsh.man || die + HTML_DOCS=( tcsh.html/*.html ) + fi + einstalldocs + + insinto /etc + doins \ + "${CONFDIR}"/csh.cshrc \ + "${CONFDIR}"/csh.login + + # bug #119703: add csh -> tcsh symlink + dosym tcsh /bin/csh +} -- cgit v1.2.3