Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/shells/mksh mksh: Import unpacked mksh-59b sources.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bc2e0784ae88
branches:  trunk
changeset: 435328:bc2e0784ae88
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Mon Jul 06 10:11:34 2020 +0000

description:
mksh: Import unpacked mksh-59b sources.

Two patches have been applied on top, both of which are stored in the
patches directory as manual-Build.sh and manual-funcs.c, to fix issues
on Darwin and SunOS that will be included in the next mksh release.  The
binary mksh.ico file has been manually removed.

This paves the way for  mksh to be used as an alternate bootstrap shell
instead of shells/pdksh, which has been unmaintained for many years and
has some known issues.

Initial bulk build results on Darwin and SunOS look good, and having a
maintained shell which focuses on portability and speed should provide
us with a better long-term option for systems which require a bootstrap
shell.

diffstat:

 shells/mksh/Makefile                |     24 +-
 shells/mksh/distinfo                |      6 -
 shells/mksh/files/Build.sh          |   2837 ++++++
 shells/mksh/files/FAQ2HTML.sh       |    136 +
 shells/mksh/files/check.pl          |   1363 +++
 shells/mksh/files/check.t           |  13910 ++++++++++++++++++++++++++++++++++
 shells/mksh/files/dot.mkshrc        |    675 +
 shells/mksh/files/edit.c            |   5726 +++++++++++++
 shells/mksh/files/emacsfn.h         |    116 +
 shells/mksh/files/eval.c            |   2111 +++++
 shells/mksh/files/exec.c            |   1872 ++++
 shells/mksh/files/expr.c            |   1234 +++
 shells/mksh/files/exprtok.h         |    123 +
 shells/mksh/files/funcs.c           |   3657 ++++++++
 shells/mksh/files/histrap.c         |   1630 +++
 shells/mksh/files/jehanne.c         |     36 +
 shells/mksh/files/jobs.c            |   1962 ++++
 shells/mksh/files/lalloc.c          |    193 +
 shells/mksh/files/lex.c             |   1820 ++++
 shells/mksh/files/lksh.1            |    354 +
 shells/mksh/files/main.c            |   2150 +++++
 shells/mksh/files/mirhash.h         |    226 +
 shells/mksh/files/misc.c            |   2633 ++++++
 shells/mksh/files/mksh.1            |   7102 +++++++++++++++++
 shells/mksh/files/mksh.faq          |    620 +
 shells/mksh/files/os2.c             |    585 +
 shells/mksh/files/rlimits.opt       |    111 +
 shells/mksh/files/sh.h              |   2904 +++++++
 shells/mksh/files/sh_flags.opt      |    194 +
 shells/mksh/files/shf.c             |   1322 +++
 shells/mksh/files/strlcpy.c         |     53 +
 shells/mksh/files/syn.c             |   1187 ++
 shells/mksh/files/tree.c            |   1176 ++
 shells/mksh/files/var.c             |   2244 +++++
 shells/mksh/files/var_spec.h        |     80 +
 shells/mksh/patches/manual-Build.sh |     29 +
 shells/mksh/patches/manual-funcs.c  |     29 +
 37 files changed, 62413 insertions(+), 17 deletions(-)

diffs (truncated from 62614 to 300 lines):

diff -r 7190333eefd8 -r bc2e0784ae88 shells/mksh/Makefile
--- a/shells/mksh/Makefile      Mon Jul 06 10:09:28 2020 +0000
+++ b/shells/mksh/Makefile      Mon Jul 06 10:11:34 2020 +0000
@@ -1,21 +1,20 @@
-# $NetBSD: Makefile,v 1.39 2020/05/19 15:20:07 nia Exp $
+# $NetBSD: Makefile,v 1.40 2020/07/06 10:11:34 jperkin Exp $
 
 DISTNAME=                      mksh-R59b
 PKGNAME=                       ${DISTNAME:S/-R/-/}
 CATEGORIES=                    shells
-MASTER_SITES=                  http://www.mirbsd.org/MirOS/dist/mir/mksh/
-MASTER_SITES+=                 http://pub.allbsd.org/MirOS/dist/mir/mksh/
-SITES.${DISTNAME}.cat1.gz=     ${MASTER_SITES:S/dist/cats/}
+MASTER_SITES=                  # maintained locally
+DISTFILES=                     # empty
 
-EXTRACT_SUFX=                  .tgz
-
-MAINTAINER=                    ahoka%NetBSD.org@localhost
+MAINTAINER=                    jperkin%pkgsrc.org@localhost
 HOMEPAGE=                      http://mirbsd.de/mksh
 COMMENT=                       MirBSD Korn Shell
 LICENSE=                       miros
 
+BOOTSTRAP_PKG=                 yes
+NO_CHECKSUM=                   yes
+
 WRKSRC=                                ${WRKDIR}/mksh
-WRKBUILD?=                     ${WRKSRC}
 
 PKG_SHELL=                     bin/mksh
 
@@ -23,18 +22,21 @@
 
 INSTALLATION_DIRS=             bin ${PKGMANDIR}/man1 share/examples/mksh
 
+do-extract:
+       ${CP} -R ${FILESDIR} ${WRKSRC}
+
 do-build:
-       cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} LIBS=${LIBS:Q} \
+       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} LIBS=${LIBS:Q} \
            ${TOOLS_SHELL} ${WRKSRC}/Build.sh -r
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKBUILD}/mksh ${DESTDIR}${PREFIX}/bin/mksh
+       ${INSTALL_PROGRAM} ${WRKSRC}/mksh ${DESTDIR}${PREFIX}/bin/mksh
        ${INSTALL_MAN} ${WRKSRC}/mksh.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
        ${INSTALL_DATA} ${WRKSRC}/dot.mkshrc ${DESTDIR}${PREFIX}/share/examples/mksh/
 
 # Uncomment this if you want to run the regression tests
 #USE_TOOLS+=                   perl
 #do-test:
-#      ${WRKBUILD}/test.sh -v
+#      ${WRKSRC}/test.sh -v
 
 .include "../../mk/bsd.pkg.mk"
diff -r 7190333eefd8 -r bc2e0784ae88 shells/mksh/distinfo
--- a/shells/mksh/distinfo      Mon Jul 06 10:09:28 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-$NetBSD: distinfo,v 1.34 2020/05/19 15:20:07 nia Exp $
-
-SHA1 (mksh-R59b.tgz) = b3fbbcdaf5029011e3ec42ed5426a1b0567c4654
-RMD160 (mksh-R59b.tgz) = d898ba5a55f194e2c373734e4640025ea27fe936
-SHA512 (mksh-R59b.tgz) = 4ae330a79a09d2dd989116b1a836ab7f179d920eb34c97ea5da7d1434361911a93ba77ca47c5e473e5a5ce1877f2a2e919a807bb6139ec6c89c87969054d021d
-Size (mksh-R59b.tgz) = 440055 bytes
diff -r 7190333eefd8 -r bc2e0784ae88 shells/mksh/files/Build.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/shells/mksh/files/Build.sh        Mon Jul 06 10:11:34 2020 +0000
@@ -0,0 +1,2837 @@
+#!/bin/sh
+srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.756 2020/05/16 22:53:03 tg Exp $'
+#-
+# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#              2011, 2012, 2013, 2014, 2015, 2016, 2017, 2019,
+#              2020
+#      mirabilos <m%mirbsd.org@localhost>
+#
+# Provided that these terms and disclaimer and all copyright notices
+# are retained or reproduced in an accompanying document, permission
+# is granted to deal in this work without restriction, including un-
+# limited rights to use, publicly perform, distribute, sell, modify,
+# merge, give away, or sublicence.
+#
+# This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+# the utmost extent permitted by applicable law, neither express nor
+# implied; without malicious intent or gross negligence. In no event
+# may a licensor, author or contributor be held liable for indirect,
+# direct, other damage, loss, or other issues arising in any way out
+# of dealing in the work, even if advised of the possibility of such
+# damage or existence of a defect, except proven that it results out
+# of said person's immediate fault when using the work as intended.
+#-
+# People analysing the output must whitelist conftest.c for any kind
+# of compiler warning checks (mirtoconf is by design not quiet).
+#
+# Used environment documentation is at the end of this file.
+
+LC_ALL=C; LANGUAGE=C
+export LC_ALL; unset LANGUAGE
+
+case $ZSH_VERSION:$VERSION in
+:zsh*) ZSH_VERSION=2 ;;
+esac
+
+if test -n "${ZSH_VERSION+x}" && (emulate sh) >/dev/null 2>&1; then
+       emulate sh
+       NULLCMD=:
+fi
+
+if test -d /usr/xpg4/bin/. >/dev/null 2>&1; then
+       # Solaris: some of the tools have weird behaviour, use portable ones
+       PATH=/usr/xpg4/bin:$PATH
+       export PATH
+fi
+
+nl='
+'
+safeIFS='      '
+safeIFS=" $safeIFS$nl"
+IFS=$safeIFS
+allu=QWERTYUIOPASDFGHJKLZXCVBNM
+alll=qwertyuiopasdfghjklzxcvbnm
+alln=0123456789
+alls=______________________________________________________________
+
+test_n() {
+       test x"$1" = x"" || return 0
+       return 1
+}
+
+test_z() {
+       test x"$1" = x""
+}
+
+case `echo a | tr '\201' X` in
+X)
+       # EBCDIC build system
+       lfcr='\n\r'
+       ;;
+*)
+       lfcr='\012\015'
+       ;;
+esac
+
+genopt_die() {
+       if test_z "$1"; then
+               echo >&2 "E: invalid input in '$srcfile': '$line'"
+       else
+               echo >&2 "E: $*"
+               echo >&2 "N: in '$srcfile': '$line'"
+       fi
+       rm -f "$bn.gen"
+       exit 1
+}
+
+genopt_soptc() {
+       optc=`echo "$line" | sed 's/^[<>]\(.\).*$/\1/'`
+       test x"$optc" = x'|' && return
+       optclo=`echo "$optc" | tr $allu $alll`
+       if test x"$optc" = x"$optclo"; then
+               islo=1
+       else
+               islo=0
+       fi
+       sym=`echo "$line" | sed 's/^[<>]/|/'`
+       o_str=$o_str$nl"<$optclo$islo$sym"
+}
+
+genopt_scond() {
+       case x$cond in
+       x)
+               cond=
+               ;;
+       x*' '*)
+               cond=`echo "$cond" | sed 's/^ //'`
+               cond="#if $cond"
+               ;;
+       x'!'*)
+               cond=`echo "$cond" | sed 's/^!//'`
+               cond="#ifndef $cond"
+               ;;
+       x*)
+               cond="#ifdef $cond"
+               ;;
+       esac
+}
+
+do_genopt() {
+       srcfile=$1
+       test -f "$srcfile" || genopt_die Source file \$srcfile not set.
+       bn=`basename "$srcfile" | sed 's/.opt$//'`
+       o_hdr='/* +++ GENERATED FILE +++ DO NOT EDIT +++ */'
+       o_gen=
+       o_str=
+       o_sym=
+       ddefs=
+       state=0
+       exec <"$srcfile"
+       IFS=
+       while IFS= read line; do
+               IFS=$safeIFS
+               case $state:$line in
+               2:'|'*)
+                       # end of input
+                       o_sym=`echo "$line" | sed 's/^.//'`
+                       o_gen=$o_gen$nl"#undef F0"
+                       o_gen=$o_gen$nl"#undef FN"
+                       o_gen=$o_gen$ddefs
+                       state=3
+                       ;;
+               1:@@)
+                       # start of data block
+                       o_gen=$o_gen$nl"#endif"
+                       o_gen=$o_gen$nl"#ifndef F0"
+                       o_gen=$o_gen$nl"#define F0 FN"
+                       o_gen=$o_gen$nl"#endif"
+                       state=2
+                       ;;
+               *:@@*)
+                       genopt_die ;;
+               0:/\*-|0:\ \**|0:)
+                       o_hdr=$o_hdr$nl$line
+                       ;;
+               0:@*|1:@*)
+                       # start of a definition block
+                       sym=`echo "$line" | sed 's/^@//'`
+                       if test $state = 0; then
+                               o_gen=$o_gen$nl"#if defined($sym)"
+                       else
+                               o_gen=$o_gen$nl"#elif defined($sym)"
+                       fi
+                       ddefs="$ddefs$nl#undef $sym"
+                       state=1
+                       ;;
+               0:*|3:*)
+                       genopt_die ;;
+               1:*)
+                       # definition line
+                       o_gen=$o_gen$nl$line
+                       ;;
+               2:'<'*'|'*)
+                       genopt_soptc
+                       ;;
+               2:'>'*'|'*)
+                       genopt_soptc
+                       cond=`echo "$line" | sed 's/^[^|]*|//'`
+                       genopt_scond
+                       case $optc in
+                       '|') optc=0 ;;
+                       *) optc=\'$optc\' ;;
+                       esac
+                       IFS= read line || genopt_die Unexpected EOF
+                       IFS=$safeIFS
+                       test_z "$cond" || o_gen=$o_gen$nl"$cond"
+                       o_gen=$o_gen$nl"$line, $optc)"
+                       test_z "$cond" || o_gen=$o_gen$nl"#endif"
+                       ;;
+               esac
+       done
+       case $state:$o_sym in
+       3:) genopt_die Expected optc sym at EOF ;;
+       3:*) ;;
+       *) genopt_die Missing EOF marker ;;
+       esac
+       echo "$o_str" | sort | while IFS='|' read x opts cond; do
+               IFS=$safeIFS
+               test_n "$x" || continue
+               genopt_scond
+               test_z "$cond" || echo "$cond"
+               echo "\"$opts\""
+               test_z "$cond" || echo "#endif"
+       done | {
+               echo "$o_hdr"
+               echo "#ifndef $o_sym$o_gen"
+               echo "#else"
+               cat
+               echo "#undef $o_sym"
+               echo "#endif"
+       } >"$bn.gen"
+       IFS=$safeIFS
+       return 0
+}
+
+if test x"$BUILDSH_RUN_GENOPT" = x"1"; then
+       set x -G "$srcfile"
+       shift
+fi
+if test x"$1" = x"-G"; then
+       do_genopt "$2"
+       exit $?
+fi
+
+echo "For the build logs, demonstrate that /dev/null and /dev/tty exist:"
+ls -l /dev/null /dev/tty
+
+v() {
+       $e "$*"
+       eval "$@"



Home | Main Index | Thread Index | Old Index