git: 039bde8216ed - main - shells/ksh93: Introduce new ksh port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 28 Aug 2022 21:19:53 UTC
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/ports/commit/?id=039bde8216ed7bb5dcf3bb2fc5af72a8fec317f2
commit 039bde8216ed7bb5dcf3bb2fc5af72a8fec317f2
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-08-28 19:17:30 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-08-28 21:16:45 +0000
shells/ksh93: Introduce new ksh port
Now that ksh development has resumed under a new account on github,
this introduces the fourth stable release (1.0.3) of ksh93/ksh to ports
---
shells/Makefile | 1 +
shells/ksh/Makefile | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++
shells/ksh/distinfo | 3 +++
shells/ksh/pkg-descr | 13 +++++++++
shells/ksh/pkg-plist | 6 +++++
5 files changed, 98 insertions(+)
diff --git a/shells/Makefile b/shells/Makefile
index 923ce5c04e9a..bd4ce24c9f24 100644
--- a/shells/Makefile
+++ b/shells/Makefile
@@ -23,6 +23,7 @@
SUBDIR += ion
SUBDIR += jailkit
SUBDIR += klish
+ SUBDIR += ksh
SUBDIR += ksh-devel
SUBDIR += ksh2020
SUBDIR += ksh93
diff --git a/shells/ksh/Makefile b/shells/ksh/Makefile
new file mode 100644
index 000000000000..1780a8047211
--- /dev/null
+++ b/shells/ksh/Makefile
@@ -0,0 +1,75 @@
+# Make sure that your configuration DOES NOT set ANY gcc-related
+# variables. ksh93 will not compile if you set even the seemingly
+# most unrelated variable related to gcc configuration. This means
+# especially any flag which attempts to set the cputype. Setting the
+# cputype does absolutely nothing except cause systems to fail in
+# horrible ways. For any modern processor, setting the cputype only
+# serves to expose gcc bugs and does nothing to speed up any known
+# program. If you are really unconvinced, go ahead but do not
+# complain to me about it.
+
+DISTVERSIONPREFIX= v
+PORTNAME= ksh
+PORTVERSION= 1.0.3
+CATEGORIES= shells
+
+MAINTAINER= cy@FreeBSD.org
+COMMENT= Development branch of AT&T KornShell 93
+
+LICENSE= EPL
+
+BROKEN_aarch64= Fails to link: missing sbrk
+BROKEN_riscv64= Fails to link: missing sbrk
+
+USES= compiler:c11
+
+USE_GITHUB= yes
+GH_ACCOUNT= ksh93
+GH_PROJECT= ksh
+
+# IMPORTANT: Disabling conflicts, i.e. -DDISABLE_CONFLICTS will result in
+# arcane build failures due to already installed ksh/ksh93 in
+# $PATH.
+KSH_CONFLICTS= pdksh
+KSH93_CONFLICTS= ksh2020 ksh93 ast-ksh ksh-devel
+
+OPTIONS_DEFAULT= KSH93 EXAMPLES
+OPTIONS_DEFINE= EXAMPLES STATIC
+OPTIONS_SINGLE= BIN_KSH
+OPTIONS_SINGLE_BIN_KSH= KSH KSH93
+KSH_DESC= Install to ${PREFIX}/bin/ksh
+KSH93_DESC= Install to ${PREFIX}/bin/ksh93
+
+CFLAGS+= -DMAP_TYPE
+LDFLAGS+= -lm
+MAKE_ENV= CCFLAGS="-Wno-unused-value -Wno-parentheses -Wno-logical-op-parentheses" CFLAGS="${CFLAGS}"
+
+STATIC_MAKE_ENV= LDFLAGS+=-static
+
+KSH_PLIST_SUB= 93=""
+KSH93_PLIST_SUB= 93="93"
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MKSH93}
+PNAME= ksh93
+.else
+PNAME= ksh
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|SF_FLAGS|SFIO_FLAGS|g' ${WRKSRC}/src/lib/libast/include/sfio*.h ${WRKSRC}/src/lib/libast/sfio/*.c
+
+do-build:
+ @cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/${PNAME}
+ ${INSTALL_MAN} ${WRKSRC}/man/man1/sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/${PNAME}.1
+ ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
+ cd ${WRKSRC}/fun/ && ${INSTALL_SCRIPT} dirs popd pushd ${STAGEDIR}${EXAMPLESDIR}/
+
+do-test:
+ cd ${WRKSRC}/src/cmd/ksh93/tests/ && ${SETENV} SHELL=${WRKSRC}/bin/ksh ${WRKSRC}/bin/ksh shtests
+
+.include <bsd.port.mk>
diff --git a/shells/ksh/distinfo b/shells/ksh/distinfo
new file mode 100644
index 000000000000..89b779b50bf6
--- /dev/null
+++ b/shells/ksh/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1661710772
+SHA256 (ksh93-ksh-v1.0.3_GH0.tar.gz) = e554a96ecf7b64036ecb730fcc2affe1779a2f14145eb6a95d0dfe8b1aba66b5
+SIZE (ksh93-ksh-v1.0.3_GH0.tar.gz) = 2110771
diff --git a/shells/ksh/pkg-descr b/shells/ksh/pkg-descr
new file mode 100644
index 000000000000..ee3150bac1cd
--- /dev/null
+++ b/shells/ksh/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/ksh/pkg-plist b/shells/ksh/pkg-plist
new file mode 100644
index 000000000000..39bd9a3d8408
--- /dev/null
+++ b/shells/ksh/pkg-plist
@@ -0,0 +1,6 @@
+@shell bin/ksh%%93%%
+man/man1/ksh%%93%%.1.gz
+share/examples/ksh/dirs
+share/examples/ksh/popd
+share/examples/ksh/pushd
+