diff --git a/shells/Makefile b/shells/Makefile index 5e6dc4cd3ecb7..b84f5849f60f2 100644 --- a/shells/Makefile +++ b/shells/Makefile @@ -25,6 +25,7 @@ SUBDIR += ion SUBDIR += jailkit SUBDIR += klish + SUBDIR += ksh2020 SUBDIR += ksh93 SUBDIR += ksh93-devel SUBDIR += lshell diff --git a/shells/ksh2020/Makefile b/shells/ksh2020/Makefile new file mode 100644 index 0000000000000..da526975bd01b --- /dev/null +++ b/shells/ksh2020/Makefile @@ -0,0 +1,48 @@ +# $FreeBSD$ + +PORTNAME= ksh2020 +PORTVERSION= 2020 +CATEGORIES= shells + +MAINTAINER= cy@FreeBSD.org +COMMENT= Development branch of AT&T KornShell 93 + +LICENSE= EPL + +USES= compiler:c11 meson ninja python:build + +USE_GITHUB= yes +GH_ACCOUNT= att +GH_PROJECT= ast +GH_TAGNAME= ksh2020 + +KSH_CONFLICTS= pdksh-* +KSH93_CONFLICTS= ksh93-* ast-ksh-* + +MESON_BUILD_DIR= build + +OPTIONS_DEFAULT= KSH93 +OPTIONS_SINGLE= BIN_KSH +OPTIONS_SINGLE_BIN_KSH= KSH KSH93 +KSH_DESC= Install to ${PREFIX}/bin/ksh +KSH93_DESC= Install to ${PREFIX}/bin/ksh93 + +KSH93_EXTRA_PATCHES= ${FILESDIR}/extra-patch-install-as-ksh93 \ + ${FILESDIR}/extra-patch-install-as-ksh93-doc + +KSH_PLIST_SUB= 93="" +KSH93_PLIST_SUB= 93="93" + +.include + +post-patch: + @${REINPLACE_CMD} -e '/for name in/ s|python.*|${PYTHON_CMD}|g' ${WRKSRC}/scripts/python.sh + @${REINPLACE_CMD} -e 's|SF_FLAGS|SFIO_FLAGS|g' ${WRKSRC}/src/lib/libast/include/sfio*.h ${WRKSRC}/src/lib/libast/sfio/*.c +.if ${PORT_OPTIONS:MKSH93} + @${MV} ${WRKSRC}/src/cmd/ksh93/docs/ksh.1 ${WRKSRC}/src/cmd/ksh93/docs/ksh93.1 +.endif +.if ${PORT_OPTIONS:MKSH} + @# Keep portlint happy +.endif + +.include diff --git a/shells/ksh2020/distinfo b/shells/ksh2020/distinfo new file mode 100644 index 0000000000000..3574817c00a0a --- /dev/null +++ b/shells/ksh2020/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1581224799 +SHA256 (att-ast-2020-ksh2020_GH0.tar.gz) = b90129a1c5234edfdd10326d41920bc9b5e4b274ab3022c6749a93be0ec898a7 +SIZE (att-ast-2020-ksh2020_GH0.tar.gz) = 2229912 diff --git a/shells/ksh2020/files/extra-patch-install-as-ksh93 b/shells/ksh2020/files/extra-patch-install-as-ksh93 new file mode 100644 index 0000000000000..0ef50874bd813 --- /dev/null +++ b/shells/ksh2020/files/extra-patch-install-as-ksh93 @@ -0,0 +1,25 @@ +--- src/cmd/ksh93/meson.build.orig 2020-01-30 18:34:35.000000000 -0800 ++++ src/cmd/ksh93/meson.build 2020-01-30 20:47:13.410465000 -0800 +@@ -26,7 +26,7 @@ + dependencies: [libm_dep, libexecinfo_dep, libdl_dep, libsocket_dep, libnsl_dep], + install: get_option('default_library') == 'shared') + +-ksh93_exe = executable('ksh', ['sh/pmain.c'], c_args: shared_c_args, ++ksh93_exe = executable('ksh93', ['sh/pmain.c'], c_args: shared_c_args, + include_directories: [configuration_incdir, ksh93_incdir], + link_with: [libksh, libast, libcmd, libdll], + dependencies: [libm_dep, libexecinfo_dep, libdl_dep], +@@ -34,11 +34,11 @@ + + # Create a symlink for a restricted version of the ksh shell. + create_rksh_symlink = find_program(source_dir + '/scripts/create_rksh_symlink') +-rksh93_exe = custom_target('rksh', input: ksh93_exe, output: 'rksh', build_by_default: true, ++rksh93_exe = custom_target('rksh', input: ksh93_exe, output: 'rksh93', build_by_default: true, + install: true, install_mode: 'rwxr-xr-x', install_dir: install_prefix + '/bin', + command: [create_rksh_symlink, '@INPUT@']) + +-shcomp_exe = executable('shcomp', ['sh/shcomp.c'], c_args: shared_c_args, ++shcomp_exe = executable('shcomp93', ['sh/shcomp.c'], c_args: shared_c_args, + include_directories: [configuration_incdir, ksh93_incdir], + link_with: [libksh, libast, libcmd, libdll], + dependencies: [libm_dep, libexecinfo_dep, libdl_dep, libsocket_dep, libnsl_dep], diff --git a/shells/ksh2020/files/extra-patch-install-as-ksh93-doc b/shells/ksh2020/files/extra-patch-install-as-ksh93-doc new file mode 100644 index 0000000000000..35e8b7d6dd8e7 --- /dev/null +++ b/shells/ksh2020/files/extra-patch-install-as-ksh93-doc @@ -0,0 +1,10 @@ +--- src/cmd/ksh93/docs/meson.build.orig 2019-09-16 17:08:04.000000000 -0700 ++++ src/cmd/ksh93/docs/meson.build 2019-09-17 12:15:14.321848000 -0700 +@@ -3,6 +3,6 @@ + # default man page directory: /usr/local/share/man/man1. The man pages for individual builtins will + # be installed in /usr/local/share/ksh/man. + # +-install_man('ksh.1', install_mode: 'rw-r--r--') ++install_man('ksh93.1', install_mode: 'rw-r--r--') + + # See also scripts/install_aux_files.sh which takes care of installing the private man pages. diff --git a/shells/ksh2020/files/patch-scripts_builtin_documentation.sh b/shells/ksh2020/files/patch-scripts_builtin_documentation.sh new file mode 100644 index 0000000000000..d89bb531bcad9 --- /dev/null +++ b/shells/ksh2020/files/patch-scripts_builtin_documentation.sh @@ -0,0 +1,10 @@ +--- scripts/builtin_documentation.sh.orig 2019-08-30 05:32:36.000000000 -0700 ++++ scripts/builtin_documentation.sh 2019-08-30 12:40:24.125856000 -0700 +@@ -8,6 +8,6 @@ + cmd_name=$(basename "$in_file" .1) + [ "$cmd_name" = ksh ] && continue + echo "const char sh_opt${cmd_name}[] =" +- sed -e 's/\(.*\)/ "\1\\n"/' < "$in_file" ++ sed -e 's/"//g;s/\(.*\)/ "\1\\n"/' < "$in_file" + echo ";" + done diff --git a/shells/ksh2020/pkg-descr b/shells/ksh2020/pkg-descr new file mode 100644 index 0000000000000..ee3150bac1cd8 --- /dev/null +++ b/shells/ksh2020/pkg-descr @@ -0,0 +1,13 @@ +KSH-93 is the most recent version of the KornShell Language described +in "The KornShell Command and Programming Language," by Morris +Bolsky and David Korn of AT&T Bell Laboratories. The KornShell is +a shell programming language, which is upward compatible with "sh" +(the Bourne Shell), and is intended to conform to the IEEE P1003.2/ISO +9945.2 Shell and Utilities standard. KSH-93 provides an enhanced +programming environment in addition to the major command-entry +features of the BSD shell "csh". With KSH-93, medium-sized programming +tasks can be performed at shell-level without a significant loss +in performance. In addition, "sh" scripts can be run on KSH-93 +without modification. + +WWW: http://www.kornshell.com/ diff --git a/shells/ksh2020/pkg-plist b/shells/ksh2020/pkg-plist new file mode 100644 index 0000000000000..0e4d7d5e0b2fd --- /dev/null +++ b/shells/ksh2020/pkg-plist @@ -0,0 +1,64 @@ +@shell bin/ksh%%93%% +@shell bin/rksh%%93%% +bin/shcomp%%93%% +man/man1/ksh%%93%%.1.gz +share/ksh/config.ksh +share/ksh/functions/cd +share/ksh/functions/_ksh_print_help +share/ksh/functions/dirs +share/ksh/functions/man +share/ksh/functions/mcd +share/ksh/functions/popd +share/ksh/functions/pushd +share/ksh/man/man1/alias.1 +share/ksh/man/man1/basename.1 +share/ksh/man/man1/bg.1 +share/ksh/man/man1/break.1 +share/ksh/man/man1/builtin.1 +share/ksh/man/man1/cat.1 +share/ksh/man/man1/cd.1 +share/ksh/man/man1/chmod.1 +share/ksh/man/man1/cmp.1 +share/ksh/man/man1/command.1 +share/ksh/man/man1/compgen.1 +share/ksh/man/man1/complete.1 +share/ksh/man/man1/continue.1 +share/ksh/man/man1/cut.1 +share/ksh/man/man1/dirname.1 +share/ksh/man/man1/disown.1 +share/ksh/man/man1/echo.1 +share/ksh/man/man1/enum.1 +share/ksh/man/man1/eval.1 +share/ksh/man/man1/exec.1 +share/ksh/man/man1/exit.1 +share/ksh/man/man1/export.1 +share/ksh/man/man1/fg.1 +share/ksh/man/man1/head.1 +share/ksh/man/man1/hist.1 +share/ksh/man/man1/jobs.1 +share/ksh/man/man1/kill.1 +share/ksh/man/man1/let.1 +share/ksh/man/man1/logname.1 +share/ksh/man/man1/mkdir.1 +share/ksh/man/man1/print.1 +share/ksh/man/man1/printf.1 +share/ksh/man/man1/pwd.1 +share/ksh/man/man1/read.1 +share/ksh/man/man1/readonly.1 +share/ksh/man/man1/return.1 +share/ksh/man/man1/shcomp.1 +share/ksh/man/man1/shift.1 +share/ksh/man/man1/sleep.1 +share/ksh/man/man1/source.1 +share/ksh/man/man1/sync.1 +share/ksh/man/man1/test.1 +share/ksh/man/man1/times.1 +share/ksh/man/man1/trap.1 +share/ksh/man/man1/ulimit.1 +share/ksh/man/man1/umask.1 +share/ksh/man/man1/unalias.1 +share/ksh/man/man1/uname.1 +share/ksh/man/man1/unset.1 +share/ksh/man/man1/wait.1 +share/ksh/man/man1/wc.1 +share/ksh/man/man1/whence.1