-
-
Save mlzxy/64813ea1973c7f9f72355ddd23db82cd to your computer and use it in GitHub Desktop.
bash script for installing tmux without root access
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 | |
# Clean up # | |
rm -rf ~/programs/libevent | |
rm -rf ~/programs/ncurses | |
rm -rf ~/programs/tmux | |
# Variable version # | |
TMUX_VERSION=2.2 | |
# Create our directories # | |
mkdir -p ~/test | |
mkdir -p ~/programs/libevent | |
mkdir -p ~/programs/ncurses | |
mkdir -p ~/programs/tmux | |
############ | |
# libevent # | |
############ | |
cd ~/test | |
wget https://github.com/downloads/libevent/libevent/libevent-2.0.19-stable.tar.gz | |
tar xvzf libevent-2.0.19-stable.tar.gz | |
cd libevent-*/ | |
./configure --prefix=$HOME/programs/libevent --disable-shared | |
make | |
make install | |
############ | |
# ncurses # | |
############ | |
cd ~/test | |
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz | |
tar xvzf ncurses-5.9.tar.gz | |
cd ncurses-5.9 | |
./configure --prefix=$HOME/programs/ncurses LDFLAGS="-static" | |
make | |
make install | |
############ | |
# tmux # | |
############ | |
cd ~/test | |
wget -O tmux-${TMUX_VERSION}.tar.gz https://github.com/tmux/tmux/releases/download/${TMUX_VERSION}/tmux-${TMUX_VERSION}.tar.gz | |
tar xvzf tmux-${TMUX_VERSION}.tar.gz | |
cd tmux-${TMUX_VERSION} | |
# open configure and find the line that says: | |
# PKG_CONFIG="pkg-config --static" | |
# And comment it out: | |
# #PKG_CONFIG="pkg-config --static" | |
# Build # | |
./configure --prefix=$HOME/programs/tmux --enable-static CFLAGS="-I$HOME/programs/libevent/include -I$HOME/programs/ncurses/include/ncurses" LDFLAGS="-static -L$HOME/programs/libevent/lib -L$HOME/programs/libevent/include -L$HOME/programs/ncurses/lib -L$HOME/programs/ncurses/include/ncurses" PKG_CONFIG=/bin/false | |
CPPFLAGS="-I$HOME/programs/libevent/include -I$HOME/programs/ncurses/include/ncurses" LDFLAGS="-static -L$HOME/programs/libevent/lib -L$HOME/programs/libevent/include -L$HOME/programs/ncurses/lib -L$HOME/programs/ncurses/include/ncurses" make | |
# Move # | |
cp tmux ~/bin/tmux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
RUN
sh -c "$(curl -fsSL https://gist.githubusercontent.com/BenBBear/64813ea1973c7f9f72355ddd23db82cd/raw/fa0e7829e2598ea8cc5a108421521842812ea858/tmux_local_install.sh)"