Skip to content

Commit

Permalink
zsh: make the disabling of /etc optional
Browse files Browse the repository at this point in the history
Closes Homebrew#11056.

Signed-off-by: Jack Nagel <[email protected]>
  • Loading branch information
sorin-ionescu authored and jacknagel committed Apr 25, 2012
1 parent 8bf8075 commit f0c149a
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions Library/Formula/zsh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,29 @@ class Zsh < Formula

skip_clean :all

def options
[['--disable-etcdir', 'Disable the reading of Zsh rc files in /etc']]
end

def install
system "./configure", "--prefix=#{prefix}",
"--disable-etcdir",
"--enable-fndir=#{share}/zsh/functions",
"--enable-site-fndir=#{share}/zsh/site-functions",
"--enable-scriptdir=#{share}/zsh/scripts",
"--enable-site-scriptdir=#{share}/zsh/site-scripts",
"--enable-cap",
"--enable-function-subdirs",
"--enable-maildir-support",
"--enable-multibyte",
"--enable-pcre",
"--enable-zsh-secure-free",
"--with-tcsetpgrp"
args = %W[
-prefix=#{prefix}
--enable-fndir=#{share}/zsh/functions
--enable-site-fndir=#{share}/zsh/site-functions
--enable-scriptdir=#{share}/zsh/scripts
--enable-site-scriptdir=#{share}/zsh/site-scripts
--enable-cap
--enable-function-subdirs
--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"],
Expand All @@ -38,6 +47,15 @@ def test

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

0 comments on commit f0c149a

Please sign in to comment.