homebrew-core/Formula/zsh.rb
Zhiming Wang add1442084
zsh 5.3
Closes #7776.

Signed-off-by: William Woodruff <william@tuffbizz.com>
2016-12-11 20:02:51 -05:00

91 lines
2.8 KiB
Ruby

class Zsh < Formula
desc "UNIX shell (command interpreter)"
homepage "https://www.zsh.org/"
stable do
url "https://www.zsh.org/pub/zsh-5.3.tar.gz"
mirror "https://downloads.sourceforge.net/project/zsh/zsh/5.3/zsh-5.3.tar.gz"
sha256 "1da273fa96041b395ee9f628d14f2aff08f9a62e98423a990218e2ea037b9a6d"
# We cannot build HTML doc on HEAD, because yodl which is required for
# building zsh.texi is not available.
option "with-texi2html", "Build HTML documentation"
depends_on "texi2html" => [:build, :optional]
end
bottle do
rebuild 3
sha256 "d40ddb483bf98ba2bb1b829207607f288618a30ecf640a28151c3e922796b0f8" => :sierra
sha256 "2a860b90c4b47b034a6b8c2d6a70dccf479f56aebac38683790f2e4cd1da615b" => :el_capitan
sha256 "d140366f62354011a7de99949e847ae44d6aa70f2b51e1722028844e4fa0b252" => :yosemite
end
head do
url "git://git.code.sf.net/p/zsh/code"
depends_on "autoconf" => :build
option "with-unicode9", "Build with Unicode 9 character width support"
end
option "without-etcdir", "Disable the reading of Zsh rc files in /etc"
option "with-unicode9", "Build with Unicode 9 character width support"
deprecated_option "disable-etcdir" => "without-etcdir"
depends_on "gdbm"
depends_on "pcre"
def install
system "Util/preconfig" if build.head?
args = %W[
--prefix=#{prefix}
--enable-fndir=#{pkgshare}/functions
--enable-scriptdir=#{pkgshare}/scripts
--enable-site-fndir=#{HOMEBREW_PREFIX}/share/zsh/site-functions
--enable-site-scriptdir=#{HOMEBREW_PREFIX}/share/zsh/site-scripts
--enable-runhelpdir=#{pkgshare}/help
--enable-cap
--enable-maildir-support
--enable-multibyte
--enable-pcre
--enable-zsh-secure-free
--with-tcsetpgrp
]
args << "--enable-unicode9" if build.with? "unicode9"
if build.without? "etcdir"
args << "--disable-etcdir"
else
args << "--enable-etcdir=/etc"
end
system "./configure", *args
# Do not version installation directories.
inreplace ["Makefile", "Src/Makefile"],
"$(libdir)/$(tzsh)/$(VERSION)", "$(libdir)"
if build.head?
# disable target install.man, because the required yodl comes neither with macOS nor Homebrew
# also disable install.runhelp and install.info because they would also fail or have no effect
system "make", "install.bin", "install.modules", "install.fns"
else
system "make", "install"
system "make", "install.info"
system "make", "install.html" if build.with? "texi2html"
end
end
def caveats; <<-EOS.undent
In order to use this build of zsh as your login shell,
it must be added to /etc/shells.
EOS
end
test do
assert_equal "homebrew\n",
shell_output("#{bin}/zsh -c 'echo homebrew'")
end
end