211df3a266
This fixes the `site-scripts` and `site-functions` directories so that zsh points to the HOMEBREW_PREFIX version of these files instead of the Cellar version. This means you can drop files in these directories and the files will persist when you upgrade zsh. Otherwise they disappear when you upgrade zsh. Closes Homebrew/homebrew#11955. [jn: mkpath everything under share/zsh] Signed-off-by: Jack Nagel <jacknagel@gmail.com>
60 lines
1.5 KiB
Ruby
60 lines
1.5 KiB
Ruby
require 'formula'
|
|
|
|
class Zsh < Formula
|
|
homepage 'http://www.zsh.org/'
|
|
url 'http://sourceforge.net/projects/zsh/files/zsh-dev/4.3.17/zsh-4.3.17.tar.gz'
|
|
md5 '9074077945550d6684ebe18b3b167d52'
|
|
|
|
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
|