#!/bin/sh # Build Zsh from sources on Ubuntu. # From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file. if ! which porg >/dev/null 2>&1; then echo 'A program manager "porg" is required.' echo 'Install it via the following command' echo '' echo ' curl -sL git.io/vXTo7 | bash' echo '' echo 'Ref: https://gist.github.com/lambdalisue/161aa84af9a9ff7d3bfe9decfabf656a' exit 1 fi set -e unset rep atexit() { [[ -d "$rep" ]] && rm -rf $rep } trap atexit HUP INT QUIT TERM rep=$(realpath $(mktemp -d zsh.XXXXXX)) # Some packages may be missing sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo git clone --depth 1 --single-branch http://git.code.sf.net/p/zsh/code $rep cd $rep ./Util/preconfig ./configure --prefix=/usr/local \ --enable-maildir-support \ --enable-max-jobtable-size=256 \ --enable-function-subdirs \ --with-tcsetpgrp \ --with-term-lib="ncursesw" \ --enable-cap \ --enable-pcre \ --enable-readnullcmd=pager \ --enable-custom-patchlevel=Debian \ LDFLAGS="-Wl,--as-needed -g" make -j $(grep -c '^processor' /proc/cpuinfo) make check sudo porg -lp 'zsh' 'make install' sudo porg -lp 'zsh.info' 'make install.info' atexit