pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


ksh93.cygport prototype
Posted by Anonymous on Mon 5th Feb 2024 02:41
raw | new post
view followups (newest first): ksh93.cygport prototype by Anonymous
modification of post by Anonymous (view diff)

  1. #
  2. # ksh93.cygport
  3. #
  4. # Copyright (C) 2024, Roland Mainz <roland.mainz@nrubsig.org>
  5. #
  6. # This file is free software; I give unlimited permission to copy and/or
  7. # distribute it, with or without modifications, as long as this notice is
  8. # preserved.
  9. #
  10.  
  11. NAME=ksh
  12. LICENSE="Eclipse Public License - v 2.0"
  13. HOMEPAGE="https://github.com/ksh93/ksh"
  14. VERSION=1.0.8
  15. RELEASE=0
  16.  
  17. PKG_NAMES="ksh ksh_devel"
  18.  
  19. ksh_SUMMARY="The AT&T Korn Shell"
  20. ksh_DESCRIPTION="Original version of the AT&T AST Korn Shell 93."
  21. ksh_CATEGORY="Base Shells"
  22. ksh_CONTENTS=" \
  23.         bin/ksh.exe \
  24.         bin/ksh93.exe \
  25.         bin/rksh.exe \
  26.         bin/rksh93.exe \
  27.         etc/ksh.kshrc \
  28.         usr/share/doc/ksh \
  29.         usr/share/man/man1 \
  30. "
  31.  
  32. ksh_devel_SUMMARY="Development files for AT&T ksh"
  33. ksh_devel_DESCRIPTION="This package contains development tools and scripts for AT&T ksh"
  34. ksh_devel_CATEGORY="Devel"
  35. ksh_devel_CONTENTS="usr/share/ksh \
  36.         bin/shcomp.exe \
  37. "
  38.  
  39. SRC_URI="https://github.com/ksh93/ksh/archive/refs/tags/v1.0.8.zip"
  40.  
  41. PATCH_URI_BASE=""
  42.  
  43. BUILD_REQUIRES=" \
  44.    bash \
  45.    coreutils \
  46.    bison \
  47.    gcc-g++ \
  48.    libiconv-devel \
  49.    libintl-devel \
  50.    libncurses-devel \
  51.    make \
  52.    sed \
  53.    texinfo \
  54. "
  55.  
  56. CPPFLAGS=
  57. CYGCONF_ARGS=
  58. DIFF_EXCLUDES=
  59. DOCS=
  60.  
  61. src_compile()
  62. {
  63.         cd ${S}
  64.  
  65.         # fix build issues with mkfifo
  66.         sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./src/cmd/INIT/package.sh ./bin/package
  67.  
  68.         # build ksh93
  69.         if [[ "$ARCH" == 'i686' ]] ; then
  70.                      export SHELL=/bin/bash HOSTTYPE="cygwin.i386"; \
  71.                         /bin/bash ./bin/package make \
  72.                                 CC="/usr/bin/cc -std=gnu17" CCFLAGS="-Os -g" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE"
  73.         elif [[ "$ARCH" == 'x86_64' ]] ; then
  74.                 export SHELL=/bin/bash HOSTTYPE="cygwin.i386-64"; \
  75.                         /bin/bash ./bin/package make \
  76.                                 CC="/usr/bin/cc -std=gnu17" CCFLAGS="-Os -g" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE"
  77.         else
  78.                 # unsupported arch!
  79.                 false
  80.         fi
  81.  
  82.         # create ksh.kshrc
  83.         {
  84.                 printf '#\n# /etc/ksh.kshrc+~/.kshrc are sourced only for interactive shells\n#\n\n'
  85.                 printf 'PS1=%q\n' $'\E[32m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[33m${PWD/~(Sl-r)$HOME/"~"}\E[0m\n$ '
  86.         } >${S}/etc_ksh_kshrc
  87. }
  88.  
  89. #
  90. # install ksh, rksh, shcomp
  91. #
  92. src_install()
  93. {
  94.         /usr/bin/install -D -m0755 ${S}/arch/cygwin.i386-64/bin/ksh.exe ${D}/bin/ksh.exe
  95.         ln ${D}/bin/ksh.exe ${D}/bin/rksh.exe
  96.         ln ${D}/bin/ksh.exe ${D}/bin/ksh93.exe
  97.         ln ${D}/bin/ksh.exe ${D}/bin/rksh93.exe
  98.         /usr/bin/install -D -m0755 ${S}/arch/cygwin.i386-64/bin/ksh.exe ${D}/bin/shcomp.exe
  99.         /usr/bin/install -D -m0644 ${S}/arch/cygwin.i386-64/man/man1/sh.1 ${D}/usr/share/man/man1/ksh.1
  100.         /usr/bin/install -D -m0644 ${S}/etc_ksh_kshrc ${D}/etc/ksh.kshrc
  101.  
  102.         for i in ${S}/src/cmd/ksh93/tests/* ; do
  103.                 /usr/bin/install -D -m0644 $i ${D}/usr/share/ksh/tests/$(basename "$i")
  104.         done
  105. }
  106.  
  107. CYGWIN_MAINTAINER=Roland%20Mainz
  108. CYGWIN_MAINTAINER_EMAIL=roland.mainz@nrubsig.org
  109.  
  110. CYGWIN_CO_MAINTAINER=Cedric%20Blancher
  111. CYGWIN_CO_MAINTAINER_EMAIL=cedric.blancher@gmail.com
  112.  
  113. # EOF.

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at