2011-02-15 12:17:32 +00:00
|
|
|
class Bash < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Bash (Bourne-again SHell) is a UNIX command interpreter"
|
2015-01-14 04:06:42 +00:00
|
|
|
homepage "https://www.gnu.org/software/bash/"
|
2014-03-16 23:54:13 +00:00
|
|
|
|
2015-07-27 09:29:22 +00:00
|
|
|
head "http://git.savannah.gnu.org/r/bash.git"
|
|
|
|
|
2014-03-16 23:54:13 +00:00
|
|
|
stable do
|
2014-04-13 19:59:08 +00:00
|
|
|
url "http://ftpmirror.gnu.org/bash/bash-4.3.tar.gz"
|
2015-01-14 04:06:42 +00:00
|
|
|
mirror "https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz"
|
2014-04-13 19:59:08 +00:00
|
|
|
sha256 "afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4"
|
2015-08-26 19:49:58 +00:00
|
|
|
version "4.3.42"
|
2014-03-16 23:54:13 +00:00
|
|
|
|
|
|
|
# Vendor the patches. The mirrors are unreliable for getting the patches,
|
|
|
|
# and the more patches there are, the more unreliable they get. Upstream
|
2014-04-13 19:59:08 +00:00
|
|
|
# patches can be found in: http://git.savannah.gnu.org/cgit/bash.git
|
|
|
|
patch do
|
2015-08-26 19:49:58 +00:00
|
|
|
url "https://gist.githubusercontent.com/dunn/a8986687991b57eb3b25/raw/76dd864812e821816f4b1c18e3333c8fced3919b/bash-4.3.42.diff"
|
|
|
|
sha256 "2eeb9b3ed71f1e13292c2212b6b8036bc258c58ec9c82eec7a86a091b05b15d2"
|
2014-03-16 23:54:13 +00:00
|
|
|
end
|
|
|
|
end
|
2009-09-18 21:06:03 +00:00
|
|
|
|
2014-09-22 06:08:31 +00:00
|
|
|
bottle do
|
2015-07-26 21:04:48 +00:00
|
|
|
sha256 "ee7ba6eec21b7ff28f7f4af4aa61410e898a332a962890ba427ababff461b476" => :yosemite
|
|
|
|
sha256 "cd77ab76ba9669e9aaa7530d3f8050af402e5216093ac5d601d0bc1e71243ced" => :mavericks
|
|
|
|
sha256 "d02261c71893bcde61fb1b1c84b49e0e7d60df9fd62b4d5af76afd1f4b29de7e" => :mountain_lion
|
2014-09-22 06:08:31 +00:00
|
|
|
end
|
|
|
|
|
2014-05-29 02:06:36 +00:00
|
|
|
depends_on "readline"
|
2009-09-18 21:06:03 +00:00
|
|
|
|
2011-05-07 19:22:57 +00:00
|
|
|
def install
|
2013-10-12 22:18:33 +00:00
|
|
|
# When built with SSH_SOURCE_BASHRC, bash will source ~/.bashrc when
|
|
|
|
# it's non-interactively from sshd. This allows the user to set
|
|
|
|
# environment variables prior to running the command (e.g. PATH). The
|
|
|
|
# /bin/bash that ships with Mac OS X defines this, and without it, some
|
|
|
|
# things (e.g. git+ssh) will break if the user sets their default shell to
|
|
|
|
# Homebrew's bash instead of /bin/bash.
|
|
|
|
ENV.append_to_cflags "-DSSH_SOURCE_BASHRC"
|
|
|
|
|
2011-05-07 19:22:57 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--with-installed-readline"
|
2015-07-26 04:16:27 +00:00
|
|
|
system "make", "install"
|
2009-09-18 21:06:03 +00:00
|
|
|
end
|
2012-01-20 12:46:43 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
In order to use this build of bash as your login shell,
|
|
|
|
it must be added to /etc/shells.
|
|
|
|
EOS
|
|
|
|
end
|
2014-02-08 18:46:17 +00:00
|
|
|
|
|
|
|
test do
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "hello", shell_output("#{bin}/bash -c \"echo hello\"").strip
|
2014-02-08 18:46:17 +00:00
|
|
|
end
|
2009-09-18 21:06:03 +00:00
|
|
|
end
|