Created
July 23, 2012 05:42
-
-
Save glidenote/3162119 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Zsh50 < Formula | |
homepage 'http://www.zsh.org/' | |
url 'ftp://ftp.zsh.org/pub/zsh-5.0.0.tar.gz' | |
md5 '01df38e4aa34aa227462fdf2f6d4c5cd' | |
depends_on 'gdbm' | |
depends_on 'pcre' | |
skip_clean :all | |
def options | |
[['--disable-etcdir', 'Disable the reading of Zsh rc files in /etc']] | |
end | |
def install | |
args = %W[ | |
--prefix=#{prefix} | |
--enable-fndir=#{share}/zsh/functions | |
--enable-scriptdir=#{share}/zsh/scripts | |
--enable-site-fndir=#{HOMEBREW_PREFIX}/share/zsh/site-functions | |
--enable-site-scriptdir=#{HOMEBREW_PREFIX}/share/zsh/site-scripts | |
--enable-cap | |
--enable-maildir-support | |
--enable-multibyte | |
--enable-pcre | |
--enable-zsh-secure-free | |
--with-tcsetpgrp | |
] | |
args << '--disable-etcdir' if ARGV.include? '--disable-etcdir' | |
system "./configure", *args | |
# Do not version installation directories. | |
inreplace ["Makefile", "Src/Makefile"], | |
"$(libdir)/$(tzsh)/$(VERSION)", "$(libdir)" | |
system "make install" | |
end | |
def test | |
system "#{bin}/zsh", "--version" | |
end | |
def caveats; <<-EOS.undent | |
To use this build of Zsh as your login shell, add it to /etc/shells. | |
If you have administrator privileges, you must fix an Apple miss | |
configuration in Mac OS X 10.7 Lion by renaming /etc/zshenv to | |
/etc/zprofile, or Zsh will have the wrong PATH when executed | |
non-interactively by scripts. | |
Alternatively, install Zsh with /etc disabled: | |
brew install --disable-etcdir zsh | |
EOS | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment