zsh: Return 0 from command_not_found_handler
[termux-packages] / packages / zsh / build.sh
CommitLineData
8927f8fb 1TERMUX_PKG_HOMEPAGE=https://www.zsh.org
59f0d218 2TERMUX_PKG_DESCRIPTION="Shell designed for interactive use, although it is also a powerful scripting language"
fe66968b
FF
3_FOLDERVERSION=5.2
4TERMUX_PKG_VERSION=${_FOLDERVERSION}.0
8927f8fb
FF
5TERMUX_PKG_BUILD_REVISION=5
6TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/zsh/zsh/$_FOLDERVERSION/zsh-${_FOLDERVERSION}.tar.xz
fe66968b 7TERMUX_PKG_RM_AFTER_INSTALL="bin/zsh-${_FOLDERVERSION}"
3cc4ef71 8TERMUX_PKG_DEPENDS="libandroid-support, ncurses, termux-tools, command-not-found"
59f0d218 9TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-etcdir=$TERMUX_PREFIX/etc --disable-gdbm --disable-pcre ac_cv_header_utmp_h=no"
9fc0086f 10TERMUX_PKG_CONFFILES="etc/zshrc"
77a8de76
FF
11
12# Below needed to force dynamically loaded binary modules, but does not currently work:
2ba1fa72 13# TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" zsh_cv_shared_environ=yes"
3cc4ef71 14
77a8de76
FF
15termux_step_post_configure () {
16 # INSTALL file: "For a non-dynamic zsh, the default is to compile the complete, compctl, zle,
17 # computil, complist, sched, # parameter, zleparameter and rlimits modules into the shell,
18 # and you will need to edit config.modules to make any other modules available."
19 # Since we build zsh non-dynamically (since dynamic loading doesn't work on Android when enabled),
20 # we need to explicitly enable the additional modules we want.
9fc0086f 21 # - The files module is needed by `compinstall` (https://github.com/termux/termux-packages/issues/61).
0b5eaee9 22 # - The regex module seems to be used by several extensions.
9fc0086f 23 # - The curses, socket and zprof modules was desired by BrainDamage on IRC (#termux).
4d8dd314
FF
24 # - The deltochar and mathfunc modules is used by grml-zshrc (https://github.com/termux/termux-packages/issues/494).
25 for module in files regex curses zprof socket deltochar mathfunc; do
9fc0086f
FF
26 perl -p -i -e "s|${module}.mdd link=no|${module}.mdd link=static|" $TERMUX_PKG_BUILDDIR/config.modules
27 done
77a8de76
FF
28}
29
3cc4ef71
FF
30termux_step_post_make_install () {
31 # /etc/zshrc - Run for interactive shells (http://zsh.sourceforge.net/Guide/zshguide02.html):
32 sed "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" $TERMUX_PKG_BUILDER_DIR/etc-zshrc > $TERMUX_PREFIX/etc/zshrc
4eb87e93
FF
33
34 # Remove zsh.new/zsh.old/zsh-$version if any exists:
35 rm -f $TERMUX_PREFIX/{zsh-*,zsh.*}
e46c5cbc
FF
36
37 # This should perhaps be done in a more general way? Doing it here
38 # to silence "compaudit" warnings:
fe66968b 39 chmod 700 $TERMUX_PREFIX/share/{zsh,zsh/$_FOLDERVERSION}
e46c5cbc
FF
40}
41
42termux_step_create_debscripts () {
43 # For already installed packages:
fe66968b 44 echo "chmod 700 $TERMUX_PREFIX/share/zsh" > postinst
4d8dd314
FF
45 echo "exit 0" >> postinst
46 chmod 0755 postinst
3cc4ef71 47}