2018/04/15

tmux 2.7 を全角記号対応させる

2018/03/29 に tmux 2.7 がリリースされました。
ということで自分用の border-ascii 版も update しました。(2.6 の時はこんな感じ)
実際やったことは cherry-pick して細かいところの修正とか。


環境

  • OS: macOS 10.12.6
  • tmux: 2.7-border-ascii (65784831fcf0040b78d68b180c6ca8c1210e4317)
  • utf8proc: 2.1(562edab805b82d66622914d06a5da3f53cd54a17)
  • Homebrew: 1.6.0-19-gf9f9dbc
  • Homebrew/homebrew-core: (git revision 6e3b1; last commit 2018-04-14)


利用方法

  • $ brew tap atton/customs
  • $ brew install atton/customs/utf8proc
  • $ brew install --HEAD atton/customs/tmux
これで縦に画面分割する時の線が - になります。
--------------------------------- みたいな感じですね。


おまけ: update 手順

私は tmux の自分用 fork を持っているので、まずはそれに patch を当ててビルド。
OK なら homebrew の formula にしてインストール。
最後に homebrew の tap としてインストール、という流れで作業をしました。
今回はちょろっとした問題があったので、メモてがら書いておきます。


tmux の make

まずは最新の tmux を落としてきてpatch を当てます。
  • $ git pull upstream # upstream は公式の tmux/tmux です。
  • $ git checkout 2.7
  • $ git cherry-pick border-ascii # patch の 1 commit を拾います
  • $ git checkout -b 2.7-border-ascii
これで patched 2.7 ができました。

次に make します。
  • $ ./configure --enable-utf8proc
  • $ make
すると以下のような文言が。

WARNING: 'aclocal-1.15' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] Error 127
んー。 aclocal はあるのだけれどどうしてかな。
  • $ which aclocal
    • /usr/local/bin/aclocal
  • $ aclocal --version
    • aclocal (GNU automake) 1.16.1
バージョンが 1.15 固定じゃないと動かないとかなのだろうか。

とりあえず調べてみる。
そうすると
  • $ touch *
うーん。タイムスタンプ周りの問題か。
にしてもこんなんで解決……しました。はい。
ということで動作確認。
  • $ ./tmux -V
    • tmux master
  • $ tmux
    • うん。問題無く起動するし画面分割も問題無し。
手で make する分には動く状態になりました。
ということで github の自分用 fork に反映
  • $ git push


formula の修正

さて、お次は brew で install できるようにします。
自分用の formula は atton/customs で持っているのでそこへ修正をかける。
その前に local の repository で install できるかを確認します。

素直に 2.6 を 2.7 に置換して、local で install
  • $ brew install --HEAD tmux.rb
とすると
Error: Calling <<-EOS.undent is disabled!
Use <<~EOS instead.
と怒られた。ので素直に <<~ を使う

もう一度 install
  • $ brew install --HEAD tmux.rb
install できました。 tmux -V は tmux master と出るので少々確認しづらいですが。


homebrew の tap へ反映

最後に homebrew の tap で使えるようにします。
といっても既に repository は作ってあるので、そこに push するだけです。
さて、最後の install 確認。
  • $ brew install --HEAD atton/customs/tmux
問題無く install されました。良し良し。

0 件のコメント:

コメントを投稿