Skip to content

Instantly share code, notes, and snippets.

@korymath
Created March 22, 2017 05:36
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 korymath/80d126600f08fcfb131cdf7860af5886 to your computer and use it in GitHub Desktop.
Save korymath/80d126600f08fcfb131cdf7860af5886 to your computer and use it in GitHub Desktop.
#!/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