-
Notifications
You must be signed in to change notification settings - Fork 496
Add ksh93 [new package] #5243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add ksh93 [new package] #5243
Changes from 5 commits
d916f41
3cbe086
ea01caa
73c30b0
0b2a33a
c070df3
f1856d8
ac0699e
32b9502
be34b8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,124 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# This took a lot of trial and error. There possibly should be patches from the linked gisburn repo and the ones from debian and red hat. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||||||||||||||||||||||||
pkgname=ksh93 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
pkgver=1.0.10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
pkgrel=1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
pkgdesc="The Original ATT Korn Shell, Now Maintained By The Community." | ||||||||||||||||||||||||||||||||||||||||||||||||||||
arch=('x86_64') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
url="https://www.github.com/ksh93/ksh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
license=('spdx:EPL-2.0') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add a
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the leading slash supposed to not be there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is not. MSYS2-packages/filesystem/PKGBUILD Lines 18 to 20 in 5feac36
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# These makedeps were suggested by 'gisburn' in a ksh93 issue. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
makedepends=( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'gcc' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'gdb' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'make' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'gettext' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'gettext-devel' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'flex' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'bison' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'unzip' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'pax' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'tar' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'libiconv-devel' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'ncurses-devel' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'gmp-devel' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'mpfr-devel' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'mpc-devel' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'isl-devel' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'procps-ng' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no way all of these are actually needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know what I was doing honestly. I just saw someone else from the ksh93 repo say you should install that and just dropped it in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
maybe adding back
if it's demonstrated they're actually used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not going to include libiconv-devel because it completely fails if the GNU one is installed, I have to patch out looking for the system wide libiconv and use the bundled one instead. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
# There exists already a package that provides ksh.exe, mksh, so I will set this to be a conflict. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# Unless there can be a convincing reason to let both packages be installed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
conflicts=('mksh') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
source=("${pkgname}-${pkgver}.zip"::https://github.com/ksh93/ksh/archive/refs/tags/v1.0.10.zip | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'ksh.kshrc') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
sha256sums=('ab412118ce9527c6d805335080593fa874a0b859e9229c172f3fcf55d26f92e9' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'SKIP') | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# This is necessary | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export PATH="/bin:/usr/bin:$gccdir:$gccdir/include:/usr/include" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't do this globally... Several things have to source PKGBUILDs to try to extract variables from them, and they don't need their paths messed up. BTW, where is gccdir set where this could see it, and why on earth would you want include dirs in the PATH? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I must have removed that variable and forgot to delete references to it. It works without it, so I'll remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have had multiple failures including another one here because cc1.exe cannot be found. It only works if I explicitly put it in the PATH for some reason. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Things might get a bit messary, prepare yourselves. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# I really should use gisburn's kshrc default config. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
build() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
cd "${srcdir}/ksh-${pkgver}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
export CYGWIN_CHOST="${CHOST/-msys/-cygwin}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is used in other PKGBUILDs as an argument to configure. I don't see you using it anywhere here, and I doubt ksh93's build scripts expect it to be set. Maybe you could try |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Do not, I repeat, DO NOT delete the src subdir. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# For now, multiple rounds must be done. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Bit of a workaround with cc1.exe not found for some reason. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export gccdir="/usr/lib/gcc/x86_64-pc-msys/13.3.0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export PATH="/bin:/usr/bin:$gccdir:$gccdir/include:/usr/include" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Additional weird workaround. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export CFLAGS="-I/usr/lib/gcc/x86_64-pc-msys/13.3.0/include" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export CFLAGS="$CFLAGS -L/usr/lib/gcc/x86_64-pc-msys/13.3.0 -L/usr/lib" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export CCFLAGS="${CFLAGS} -fno-use-linker-plugin" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
export LIBRARY_PATH="/usr/lib/gcc/x86_64-pc-msys/13.3.0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
export PATH="$PATH:$PWD/arch/msys.i386/lib/probe/C/make" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# What the inane build system does by default is | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# entirely a shell script system. It sets 'chmod +x' to the script | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# but that does nothing with windows. Need to append | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# shebang at the start. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
sed -i '1s/^/#!\/usr\/bin\/bash\n/' src/cmd/INIT/mamprobe.sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||
sed -i '6s/^/#undef _lib_iconv_open\n/' src/lib/libast/features/iconv # Without this, fails with libiconv installed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# It WILL fail during the first round. It MUST be ran twice. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
printf "This WILL show an error at some point. This is to be expected.\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
printf "The build command is ran twice because of fork() issue.\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
printf "\n\nRound 1 begins now.\n\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
sleep 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
CC="/usr/bin/gcc" /usr/bin/bash bin/package make PACKAGEROOT="$PWD" || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
printf "\n\nSecond and final round begins now.\n\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
sleep 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
CC="/usr/bin/gcc" /usr/bin/bash bin/package make PACKAGEROOT="$PWD" || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
sleep 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
printf "\n\nFinished!\n\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
sleep 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
package() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
cd "${srcdir}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
install -dm0755 "${pkgdir}/etc/skel" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. were you intending to put something in /etc/skel? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably shouldn't have had that line, I was copying from the arch linux one I found on aur. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
install -dm0755 "${pkgdir}/usr/share/ksh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
install -dm0755 "${pkgdir}/usr/share/doc/ksh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
install -dm0755 "${pkgdir}/usr/share/licenses/ksh" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Install the core components of ksh93 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
cd "${srcdir}/ksh-${pkgver}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
CC="/usr/bin/gcc" /usr/bin/bash bin/package install "${pkgdir}/usr" PACKAGEROOT="$PWD" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# install ksh sample rc file | ||||||||||||||||||||||||||||||||||||||||||||||||||||
install -Dm644 "${srcdir}/ksh.kshrc" "${pkgdir}/etc/ksh.kshrc" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Install copyright and license files | ||||||||||||||||||||||||||||||||||||||||||||||||||||
install -Dm0644 LICENSE.md "${pkgdir}/usr/share/licenses/ksh/LICENSE.md" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
install -Dm0644 COPYRIGHT "${pkgdir}/usr/share/licenses/ksh/COPYRIGHT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
local _docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||
for _docs in 'builtins.mm' 'COMPATIBILITY' 'DESIGN' 'OBSOLETE' 'PROMO.mm' 'README' 'README-AUDIT.md' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
'RELEASE' 'RELEASE88' 'RELEASE93' 'sh.memo' 'TYPES'; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||
install -Dm0644 "src/cmd/ksh93/${_docs}" "${pkgdir}/usr/share/doc/ksh/${_docs}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
done | ||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatting |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Because ksh.exe, like mksh, provided by this package and often people want to specify ksh93, | ||||||||||||||||||||||||||||||||||||||||||||||||||||
# I will make a copy of of the ksh executable naming it ksh93.exe. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
cp "${pkgdir}/usr/bin/ksh.exe" "${pkgdir}/usr/bin/ksh93.exe" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
# Lastly, move ksh-specific /usr/share/fun to /usr/share/ksh/functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||
mv "${pkgdir}/usr/share/fun" "${pkgdir}/usr/share/ksh/functions" | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# If you want to edit or add to this file, | ||
# create $HOME/.kshrc and put it in there. Only this file and | ||
# $HOME/.kshrc are sourced when interactive. | ||
|
||
PS1=$'\E[1;91m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[1;33m${PWD/~(Sl-r)$HOME/"~"}\E[0m$ ' | ||
|
||
# You can change to vi if you want to. | ||
set -o emacs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.