2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-18 21:06:03 +00:00
|
|
|
|
2011-02-15 12:17:32 +00:00
|
|
|
class Bash < Formula
|
2010-01-20 02:23:09 +00:00
|
|
|
homepage 'http://www.gnu.org/software/bash/'
|
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"
|
|
|
|
mirror "http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz"
|
|
|
|
sha256 "afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4"
|
|
|
|
version "4.3.11"
|
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
|
|
|
|
url "https://gist.githubusercontent.com/jacknagel/10594061/raw/65a32e9329e0d1198b06e21542de6103bcc3549e/bash-4.3-001-011.patch"
|
|
|
|
sha1 "803fd4452aa071bc87b86a1d38d86acba4dc2a62"
|
2014-03-16 23:54:13 +00:00
|
|
|
end
|
|
|
|
end
|
2009-09-18 21:06:03 +00:00
|
|
|
|
2013-08-22 16:59:40 +00:00
|
|
|
head 'git://git.savannah.gnu.org/bash.git'
|
|
|
|
|
2012-11-11 03:12:26 +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"
|
2009-09-18 21:06:03 +00:00
|
|
|
system "make install"
|
|
|
|
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
|
|
|
|
output = `#{bin}/bash -c "echo hello"`.strip
|
|
|
|
assert_equal "hello", output
|
|
|
|
assert_equal 0, $?.exitstatus
|
|
|
|
end
|
2009-09-18 21:06:03 +00:00
|
|
|
end
|