homebrew-core/Formula/mg3a.rb
2015-10-20 08:37:56 +01:00

51 lines
1.8 KiB
Ruby

class Mg3a < Formula
desc "Small Emacs-like editor inspired like mg with UTF8 support"
homepage "http://www.bengtl.net/files/mg3a/"
url "http://www.bengtl.net/files/mg3a/mg3a.150908.tar.gz"
sha256 "b77cb689091aa0078dabdad6d87b9554f2dba8386c39a6d2531af2b391aeabcd"
bottle do
cellar :any_skip_relocation
sha256 "a565856bbc5c9c37641b9069cc1a766d1a641a476f5fb53530ca0ba20814bd3e" => :el_capitan
sha256 "214d6d919b8ae75c69a65c33d518ffa058ed25c7bd3037974ebd629bec53e5d9" => :yosemite
sha256 "63c3b2c84e1443708e4e5ddbc44007e9d59668ee85991bb79f80f99e9cdba0dd" => :mavericks
end
conflicts_with "mg", :because => "both install `mg`"
option "with-c-mode", "Include the original C mode"
option "with-clike-mode", "Include the C mode that also handles Perl and Java"
option "with-python-mode", "Include the Python mode"
option "with-most", "Include c-like and python modes, user modes and user macros"
option "with-all", "Include all fancy stuff"
def install
if build.with?("all")
mg3aopts = "-DALL" if build.with?("all")
else
mg3aopts = %w[-DDIRED -DPREFIXREGION -DUSER_MODES -DUSER_MACROS]
mg3aopts << "-DLANGMODE_C" if build.with?("c-mode")
mg3aopts << "-DLANGMODE_PYTHON" if build.with?("python-mode") || build.with?("most")
mg3aopts << "-DLANGMODE_CLIKE" if build.with?("clike-mode") || build.with?("most")
end
system "make", "CDEFS=#{mg3aopts * " "}", "LIBS=-lncurses", "COPT=-O3"
bin.install "mg"
doc.install Dir["bl/dot.*"]
doc.install Dir["README*"]
end
test do
(testpath/"command.sh").write <<-EOS.undent
#!/usr/bin/expect -f
set timeout -1
spawn #{bin}/mg
match_max 100000
send -- "\u0018\u0003"
expect eof
EOS
(testpath/"command.sh").chmod 0755
system testpath/"command.sh"
end
end