Skip to content

Instantly share code, notes, and snippets.

@apokalyptik
Forked from haridsv/tmux_local_static_install.sh
Last active August 29, 2015 14:22
Show Gist options
  • Save apokalyptik/4704088131213bc61cd7 to your computer and use it in GitHub Desktop.
Save apokalyptik/4704088131213bc61cd7 to your computer and use it in GitHub Desktop.
# Mouse support - set to on if you want to use the mouse
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUXVER=1.9
LOCALPATH=$HOME/tmux_tmp/local
# create our directories
mkdir -p $LOCALPATH
cd $HOME/tmux_tmp
# download source files for tmux, libevent, and ncurses
wget -O tmux-$TMUXVER.tar.gz http://sourceforge.net/projects/tmux/files/tmux/tmux-$TMUXVER/tmux-$TMUXVER.tar.gz/download
wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
# extract files, configure, and compile
############
# libevent #
############
tar xvzf libevent-2.0.19-stable.tar.gz
cd libevent-2.0.19-stable
./configure --prefix=$LOCALPATH --disable-shared
make
make install
cd ..
############
# ncurses #
############
tar xvzf ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=$LOCALPATH --with-default-terminfo-dir=/usr/share/terminfo --with-terminfo-dirs="/etc/terminfo:/lib/terminfo:/usr/share/terminfo"
make
make install
cd ..
############
# tmux #
############
tar xvzf tmux-1.9.tar.gz
cd tmux-1.9
./configure --enable-static CFLAGS="-I$LOCALPATH/include -I$LOCALPATH/include/ncurses" LDFLAGS="-static -static-libgcc -L$LOCALPATH/lib -L$$LOCALPATH/include/ncurses -L$LOCALPATH/include"
CPPFLAGS="-I$LOCALPATH/include -I$LOCALPATH/include/ncurses" LDFLAGS="-static -static-libgcc -L$LOCALPATH/include -L$LOCALPATH/include/ncurses -L$LOCALPATH/lib" make
############
# install #
############
mkdir -p $HOME/bin
cp tmux $HOME/bin
cd $HOME
# cleanup
rm -rf $HOME/tmux_tmp
echo "$HOME/bin/tmux is now available. You can optionally add $HOME/bin to your PATH."
@apokalyptik
Copy link
Author

Prebuilt binary download link (works on sandboxes at work)

http://blog.apokalyptik.com/wp-content/uploads/tmux

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