| 1 | # Wedge definition for zsh
|
| 2 | #
|
| 3 | # Loaded by deps/wedge.sh.
|
| 4 |
|
| 5 | set -o nounset
|
| 6 | set -o pipefail
|
| 7 | set -o errexit
|
| 8 |
|
| 9 | # sourced
|
| 10 | WEDGE_NAME='zsh'
|
| 11 |
|
| 12 | # Validate requested version against this list
|
| 13 | # The global variable WEDGE_VERSION gets SET after validation.
|
| 14 | WEDGE_VERSION_LIST='5.1.1 5.9'
|
| 15 |
|
| 16 | wedge-make() {
|
| 17 | local src_dir=$1
|
| 18 | local build_dir=$2
|
| 19 | local install_dir=$3
|
| 20 |
|
| 21 | # FIX for zsh 5.1.1 "cannot guess build type" error on ARM64 / aarch64
|
| 22 | # It has an old (2009) config.guess that predates the introduction of ARM64 in 2011
|
| 23 | local arch_flags=""
|
| 24 | if [[ "$(uname -m)" == "aarch64" && "$WEDGE_VERSION" == "5.1.1" ]]; then
|
| 25 | arch_flags="--build=aarch64-unknown-linux-gnu"
|
| 26 | fi
|
| 27 |
|
| 28 | # FIX for Github Actions, there's "no controlling tty", so add --with-tcsetpgrp
|
| 29 | # https://www.linuxfromscratch.org/blfs/view/7.5/postlfs/zsh.html
|
| 30 |
|
| 31 | # Fedora has a conflict with zsh/Src/Modules/termcap.c and
|
| 32 | # /usr/include/term.h
|
| 33 | # Happens from zsh 5.1.1 all the way to zsh 5.9.
|
| 34 | # This doesn't happen on Debian/Ubuntu.
|
| 35 |
|
| 36 | # This creates config.modules
|
| 37 |
|
| 38 | # 2025-10:
|
| 39 | # CFLAGS="-Wno-error=incompatible-pointer-types" added for zsh 5.1.1 on GCC 15 (Arch/Fedora)
|
| 40 | # zsh 5.9 probably doesn't need it?
|
| 41 |
|
| 42 | time $src_dir/configure \
|
| 43 | $arch_flags \
|
| 44 | --disable-dynamic --with-tcsetpgrp \
|
| 45 | --prefix=$install_dir \
|
| 46 | CFLAGS="-Wno-error=incompatible-pointer-types"
|
| 47 |
|
| 48 | # For some reason the regex module isn't included if we --disable-dynamic?
|
| 49 | # name=zsh/regex modfile=Src/Modules/regex.mdd link=no
|
| 50 | # ->
|
| 51 | # name=zsh/regex modfile=Src/Modules/regex.mdd link=static
|
| 52 |
|
| 53 | # INSTALL says I need this after editing config.modules.
|
| 54 | sed -i 's/regex.mdd link=no/regex.mdd link=static/' config.modules
|
| 55 | make prep
|
| 56 |
|
| 57 | time make
|
| 58 | # make test?
|
| 59 | }
|
| 60 |
|
| 61 | wedge-install() {
|
| 62 | local build_dir=$1
|
| 63 |
|
| 64 | pushd $build_dir
|
| 65 |
|
| 66 | #time make install-strip
|
| 67 | time make install
|
| 68 |
|
| 69 | popd
|
| 70 | }
|
| 71 |
|
| 72 | wedge-smoke-test() {
|
| 73 | local install_dir=$1
|
| 74 |
|
| 75 | $install_dir/bin/zsh -c 'echo "hi from zsh"'
|
| 76 |
|
| 77 | # Create symlinks for use in spec tests
|
| 78 | pushd $install_dir/bin
|
| 79 | ln -s -f -v zsh zsh-$WEDGE_VERSION
|
| 80 | popd
|
| 81 | }
|