-
Notifications
You must be signed in to change notification settings - Fork 0
/
wcwidth.rb
41 lines (32 loc) · 970 Bytes
/
wcwidth.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require "formula"
class Wcwidth < Formula
homepage "https://github.com/fumiyas/wcwidth-cjk"
url "https://github.com/fumiyas/wcwidth-cjk.git"
sha256 "550ec0c384194c1558607d24fb84ef1649e7d8b125b7ca8a256c946cac33d0c0"
version "0.0.1"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
system "autoreconf --install"
system "./configure --prefix=#{prefix}"
system "make"
system "make install"
bin.install_symlink "#{prefix}/usr/local/bin/wcwidth-cjk"
lib.install_symlink "#{prefix}/usr/local/lib/wcwidth-cjk.so"
end
def caveats; <<~EOS
Run a command with $LD_PRELOAD-able library:
$ export LD_PRELOAD=/usr/local/lib/wcwidth-cjk.so
$ zsh
...
or:
$ eval `/usr/local/bin/wcwidth-cjk --sh-init`
$ zsh
...
Run a command via wrapper script:
$ /usr/local/bin/wcwidth-cjk zsh
...
EOS
end
end