Skip to content

Instantly share code, notes, and snippets.

@sturadnidge
Last active December 10, 2017 01:13
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 sturadnidge/8f34c628b4e7dc7fdc79de6026a6b54f to your computer and use it in GitHub Desktop.
Save sturadnidge/8f34c628b4e7dc7fdc79de6026a6b54f to your computer and use it in GitHub Desktop.
Install tmux on macOS 10.12 without need for brew or OpenSSL
#
# all credit to https://gist.github.com/shrayasr/8714601#gistcomment-2127790
#
## setup
TMUX_VER=2.6
LIBEVENT_VER=2.1.8-stable
TEMP_COMPILE=~/tmux-temp-compile
COMMON_INSTALL_PREFIX=/usr/local
##
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 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} --disable-openssl
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 ">>> Cleaning up by removing the temporary dir ${TEMP_COMPILE} ..."
echo
cd ..
sudo rm -rf ${TEMP_COMPILE}
@sturadnidge
Copy link
Author

Tested with 2.5 and 2.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment