Skip to content

Commit

Permalink
ksh93v- 2016-07-14
Browse files Browse the repository at this point in the history
16-07-17  --- Release ksh93v- ---
16-07-17  A fix to avoid "non-void function 'ls' should return a value" error.
16-07-17  Some patches for compilation on FreeBSD have been added.
  • Loading branch information
saper committed May 28, 2017
1 parent d890f7f commit c271bcd
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
58 changes: 58 additions & 0 deletions shells/ksh93/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# $FreeBSD: head/shells/ksh93/Makefile 437933 2017-04-07 16:00:46Z amdmi3 $

# 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.

PORTNAME= ksh93
PORTVERSION= ${KSHVERSION:S/-//g}
CATEGORIES= shells
MASTER_SITES= https://distfile.net/local-ports-distfiles/
DISTFILES= INIT.${INITVERSION}.tgz ast-ksh.${KSHVERSION}.tgz
DIST_SUBDIR= ${PORTNAME}

MAINTAINER= saper@saper.info
COMMENT= Official AT&T release of KornShell 93

LICENSE= EPL

OPTIONS_DEFINE= EXAMPLES STATIC

FETCH_ENV= HTTP_AUTH=basic:*:I\ accept\ www.opensource.org/licenses/cpl:.
LDFLAGS+= -lm
MAKE_ENV= CCFLAGS="${CFLAGS}"
NO_WRKSUBDIR= yes

INITVERSION= 2014-12-24
KSHVERSION= 2016-07-16

STATIC_MAKE_ENV= LDFLAGS+=-static

BROKEN_aarch64= Fails to compile: error: unknown type name Dllscan_t

.include <bsd.port.pre.mk>

post-patch:
.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1100093
@${REINPLACE_CMD} -e 's|SF_FLAGS|SFIO_FLAGS|g' ${WRKSRC}/src/lib/libast/include/sfio*.h ${WRKSRC}/src/lib/libast/sfio/*.c
.endif

do-build:
@cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make

do-install:
${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/ksh93
${INSTALL_MAN} ${WRKSRC}/man/man1/sh.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/ksh93.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.post.mk>
5 changes: 5 additions & 0 deletions shells/ksh93/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TIMESTAMP = 1468711452
SHA256 (ksh93/INIT.2014-12-24.tgz) = 66a88b56dd94fce01fd60ec5c9201ce7029c9401621ddb8030d2aed79676cc76
SIZE (ksh93/INIT.2014-12-24.tgz) = 385659
SHA256 (ksh93/ast-ksh.2016-07-16.tgz) = 7cc877e9bf296bce29b57e38407e249a05140f21e2d1e492476e74b426b01da1
SIZE (ksh93/ast-ksh.2016-07-16.tgz) = 2283587
20 changes: 20 additions & 0 deletions shells/ksh93/files/patch-src_cmd_INIT_iffe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- src/cmd/INIT/iffe.sh.orig 2013-03-06 16:33:17 UTC
+++ src/cmd/INIT/iffe.sh
@@ -3414,7 +3414,7 @@ $src
(eval "$src") <&$nullin || e=1
;;
mac*|nomac*)
- if compile $cc -E $tmp.c <&$nullin >$tmp.i
+ if compile $cc -E -P $tmp.c <&$nullin >$tmp.i
then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i
else e=1
fi
@@ -3705,7 +3705,7 @@ $inc
<<\"#define $v\">> $v <<\"/* native $v */\">>
<<\"#endif\">>
#endif" > $tmp.c
- if compile $cc -E $tmp.c <&$nullin >$tmp.i
+ if compile $cc -E -P $tmp.c <&$nullin >$tmp.i
then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i > $tmp.t
if test -s $tmp.t
then success
13 changes: 13 additions & 0 deletions shells/ksh93/pkg-descr
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 5 additions & 0 deletions shells/ksh93/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@shell bin/ksh93
man/man1/ksh93.1.gz
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dirs
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/popd
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pushd

0 comments on commit c271bcd

Please sign in to comment.