Skip to content

Instantly share code, notes, and snippets.

@ashwinvis
Last active September 2, 2016 08:39
Show Gist options
  • Save ashwinvis/3d5120ace1f080f3d6d61e65486494f5 to your computer and use it in GitHub Desktop.
Save ashwinvis/3d5120ace1f080f3d6d61e65486494f5 to your computer and use it in GitHub Desktop.
Tmux local installation without root
#!/bin/bash
#
# Add the following lines to .bashrc before running the script
#
# export SCRATCH=/scratch/$USER
# export XDG_DATA_DIRS=$XDG_DATA_DIRS:$SCRATCH/.local/share
# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCRATCH/.local/lib
# export PATH=$PATH:$SCRATCH/.local/bin
set -e
tmuxver=2.2
libeventver=2.0.22
DESTDIR=$SCRATCH/.local
mkdir -p /tmp/libevent
mkdir -p /tmp/tmux
mkdir -p $DESTDIR
# Install libevent
cd /tmp/libevent
wget https://github.com/libevent/libevent/archive/release-$libeventver-stable.zip
unzip release-$libeventver-stable
cd libevent-release-$libeventver-stable
./autogen.sh
./configure --prefix=$DESTDIR --sysconfdir=$DESTDIR/etc
make
make check
make install
# Install tmux
cd /tmp/tmux
wget https://github.com/tmux/tmux/releases/download/$tmuxver/tmux-$tmuxver.tar.gz
tar xzf tmux-$tmuxver.tar.gz
cd tmux-$tmuxver
LDFLAGS="-L$DESTDIR/lib" CFLAGS="-I$DESTDIR/include" ./configure --prefix=$DESTDIR
make
make install
rm -r /tmp/libevent /tmp/tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment