Skip to content

Instantly share code, notes, and snippets.

@moshohayeb
Created May 4, 2019 16:18
Show Gist options
  • Save moshohayeb/d2948e5e66e55b5a7da6eb64cc357ab2 to your computer and use it in GitHub Desktop.
Save moshohayeb/d2948e5e66e55b5a7da6eb64cc357ab2 to your computer and use it in GitHub Desktop.
Tmux static build
#!/bin/bash
# USE Ubuntu 18.11 for path of least resistance
TARGETDIR=$1
if [ "$TARGETDIR" = "" ]; then
TARGETDIR=/root/local
fi
mkdir -p $TARGETDIR
libevent() {
curl -LO https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -zxvf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=$TARGETDIR && make && make install
cd ..
}
ncurses() {
curl -LO https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
tar zxvf ncurses-6.1.tar.gz
cd ncurses-6.1
./configure --prefix $TARGETDIR \
--with-default-terminfo-dir=/usr/share/terminfo \
--with-terminfo-dirs="/etc/terminfo:/lib/terminfo:/usr/share/terminfo" \
--enable-pc-files \
--with-pkg-config-libdir=$HOME/local/lib/pkgconfig \
&& make && make install
cd ..
}
tmux() {
curl -LO https://github.com/tmux/tmux/releases/download/2.9a/tmux-2.9a.tar.gz
tar zxvf tmux-2.9a.tar.gz
cd tmux-2.9a
PKG_CONFIG_PATH=$TARGETDIR/lib/pkgconfig ./configure --enable-static --prefix=$TARGETDIR && make && make install
cd ..
cp $TARGETDIR/bin/tmux .
}
libevent
ncurses
tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment