class Zsh < Formula desc "UNIX shell (command interpreter)" homepage "http://www.zsh.org/" url "https://downloads.sourceforge.net/project/zsh/zsh/5.2/zsh-5.2.tar.gz" mirror "http://www.zsh.org/pub/zsh-5.2.tar.gz" sha256 "fa924c534c6633c219dcffdcd7da9399dabfb63347f88ce6ddcd5bb441215937" bottle do revision 1 sha256 "9280222796df420ebd732dae9b7a3b31db131c094ba57da97d10c8c77761ef98" => :el_capitan sha256 "dc37a7a9b7b5ea54b94efb127f1c72262665ed1886054f32bb7770ee98f43d2a" => :yosemite sha256 "4fc05803a2894bf578be48e5c2451ffa1fc0531a0e9fd202821166a51db0a248" => :mavericks end head do url "git://git.code.sf.net/p/zsh/code" depends_on "autoconf" => :build end option "without-etcdir", "Disable the reading of Zsh rc files in /etc" 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 ] 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 OS X 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" 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. Add the following to your zshrc to access the online help: unalias run-help autoload run-help HELPDIR=#{HOMEBREW_PREFIX}/share/zsh/help EOS end test do assert_equal "homebrew\n", shell_output("#{bin}/zsh -c 'echo homebrew'") end end