Created
December 24, 2019 09:11
-
-
Save dxps/004999452e95de9058de2edc1656ca04 to your computer and use it in GitHub Desktop.
Install TMUX on MacOS without Brew
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/sh | |
## setup _________________________________ | |
TMUX_VER=2.9a | |
LIBEVENT_VER=2.1.11-stable | |
TEMP_COMPILE=~/tmux-temp-compile | |
COMMON_INSTALL_PREFIX=/opt | |
SYMLINK=/usr/local/bin/tmux | |
## _______________________________________ | |
echo | |
echo ">>> Creating and using temporary dir ${TEMP_COMPILE} for downloading and compiling libevent and tmux ..." | |
echo | |
mkdir ${TEMP_COMPILE} | |
cd ${TEMP_COMPILE} | |
echo | |
echo ">>> Downloading the releases ..." | |
echo | |
curl -OL https://github.com/tmux/tmux/releases/download/${TMUX_VER}/tmux-${TMUX_VER}.tar.gz | |
curl -OL https://github.com/libevent/libevent/releases/download/release-${LIBEVENT_VER}/libevent-${LIBEVENT_VER}.tar.gz | |
echo | |
echo ">>> Extracting tmux ${TMUX_VER} and libevent ${LIBEVENT_VER} ..." | |
echo | |
tar xzf tmux-${TMUX_VER}.tar.gz | |
tar xzf libevent-${LIBEVENT_VER}.tar.gz | |
echo | |
echo ">>> Compiling libevent ..." | |
echo | |
cd libevent-${LIBEVENT_VER} | |
./configure --prefix=${COMMON_INSTALL_PREFIX} | |
sudo make | |
sudo make install | |
echo | |
echo ">>> Compiling tmux ..." | |
echo | |
cd ../tmux-${TMUX_VER} | |
LDFLAGS="-L${COMMON_INSTALL_PREFIX}/lib" CPPFLAGS="-I${COMMON_INSTALL_PREFIX}/include" LIBS="-lresolv" ./configure --prefix=${COMMON_INSTALL_PREFIX} | |
make | |
echo | |
echo ">>> Installing tmux in ${COMMON_INSTALL_PREFIX}/bin ..." | |
echo | |
sudo make install | |
echo | |
echo ">>> Symlink to it from ${SYMLINK} ..." | |
sudo ln -sf ${COMMON_INSTALL_PREFIX}/bin/tmux ${SYMLINK} | |
echo | |
echo ">>> Cleaning up by removing the temporary dir ${TEMP_COMPILE} ..." | |
echo | |
cd .. | |
sudo rm -rf ${TEMP_COMPILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script is based on this one, updated with externalized setup variables and more verbosity mainly.
I just ran it again now on a brand new MacOS, before posting here, to make sure it works flawlessly.