Difference between
modified post 23bb94 by Anonymous on Mon 5th Feb 2024 14:32
original post b4678 by Anonymous on Mon 5th Feb 2024 09:41
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | # | |
| 2 | 2 | # ksh93.cygport | |
| 3 | 3 | # | |
| 4 | 4 | # Copyright (C) 2024 Roland Mainz <roland.mainz@nrubsig.org> | |
| 5 | 5 | # | |
| 6 | 6 | # This file is free software; I give unlimited permission to copy and/or | |
| 7 | 7 | # distribute it, with or without modifications, as long as this notice is | |
| 8 | 8 | # preserved. | |
| 9 | 9 | # | |
| 10 | 10 | ||
| 11 | 11 | NAME=astksh | |
| 12 | 12 | LICENSE="Eclipse Public License - v 2.0" | |
| 13 | 13 | HOMEPAGE="https://github.com/ksh93/ksh" | |
| 14 | 14 | VERSION=1.0.8 | |
| 15 | 15 | RELEASE=0 | |
| 16 | 16 | ||
| 17 | 17 | PKG_NAMES="astksh astksh_devel" | |
| 18 | 18 | ||
| 19 | 19 | astksh_SUMMARY="The AT&T Korn Shell" | |
| 20 | 20 | astksh_DESCRIPTION="Original version of the AT&T AST Korn Shell 93." | |
| 21 | 21 | astksh_CATEGORY="Base Shells" | |
| 22 | 22 | astksh_CONTENTS=" \ | |
| 23 | 23 | bin/ksh.exe \ | |
| 24 | 24 | bin/ksh93.exe \ | |
| 25 | 25 | bin/rksh.exe \ | |
| 26 | 26 | bin/rksh93.exe \ | |
| 27 | 27 | etc/ksh.kshrc \ | |
| 28 | - | usr/share/doc/ksh \ | |
| 28 | + | usr/share/doc/astksh \ | |
| 29 | 29 | usr/share/man/man1 \ | |
| 30 | 30 | " | |
| 31 | 31 | ||
| 32 | 32 | astksh_devel_SUMMARY="Development files for AT&T ksh" | |
| 33 | 33 | astksh_devel_DESCRIPTION="This package contains development tools and scripts for AT&T ksh" | |
| 34 | 34 | astksh_devel_CATEGORY="Devel" | |
| 35 | 35 | astksh_devel_CONTENTS="usr/share/ksh \ | |
| 36 | 36 | bin/shcomp.exe \ | |
| 37 | 37 | " | |
| 38 | 38 | ||
| 39 | 39 | SRC_URI="https://github.com/ksh93/ksh/archive/refs/tags/v1.0.8.zip" | |
| 40 | 40 | SRC_DIR='./ksh-1.0.8/' | |
| 41 | 41 | PATCH_URI_BASE="" | |
| 42 | 42 | ||
| 43 | 43 | BUILD_REQUIRES=" \ | |
| 44 | 44 | bash \ | |
| 45 | 45 | coreutils \ | |
| 46 | 46 | bison \ | |
| 47 | 47 | gcc-g++ \ | |
| 48 | 48 | libiconv-devel \ | |
| 49 | 49 | libintl-devel \ | |
| 50 | 50 | libncurses-devel \ | |
| 51 | 51 | make \ | |
| 52 | 52 | sed \ | |
| 53 | 53 | texinfo \ | |
| 54 | 54 | " | |
| 55 | 55 | ||
| 56 | 56 | CPPFLAGS= | |
| 57 | 57 | CYGCONF_ARGS= | |
| 58 | 58 | DIFF_EXCLUDES= | |
| 59 | 59 | DOCS= | |
| 60 | 60 | ||
| 61 | 61 | function print_gnulinux_builtin_header | |
| 62 | 62 | { | |
| 63 | 63 | # Make sure to use \\ instead of \ for continuations | |
| 64 | 64 | cat <<ENDOFTEXT | |
| 65 | 65 | ||
| 66 | 66 | #ifndef _GNULINUX_KSH_CMDLIST_H | |
| 67 | 67 | #define _GNULINUX_KSH_CMDLIST_H | |
| 68 | 68 | ||
| 69 | 69 | #ifdef __cplusplus | |
| 70 | 70 | extern "C" { | |
| 71 | 71 | #endif | |
| 72 | 72 | ||
| 73 | 73 | /* | |
| 74 | 74 | * List builtins for Linux. | |
| 75 | 75 | * The list here is partially autogenerated and partially hand-picked | |
| 76 | 76 | * based on compatibility with the native GNU coreutils versions of | |
| 77 | 77 | * these tools | |
| 78 | 78 | */ | |
| 79 | 79 | ||
| 80 | 80 | /* GNU coreutils compatible commands. | |
| 81 | 81 | * Be careful, some are in /bin while others are in /usr/bin | |
| 82 | 82 | */ | |
| 83 | 83 | #define ASTCMDLIST(f) \ | |
| 84 | 84 | { "/usr/ast/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) }, | |
| 85 | 85 | #define BINCMDLIST(f) \ | |
| 86 | 86 | { "/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) }, \ | |
| 87 | 87 | { "/usr/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) }, | |
| 88 | 88 | /* undo ast_map.h #defines to avoid collision */ | |
| 89 | 89 | #undef basename | |
| 90 | 90 | #undef chmod | |
| 91 | 91 | #undef chown | |
| 92 | 92 | #undef dirname | |
| 93 | 93 | #undef mkdir | |
| 94 | 94 | #undef mkfifo | |
| 95 | 95 | #undef mktemp | |
| 96 | 96 | #undef readlink | |
| 97 | 97 | #undef realpath | |
| 98 | 98 | #undef rmdir | |
| 99 | 99 | ||
| 100 | 100 | ||
| 101 | 101 | /* Generated data, do not edit. */ | |
| 102 | 102 | BINCMDLIST(basename) | |
| 103 | 103 | BINCMDLIST(cksum) | |
| 104 | 104 | BINCMDLIST(comm) | |
| 105 | 105 | BINCMDLIST(cut) | |
| 106 | 106 | BINCMDLIST(dirname) | |
| 107 | 107 | BINCMDLIST(expr) | |
| 108 | 108 | BINCMDLIST(fold) | |
| 109 | 109 | BINCMDLIST(join) | |
| 110 | 110 | BINCMDLIST(logname) | |
| 111 | 111 | BINCMDLIST(mkdir) | |
| 112 | 112 | BINCMDLIST(mkfifo) | |
| 113 | 113 | BINCMDLIST(mktemp) | |
| 114 | 114 | BINCMDLIST(paste) | |
| 115 | 115 | BINCMDLIST(pathchk) | |
| 116 | 116 | BINCMDLIST(rev) | |
| 117 | 117 | BINCMDLIST(rmdir) | |
| 118 | 118 | BINCMDLIST(sleep) | |
| 119 | 119 | BINCMDLIST(sync) | |
| 120 | 120 | BINCMDLIST(tee) | |
| 121 | 121 | BINCMDLIST(tty) | |
| 122 | 122 | BINCMDLIST(uniq) | |
| 123 | 123 | BINCMDLIST(wc) | |
| 124 | 124 | ||
| 125 | 125 | /* Mandatory for ksh93 test suite and AST scripts */ | |
| 126 | 126 | BINCMDLIST(getconf) | |
| 127 | 127 | ||
| 128 | 128 | ASTCMDLIST(basename) | |
| 129 | 129 | ASTCMDLIST(cat) | |
| 130 | 130 | ASTCMDLIST(chgrp) | |
| 131 | 131 | ASTCMDLIST(chmod) | |
| 132 | 132 | ASTCMDLIST(chown) | |
| 133 | 133 | ASTCMDLIST(cksum) | |
| 134 | 134 | ASTCMDLIST(cmp) | |
| 135 | 135 | ASTCMDLIST(comm) | |
| 136 | 136 | ASTCMDLIST(cp) | |
| 137 | 137 | ASTCMDLIST(cut) | |
| 138 | 138 | ASTCMDLIST(date) | |
| 139 | 139 | ASTCMDLIST(dirname) | |
| 140 | 140 | //BINCMDLIST(egrep) | |
| 141 | 141 | //ASTCMDLIST(egrep) | |
| 142 | 142 | ASTCMDLIST(expr) | |
| 143 | 143 | ASTCMDLIST(fds) | |
| 144 | 144 | //BINCMDLIST(fgrep) | |
| 145 | 145 | //ASTCMDLIST(fgrep) | |
| 146 | 146 | ASTCMDLIST(fmt) | |
| 147 | 147 | ASTCMDLIST(fold) | |
| 148 | 148 | //BINCMDLIST(grep) | |
| 149 | 149 | //ASTCMDLIST(grep) | |
| 150 | 150 | ASTCMDLIST(head) | |
| 151 | 151 | ASTCMDLIST(id) | |
| 152 | 152 | //BINCMDLIST(iconv) | |
| 153 | 153 | //ASTCMDLIST(iconv) | |
| 154 | 154 | ASTCMDLIST(join) | |
| 155 | 155 | ASTCMDLIST(ln) | |
| 156 | 156 | ASTCMDLIST(logname) | |
| 157 | 157 | //ASTCMDLIST(ls) | |
| 158 | 158 | ASTCMDLIST(md5sum) | |
| 159 | 159 | BINCMDLIST(md5sum) | |
| 160 | 160 | ASTCMDLIST(mkdir) | |
| 161 | 161 | ASTCMDLIST(mkfifo) | |
| 162 | 162 | ASTCMDLIST(mktemp) | |
| 163 | 163 | ASTCMDLIST(mv) | |
| 164 | 164 | ASTCMDLIST(paste) | |
| 165 | 165 | ASTCMDLIST(pathchk) | |
| 166 | 166 | ASTCMDLIST(pids) | |
| 167 | 167 | //BINCMDLIST(od) | |
| 168 | 168 | //ASTCMDLIST(od) | |
| 169 | 169 | //BINCMDLIST(readlink) | |
| 170 | 170 | //ASTCMDLIST(readlink) | |
| 171 | 171 | //BINCMDLIST(realpath) | |
| 172 | 172 | //ASTCMDLIST(realpath) | |
| 173 | 173 | ASTCMDLIST(rev) | |
| 174 | 174 | ASTCMDLIST(rm) | |
| 175 | 175 | ASTCMDLIST(rmdir) | |
| 176 | 176 | ASTCMDLIST(stty) | |
| 177 | 177 | //ASTCMDLIST(sha1sum) | |
| 178 | 178 | //BINCMDLIST(sha1sum) | |
| 179 | 179 | //ASTCMDLIST(sha256sum) | |
| 180 | 180 | //BINCMDLIST(sha256sum) | |
| 181 | 181 | //ASTCMDLIST(sha384sum) | |
| 182 | 182 | //BINCMDLIST(sha384sum) | |
| 183 | 183 | //ASTCMDLIST(sha512sum) | |
| 184 | 184 | //BINCMDLIST(sha512sum) | |
| 185 | 185 | ASTCMDLIST(sum) | |
| 186 | 186 | ASTCMDLIST(sync) | |
| 187 | 187 | ASTCMDLIST(tail) | |
| 188 | 188 | ASTCMDLIST(tee) | |
| 189 | 189 | //BINCMDLIST(tr) | |
| 190 | 190 | //ASTCMDLIST(tr) | |
| 191 | 191 | ASTCMDLIST(tty) | |
| 192 | 192 | ASTCMDLIST(uname) | |
| 193 | 193 | ASTCMDLIST(uniq) | |
| 194 | 194 | //ASTCMDLIST(vmstate) | |
| 195 | 195 | ASTCMDLIST(wc) | |
| 196 | 196 | // ASTCMDLIST(xgrep) | |
| 197 | 197 | //BINCMDLIST(xargs) | |
| 198 | 198 | //ASTCMDLIST(xargs) | |
| 199 | 199 | ||
| 200 | 200 | #ifdef __cplusplus | |
| 201 | 201 | } | |
| 202 | 202 | #endif | |
| 203 | 203 | ||
| 204 | 204 | #endif /* !_GNULINUX_KSH_CMDLIST_H */ | |
| 205 | 205 | ENDOFTEXT | |
| 206 | 206 | return 0 | |
| 207 | 207 | } | |
| 208 | 208 | ||
| 209 | 209 | src_compile() | |
| 210 | 210 | { | |
| 211 | 211 | cd ${S} | |
| 212 | 212 | ||
| 213 | 213 | # | |
| 214 | 214 | # prepare build | |
| 215 | 215 | # | |
| 216 | 216 | ||
| 217 | 217 | # translate cygport ARCH to AST hosttype | |
| 218 | 218 | if [[ "$ARCH" == 'i686' ]] ; then | |
| 219 | 219 | ast_hosttype='cygwin.i386' | |
| 220 | 220 | elif [[ "$ARCH" == 'x86_64' ]] ; then | |
| 221 | 221 | ast_hosttype='cygwin.i386-64' | |
| 222 | 222 | else | |
| 223 | 223 | false | |
| 224 | 224 | fi | |
| 225 | 225 | ||
| 226 | 226 | gnulinux_builtin_header="${PWD}/tmp_gnulinux_builtin_header.h" | |
| 227 | 227 | print_gnulinux_builtin_header >"${gnulinux_builtin_header}" | |
| 228 | 228 | ||
| 229 | 229 | # ksh93+AST config flags | |
| 230 | 230 | bast_flags="-DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_CMDLIB_HDR=\\\"${gnulinux_builtin_header}\\\" -DSHOPT_SYSRC" | |
| 231 | 231 | ||
| 232 | 232 | # build debug | |
| 233 | 233 | #export IFFEFLAGS=-d1 | |
| 234 | 234 | ||
| 235 | 235 | # fix build issues with mkfifo | |
| 236 | 236 | sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./src/cmd/INIT/package.sh ./bin/package | |
| 237 | 237 | ||
| 238 | 238 | ||
| 239 | 239 | # | |
| 240 | 240 | # build AT&T AST ksh | |
| 241 | 241 | # | |
| 242 | 242 | if [[ "$ARCH" == 'i686' ]] ; then | |
| 243 | 243 | export SHELL=/bin/bash HOSTTYPE="${ast_hosttype}"; \ | |
| 244 | 244 | /bin/bash ./bin/package make \ | |
| 245 | 245 | CC="/usr/bin/gcc -m32 -std=gnu17" CCFLAGS="-Os -g ${bast_flags}" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE" | |
| 246 | 246 | elif [[ "$ARCH" == 'x86_64' ]] ; then | |
| 247 | 247 | export SHELL=/bin/bash HOSTTYPE="${ast_hosttype}"; \ | |
| 248 | 248 | /bin/bash ./bin/package make \ | |
| 249 | 249 | CC="/usr/bin/gcc -m64 -std=gnu17" CCFLAGS="-Os -g ${bast_flags}" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE" | |
| 250 | 250 | else | |
| 251 | 251 | # unsupported arch! | |
| 252 | 252 | false | |
| 253 | 253 | fi | |
| 254 | 254 | ||
| 255 | 255 | ||
| 256 | 256 | # | |
| 257 | 257 | # create ksh.kshrc | |
| 258 | 258 | # | |
| 259 | 259 | { | |
| 260 | 260 | printf '#\n# /etc/ksh.kshrc+~/.kshrc are sourced only for interactive shells\n#\n\n' | |
| 261 | + | printf '# default prompt\n' | |
| 261 | 262 | printf 'PS1=%q\n' $'\E[32m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[33m${PWD/~(Sl-r)$HOME/"~"}\E[0m\n$ ' | |
| 263 | + | printf '# default editor mode\n' | |
| 262 | 265 | } >${S}/etc_ksh_kshrc | |
| 263 | 266 | } | |
| 264 | 267 | ||
| 265 | 268 | # | |
| 266 | 269 | # install ksh, rksh, shcomp | |
| 267 | 270 | # | |
| 268 | 271 | src_install() | |
| 269 | 272 | { | |
| 270 | 273 | if [[ "$ARCH" == 'i686' ]] ; then | |
| 271 | 274 | ast_hosttype='cygwin.i386' | |
| 272 | 275 | elif [[ "$ARCH" == 'x86_64' ]] ; then | |
| 273 | 276 | ast_hosttype='cygwin.i386-64' | |
| 274 | 277 | else | |
| 275 | 278 | false | |
| 276 | 279 | fi | |
| 277 | 280 | ||
| 278 | 281 | /usr/bin/install -D -m0755 ${S}/arch/${ast_hosttype}/bin/ksh.exe ${D}/bin/ksh.exe | |
| 279 | 282 | ln ${D}/bin/ksh.exe ${D}/bin/rksh.exe | |
| 280 | 283 | ln ${D}/bin/ksh.exe ${D}/bin/ksh93.exe | |
| 281 | 284 | ln ${D}/bin/ksh.exe ${D}/bin/rksh93.exe | |
| 282 | 285 | /usr/bin/install -D -m0755 ${S}/arch/${ast_hosttype}/bin/ksh.exe ${D}/bin/shcomp.exe | |
| 283 | 286 | /usr/bin/install -D -m0644 ${S}/arch/${ast_hosttype}/man/man1/sh.1 ${D}/usr/share/man/man1/ksh.1 | |
| 284 | 287 | /usr/bin/install -D -m0644 ${S}/etc_ksh_kshrc ${D}/etc/ksh.kshrc | |
| 285 | 288 | ||
| 286 | 289 | for i in ${S}/src/cmd/ksh93/tests/* ; do | |
| 287 | 290 | /usr/bin/install -D -m0644 $i ${D}/usr/share/ksh/tests/$(basename "$i") | |
| 288 | 291 | done | |
| 289 | 292 | } | |
| 290 | 293 | ||
| 291 | 294 | CYGWIN_MAINTAINER=Roland%20Mainz | |
| 292 | 295 | CYGWIN_MAINTAINER_EMAIL=roland.mainz@nrubsig.org | |
| 293 | 296 | ||
| 294 | 297 | CYGWIN_CO_MAINTAINER=Cedric%20Blancher | |
| 295 | 298 | CYGWIN_CO_MAINTAINER_EMAIL=cedric.blancher@gmail.com | |
| 296 | 299 | ||
| 297 | 300 | # EOF. | |
| 298 | 301 |
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
nrubsig.kpaste.net RSS