Skip to content

Instantly share code, notes, and snippets.

@lambdalisue
Forked from nicoulaj/build-zsh.sh
Last active October 30, 2016 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdalisue/5ee9530aafd61dd05c7c4ef7abcc7fc0 to your computer and use it in GitHub Desktop.
Save lambdalisue/5ee9530aafd61dd05c7c4ef7abcc7fc0 to your computer and use it in GitHub Desktop.
Install "zsh" on Ubuntu/Debian
#!/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
@lambdalisue
Copy link
Author

lambdalisue commented Oct 30, 2016

https://git.io/vXLAa

curl -sL git.io/vXLAa | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment