LoginSignup
66
65

More than 5 years have passed since last update.

tmuxをローカルインストールする時のメモ

Last updated at Posted at 2014-02-28

tmuxのビルドにはlibevent2が必要なのだが、Cenなんとか7の時代になってもまだリポジトリにないままである。
libevent1ならあるが、これではmakeしたときに定数の未定義エラーが出る。
ふっっっるいCenほにゃららとかいうOS使うと、そもそもlibevent無い時あるよねー。

cd
mkdir local
cd local
mkdir src
cd src
# Get&build libevent
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar zxf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=${HOME}/local
make
make install
# Get & build ncurses
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz
tar zxf ncurses-6.0.tar.gz
cd ncurses-6.0
./configure --enable-pc-files --prefix=${HOME}/local --with-pkg-config-libdir=${HOME}/local/lib/pkgconfig --with-termlib
make
make install
# Get tmux
wget https://github.com/tmux/tmux/releases/download/2.6/tmux-2.6.tar.gz
tar zxf tmux-2.6.tar.gz
cd tmux-2.6
PKG_CONFIG_PATH=${HOME}/local/lib/pkgconfig ./configure --prefix=${HOME}/local
make
make install

libeventはpkg-configできるようにpcファイルを作成してくれるので、ありがたく使わせて頂く。
ncursesは--enable-pc-filesでpcファイルを作成してくれる。
tmuxバイナリは$HOME/local/binに入る。

新しいバージョンが出るたびにstaticビルドを試してみるのだが、LDパスが上手く通らず、いつもmakeに失敗してしまう。結局はいつも--enable-staticを削除してビルドを通し、tmux起動時にライブラリの場所を教えてあげることで解決している。

export LD_LIBRARY_PATH=${HOME}/local/lib:$LD_LIBRARY_PATH
66
65
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
66
65