2011-02-15 12:17:32 +00:00
|
|
|
class Bash < Formula
|
2015-12-19 06:18:56 +00:00
|
|
|
desc "Bourne-Again SHell, a UNIX command interpreter"
|
2015-01-14 04:06:42 +00:00
|
|
|
homepage "https://www.gnu.org/software/bash/"
|
2016-09-17 12:51:23 +00:00
|
|
|
|
2015-07-27 09:29:22 +00:00
|
|
|
head "http://git.savannah.gnu.org/r/bash.git"
|
|
|
|
|
2016-11-12 17:27:24 +00:00
|
|
|
stable do
|
|
|
|
url "https://ftpmirror.gnu.org/bash/bash-4.4.tar.gz"
|
|
|
|
mirror "https://mirrors.ocf.berkeley.edu/gnu/bash/bash-4.4.tar.gz"
|
|
|
|
mirror "https://mirrors.kernel.org/gnu/bash/bash-4.4.tar.gz"
|
|
|
|
mirror "https://ftp.gnu.org/gnu/bash/bash-4.4.tar.gz"
|
|
|
|
mirror "https://gnu.cu.be/bash/bash-4.4.tar.gz"
|
|
|
|
mirror "https://mirror.unicorncloud.org/gnu/bash/bash-4.4.tar.gz"
|
|
|
|
sha256 "d86b3392c1202e8ff5a423b302e6284db7f8f435ea9f39b5b1b20fd3ac36dfcb"
|
|
|
|
version "4.4.5"
|
|
|
|
|
|
|
|
%w[
|
|
|
|
001 3e28d91531752df9a8cb167ad07cc542abaf944de9353fe8c6a535c9f1f17f0f
|
|
|
|
002 7020a0183e17a7233e665b979c78c184ea369cfaf3e8b4b11f5547ecb7c13c53
|
|
|
|
003 51df5a9192fdefe0ddca4bdf290932f74be03ffd0503a3d112e4199905e718b2
|
|
|
|
004 ad080a30a4ac6c1273373617f29628cc320a35c8cd06913894794293dc52c8b3
|
|
|
|
005 221e4b725b770ad0bb6924df3f8d04f89eeca4558f6e4c777dfa93e967090529
|
|
|
|
].each_slice(2) do |p, checksum|
|
|
|
|
patch :p0 do
|
|
|
|
url "https://ftpmirror.gnu.org/bash/bash-4.4-patches/bash44-#{p}"
|
|
|
|
mirror "https://mirrors.ocf.berkeley.edu/gnu/bash/bash-4.4-patches/bash44-#{p}"
|
|
|
|
mirror "https://mirrors.kernel.org/gnu/bash/bash-4.4-patches/bash44-#{p}"
|
|
|
|
mirror "https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-#{p}"
|
|
|
|
mirror "https://gnu.cu.be/bash/bash-4.4-patches/bash44-#{p}"
|
|
|
|
mirror "https://mirror.unicorncloud.org/gnu/bash/bash-4.4-patches/bash44-#{p}"
|
|
|
|
sha256 checksum
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-22 06:08:31 +00:00
|
|
|
bottle do
|
2016-11-12 19:10:57 +00:00
|
|
|
sha256 "23b62efa46b3f22ad73c07b175c1845badd5fdcc51ee047b742fad77c3ca634f" => :sierra
|
|
|
|
sha256 "3aca180803c0171308a6082451a7be6b0a246056d44d398c380b2a89e23e3fb4" => :el_capitan
|
|
|
|
sha256 "79a35596d64dd7c957f379b5bf2bade04c3c6a5b30349e0df8e64917561e0a02" => :yosemite
|
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
|
2016-10-02 05:53:52 +00:00
|
|
|
# /bin/bash that ships with macOS defines this, and without it, some
|
2013-10-12 22:18:33 +00:00
|
|
|
# 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"
|
|
|
|
|
2016-09-15 21:43:23 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}"
|
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
|