| 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: 2009-era config.guess fails on ARM64 with "cannot guess build type"
|
| 22 | local arch_flags=""
|
| 23 | if test "$(uname -m)" = "aarch64" && test "$WEDGE_VERSION" = "5.1.1"; then
|
| 24 | arch_flags="--build=aarch64-unknown-linux-gnu"
|
| 25 | fi
|
| 26 |
|
| 27 | # FIX for Github Actions, there's "no controlling tty", so add --with-tcsetpgrp
|
| 28 | # https://www.linuxfromscratch.org/blfs/view/7.5/postlfs/zsh.html
|
| 29 |
|
| 30 | # Fedora has a conflict with zsh/Src/Modules/termcap.c and
|
| 31 | # /usr/include/term.h
|
| 32 | # Happens from zsh 5.1.1 all the way to zsh 5.9.
|
| 33 | # This doesn't happen on Debian/Ubuntu.
|
| 34 |
|
| 35 | # This creates config.modules
|
| 36 |
|
| 37 | # 2025-10:
|
| 38 | # CFLAGS="-Wno-error=incompatible-pointer-types" added for zsh 5.1.1 on GCC 15 (Arch/Fedora)
|
| 39 | # zsh 5.9 probably doesn't need it?
|
| 40 |
|
| 41 | time $src_dir/configure \
|
| 42 | $arch_flags \
|
| 43 | --disable-dynamic --with-tcsetpgrp \
|
| 44 | --prefix=$install_dir \
|
| 45 | CFLAGS="-Wno-error=incompatible-pointer-types"
|
| 46 |
|
| 47 | # For some reason the regex module isn't included if we --disable-dynamic?
|
| 48 | # name=zsh/regex modfile=Src/Modules/regex.mdd link=no
|
| 49 | # ->
|
| 50 | # name=zsh/regex modfile=Src/Modules/regex.mdd link=static
|
| 51 |
|
| 52 | # INSTALL says I need this after editing config.modules.
|
| 53 | sed -i 's/regex.mdd link=no/regex.mdd link=static/' config.modules
|
| 54 | make prep
|
| 55 |
|
| 56 | time make
|
| 57 | # make test?
|
| 58 | }
|
| 59 |
|
| 60 | wedge-install() {
|
| 61 | local build_dir=$1
|
| 62 |
|
| 63 | pushd $build_dir
|
| 64 |
|
| 65 | #time make install-strip
|
| 66 | time make install
|
| 67 |
|
| 68 | popd
|
| 69 | }
|
| 70 |
|
| 71 | wedge-smoke-test() {
|
| 72 | local install_dir=$1
|
| 73 |
|
| 74 | $install_dir/bin/zsh -c 'echo "hi from zsh"'
|
| 75 |
|
| 76 | # Create symlinks for use in spec tests
|
| 77 | pushd $install_dir/bin
|
| 78 | ln -s -f -v zsh zsh-$WEDGE_VERSION
|
| 79 | popd
|
| 80 | }
|