Last active
December 14, 2015 14:02
-
-
Save belminf/a72bfee9c9556c584d09 to your computer and use it in GitHub Desktop.
Install tmux statically from source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit on error | |
set -e | |
TMUX_URL=https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz | |
PREFIX=$HOME/local | |
TMP_DL_DIR="$(mktemp -d --suffix .tmux_install)" | |
cd $TMP_DL_DIR | |
## REQUIREMENTS: | |
# RHEL: | |
# $ sudo yum install glibc-static libevent-devel ncurses-devel | |
# | |
# Source: | |
# LIBEVENT_URL=https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz | |
# NCURSES_URL=ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz | |
# wget -q -O libevent.tar.gz $LIBEVENT_URL | |
# wget -q -O ncurses.tar.gz $NCURSES_URL | |
# for source_tarball in *.tar.gz | |
# do | |
# tar -xzf $source_tarball | |
# done | |
# cd $TMP_DL_DIR/libevent* | |
# ./configure --prefix $TMP_PREFIX_DIR --disable-shared | |
# make && make install | |
# cd $TMP_DL_DIR/ncurses* | |
# ./configure --prefix $TMP_PREFIX_DIR | |
# make && make install | |
wget -q -O tmux.tar.gz $TMUX_URL | |
tar -xzf tmux*.tar.gz | |
cd $TMP_DL_DIR/tmux* | |
./configure --prefix $PREFIX --enable-static CFLAGS="-I${PREFIX}/include" LDFLAGS="-L${PREFIX}/lib" LIBEVENT_CFLAGS="-I${PREFIX}/include" LIBEVENT_LIBS="-L${PREFIX}/lib -levent" | |
make && make install | |
# Exit | |
rm -rf $TMP_DL_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment