-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AT&T AST (att/ast) on github has rewound their repo back to ksh93u+. See
att/ast#1464 and att/ast#1466. The reason for the rewind back to 93u+ instead of 93v- was that it was an abandoned unstable buggy unfinished beta. A full explanation of this can be found here, att/ast#1466 (comment). At present ksh93-devel will track att/ast until development shifts to the new ksh-community repo on github. git-svn-id: svn+ssh://svn.freebsd.org/ports/head@526860 35697150-7ecd-e111-bb59-0022644237b5
- Loading branch information
Showing
16 changed files
with
318 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,80 @@ | ||
# $FreeBSD$ | ||
|
||
# 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= ${AST_COMMIT_DATE} | ||
CATEGORIES= shells | ||
PKGNAMESUFFIX= -devel | ||
DIST_SUBDIR= ksh93 | ||
|
||
MAINTAINER= [email protected] | ||
COMMENT= Development branch of AT&T KornShell 93 | ||
|
||
LICENSE= EPL | ||
|
||
USES= compiler:c11 meson ninja python:build | ||
HASH= 0be82553 | ||
AST_COMMIT_DATE= 2020.02.22 | ||
|
||
BROKEN_aarch64= Fails to compile: needs sbrk | ||
|
||
HASH= 8cf92b28 | ||
AST_COMMIT_DATE= 2020.02.07 | ||
USES= compiler:c11 | ||
|
||
USE_GITHUB= yes | ||
GH_ACCOUNT= att | ||
GH_PROJECT= ast | ||
GH_TAGNAME= ${HASH} | ||
|
||
# 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= ksh93-2* ast-ksh-* | ||
|
||
MESON_BUILD_DIR= build | ||
|
||
OPTIONS_DEFAULT= KSH93 | ||
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 | ||
|
||
KSH93_EXTRA_PATCHES= ${FILESDIR}/extra-patch-install-as-ksh93 \ | ||
${FILESDIR}/extra-patch-install-as-ksh93-doc | ||
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> | ||
|
||
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 | ||
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 ksh93 | ||
|
||
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TIMESTAMP = 1581102021 | ||
SHA256 (att-ast-2020.02.07-8cf92b28_GH0.tar.gz) = bbff37f478c9dedd4f52ccf27ab3a90bb17f9fb0458ef11a1ac5316097df9278 | ||
SIZE (att-ast-2020.02.07-8cf92b28_GH0.tar.gz) = 2229786 | ||
TIMESTAMP = 1581223383 | ||
SHA256 (ksh93/att-ast-2020.02.08-0be82553_GH0.tar.gz) = a78f2930e9daebd3950044eb899dfbcae67ac8e2599346aa25c2fd6fb8097bf0 | ||
SIZE (ksh93/att-ast-2020.02.08-0be82553_GH0.tar.gz) = 12960534 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
shells/ksh93-devel/files/patch-scripts_builtin_documentation.sh
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
shells/ksh93-devel/files/patch-src_cmd_std_features_procfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- src/cmd/std/features/procfs.orig 2017-11-30 22:35:04 UTC | ||
+++ src/cmd/std/features/procfs | ||
@@ -1,6 +1,6 @@ | ||
hdr kvm,procinfo,pstat,asm/param | ||
|
||
-sys procfs,sysctl | ||
+sys procfs,sysctl,user | ||
|
||
lib getprocs | ||
lib kvm_open,kvm_getprocs kvm.h sys/time.h sys/param.h sys/proc.h sys/sysctl.h -lkvm | ||
@@ -10,7 +10,11 @@ mem extern_proc.p_pid,extern_proc.p_star | ||
mem procsinfo64.pi_pri procinfo.h | ||
mem prpsinfo.pr_clname,prpsinfo.pr_cstime,prpsinfo.pr_cstime.tv_sec,prpsinfo.pr_ctime,prpsinfo.pr_cutime,prpsinfo.pr_gid,prpsinfo.pr_lttydev,prpsinfo.pr_ntpid,prpsinfo.pr_pgid,prpsinfo.pr_pgrp,prpsinfo.pr_psargs,prpsinfo.pr_refcount,prpsinfo.pr_rssize,prpsinfo.pr_sid,prpsinfo.pr_sonproc,prpsinfo.pr_start,prpsinfo.pr_start.tv_sec,prpsinfo.pr_starttime,prpsinfo.pr_starttime.tv_sec,prpsinfo.pr_state,prpsinfo.pr_stime,prpsinfo.pr_tgrp,prpsinfo.pr_time,prpsinfo.pr_time.tv_sec,prpsinfo.pr_utime,prpsinfo.pr_zomb,prpsinfo.pr_pctcpu,prpsinfo.pr_cpu,prpsinfo.pr_lwp.pr_pctcpu,prpsinfo.pr_lwp.pr_cpu -D_STRUCTURED_PROC -Dprpsinfo=psinfo sys/types.h sys/procfs.h | ||
|
||
+num PIOCPSINFO | ||
+ | ||
typ struct.prpsinfo -D_STRUCTURED_PROC -Dprpsinfo=psinfo sys/types.h sys/procfs.h | ||
+typ struct.kinfo_proc sys/types.h sys/procfs.h sys/user.h | ||
+typ struct.kp_proc sys/types.h sys/procfs.h sys/user.h | ||
|
||
tst lib_info note{ info(2) kernel table api }end link{ | ||
#include <info.h> | ||
@@ -587,11 +591,11 @@ cat{ | ||
#define PSS_METHOD PSS_METHOD_getprocs | ||
#endif | ||
|
||
-#if !PSS_METHOD && defined(_PS_dir) | ||
+#if !PSS_METHOD && defined(_PS_dir) && (_PS_scan_binary || _num_PIOCPSINFO) | ||
#define PSS_METHOD PSS_METHOD_procfs | ||
#endif | ||
|
||
-#if !PSS_METHOD && _hdr_kvm && _sys_sysctl && _lib_kvm_open && _lib_kvm_getprocs | ||
+#if !PSS_METHOD && _hdr_kvm && _sys_sysctl && _lib_kvm_open && _lib_kvm_getprocs && _typ_struct_kinfo_proc && _typ_struct_kp_proc | ||
#define PSS_METHOD PSS_METHOD_kvm | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- src/cmd/std/pss-kvm.c.orig 2017-11-30 22:35:04 UTC | ||
+++ src/cmd/std/pss-kvm.c | ||
@@ -43,6 +43,9 @@ NoN(pss_kvm) | ||
#if _sys_proc | ||
#include <sys/proc.h> | ||
#endif | ||
+#if _sys_user | ||
+#include <sys/user.h> | ||
+#endif | ||
#include <sys/sysctl.h> | ||
#include <sys/tty.h> | ||
|
36 changes: 36 additions & 0 deletions
36
shells/ksh93-devel/files/patch-src_lib_libast_features_mmap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- src/lib/libast/features/mmap.orig 2020-02-08 10:39:38.000000000 -0800 | ||
+++ src/lib/libast/features/mmap 2020-02-08 20:49:37.791733000 -0800 | ||
@@ -16,14 +16,7 @@ | ||
|
||
#define Failed(file) (remove(file),1) | ||
|
||
- int | ||
- #if _STD_ | ||
- main(int argc, char** argv) | ||
- #else | ||
- main(argc,argv) | ||
- int argc; | ||
- char** argv; | ||
- #endif | ||
+ int main(int argc, char** argv) | ||
{ | ||
caddr_t mm; | ||
char *t, *u, *f; | ||
@@ -326,17 +319,12 @@ | ||
cat{ | ||
|
||
/* some systems get it wrong but escape concise detection */ | ||
- #ifndef _NO_MMAP | ||
#if __CYGWIN__ | ||
#define _NO_MMAP 1 | ||
#endif | ||
- #endif | ||
|
||
#if _NO_MMAP | ||
#undef _lib_mmap | ||
#undef _lib_mmap64 | ||
- #undef _mmap_anon | ||
- #undef _mmap_devzero | ||
- #undef _mmap_worthy | ||
#endif | ||
}end |
23 changes: 23 additions & 0 deletions
23
shells/ksh93-devel/files/patch-src_lib_libast_features_standards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- src/lib/libast/features/standards.orig 2020-02-08 10:39:38.000000000 -0800 | ||
+++ src/lib/libast/features/standards 2020-02-08 21:58:23.687268000 -0800 | ||
@@ -1,5 +1,19 @@ | ||
set stdio | ||
-if tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{ | ||
+# In FreeBSD, definitions like _POSIX_SOURCE and such are used to *limit* | ||
+# functionality to known API; they don't enable anything. The general intent in | ||
+# BSD is to enable everything by default (effectively, providing the | ||
+# _KITCHEN_SINK_SOURCE mentioned below). So we look for that here, but stay | ||
+# careful that we don't get fooled by presence of FreeBSD that underpins some | ||
+# subsystems in Mac OS X; there are other Apple-specific portability hacks | ||
+# elsewhere we should not interfere with. | ||
+if tst note{ FreeBSD }end compile{ | ||
+ #include <sys/param.h> | ||
+ #if !defined(__FreeBSD__) || defined(APPLE) | ||
+ #error not a FreeBSD system | ||
+ #endif | ||
+ }end { | ||
+ } | ||
+elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{ | ||
#define _ALL_SOURCE 1 | ||
#define _POSIX_SOURCE 1 | ||
#define _POSIX_C_SOURCE 21000101L |
10 changes: 10 additions & 0 deletions
10
shells/ksh93-devel/files/patch-src_lib_libast_features_vmalloc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- src/lib/libast/features/vmalloc.orig 2016-02-28 17:09:23 UTC | ||
+++ src/lib/libast/features/vmalloc | ||
@@ -217,7 +217,4 @@ cat{ | ||
#if _mmap_anon | ||
#define _mem_mmap_anon 1 | ||
#endif | ||
- #if _mmap_devzero | ||
- #define _mem_mmap_zero 1 | ||
- #endif | ||
}end |
10 changes: 10 additions & 0 deletions
10
shells/ksh93-devel/files/patch-src_lib_libast_features_wchar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- src/lib/libast/features/wchar.orig 2017-11-30 22:35:04 UTC | ||
+++ src/lib/libast/features/wchar | ||
@@ -6,6 +6,7 @@ set include . | ||
cat{ | ||
#ifndef _AST_WCHAR_H | ||
#define _AST_WCHAR_H 1 | ||
+ #define _STDFILE_DECLARED | ||
}end | ||
|
||
lib mbstowcs,wctomb,wcscmp,wcscoll,wcslen,wcstombs,wcsxfrm,wcwidth stdlib.h stdio.h wchar.h |
17 changes: 17 additions & 0 deletions
17
shells/ksh93-devel/files/patch-src_lib_libast_port_astcopy.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- src/lib/libast/port/astcopy.c.orig 2016-02-28 17:09:23 UTC | ||
+++ src/lib/libast/port/astcopy.c | ||
@@ -30,14 +30,10 @@ | ||
#include <ast.h> | ||
#include <ast_mmap.h> | ||
|
||
-#if _mmap_worthy > 1 | ||
- | ||
#include <ls.h> | ||
|
||
#define MAPSIZE (1024*256) | ||
|
||
-#endif | ||
- | ||
#undef BUFSIZ | ||
#define BUFSIZ 4096 | ||
|
12 changes: 12 additions & 0 deletions
12
shells/ksh93-devel/files/patch-src_lib_libast_sfio_sfhdr.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- src/lib/libast/sfio/sfhdr.h.orig 2016-02-28 17:09:23 UTC | ||
+++ src/lib/libast/sfio/sfhdr.h | ||
@@ -209,9 +209,6 @@ | ||
|
||
/* see if we can use memory mapping for io */ | ||
#if _LARGEFILE64_SOURCE && !_lib_mmap64 | ||
-#undef _mmap_worthy | ||
-#endif | ||
-#if !_mmap_worthy | ||
#undef _hdr_mman | ||
#undef _sys_mman | ||
#endif |
24 changes: 24 additions & 0 deletions
24
shells/ksh93-devel/files/patch-src_lib_libast_sfio_sfseek.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- src/lib/libast/sfio/sfseek.c.orig 2020-02-08 10:39:38.000000000 -0800 | ||
+++ src/lib/libast/sfio/sfseek.c 2020-02-09 20:01:11.420655000 -0800 | ||
@@ -204,18 +204,9 @@ | ||
#ifdef MAP_TYPE | ||
if(f->bits&SF_MMAP) | ||
{ /* if mmap is not great, stop mmaping if moving around too much */ | ||
-#if _mmap_worthy < 2 | ||
- if((f->next - f->data) < ((f->endb - f->data)/4) ) | ||
- { SFSETBUF(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND); | ||
- hardseek = 1; /* this forces a hard seek below */ | ||
- } | ||
- else | ||
-#endif | ||
- { /* for mmap, f->here can be virtual except for hardseek */ | ||
- newpos(f,p); | ||
- if(!hardseek) | ||
- goto done; | ||
- } | ||
+ newpos(f,p); | ||
+ if(!hardseek) | ||
+ goto done; | ||
} | ||
#endif | ||
|
Oops, something went wrong.