Skip to content

Instantly share code, notes, and snippets.

@shrayasr
Last active July 17, 2023 14:45
Show Gist options
  • Save shrayasr/8714601 to your computer and use it in GitHub Desktop.
Save shrayasr/8714601 to your computer and use it in GitHub Desktop.
[OBSOLETE] Install tmux on OSX WITHOUT brew
Check https://gist.github.com/devisions/004999452e95de9058de2edc1656ca04 for a more up to date version
# Create a directory
mkdir ~/tmux-install
cd ~/tmux-install
# Get the files
curl -OL http://downloads.sourceforge.net/tmux/tmux-1.5.tar.gz
curl -OL http://downloads.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.16-stable.tar.gz
# Extract them
tar xzf tmux-1.5.tar.gz
tar xzf libevent-2.0.16-stable.tar.gz
# Compile libevent
cd libevent-2.0.16-stable
./configure --prefix=/opt
make
sudo make install
# Compile tmux
cd ../tmux-1.5
LDFLAGS="-L/opt/lib" CPPFLAGS="-I/opt/include" LIBS="-lresolv" ./configure --prefix=/opt
make
sudo make install
# Link it
ln -s /opt/bin/tmux /usr/bin/tmux
@jnovack
Copy link

jnovack commented Nov 12, 2019

@DEVisions is the best modification at this time.

Can confirm the following variables work:

TMUX_VER=2.9a
LIBEVENT_VER=2.1.11-stable

Under the latest OSX version (as of today)

❯ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G95

@dxps
Copy link

dxps commented Nov 12, 2019

@jnovack,

Sure. Based on the previously listed script, updated the two vars, ran it again and everything went fine.
Maybe just the symlink creation should include the force flag: sudo ln -sf ${COMMON_INSTALL_PREFIX}/bin/tmux ${SYMLINK}

Result:

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G103
$
$ tmux -V
tmux 2.9a
$

@mkatychev
Copy link

mkatychev commented Dec 16, 2019

@DEVisions

you should make your own gist, this is the far superior script.

@dxps
Copy link

dxps commented Dec 24, 2019

@mkatychev
Sure, thanks, here it is.

@shrayasr
Copy link
Author

Cheers @DEVisions, I will update the gist to point to yours :)

@dxps
Copy link

dxps commented Feb 8, 2020

@shrayasr Sure! Glad to help. :)

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