2013-08-19 12:32:57 -05:00
|
|
|
require 'extend/ENV'
|
2012-08-29 11:21:15 -04:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
module Homebrew extend self
|
|
|
|
def sh
|
2013-08-19 12:32:56 -05:00
|
|
|
ENV.activate_extensions!
|
|
|
|
|
2012-08-29 11:21:15 -04:00
|
|
|
if superenv?
|
2013-10-31 14:20:29 -05:00
|
|
|
ENV.x11 = MacOS::X11.installed?
|
2012-08-29 11:21:15 -04:00
|
|
|
ENV.deps = Formula.installed.select{|f| f.keg_only? and f.opt_prefix.directory? }.map(&:name)
|
|
|
|
end
|
|
|
|
ENV.setup_build_environment
|
2012-09-23 21:06:09 -04:00
|
|
|
if superenv?
|
|
|
|
# superenv stopped adding brew's bin but generally user's will want it
|
2013-08-15 21:50:13 +02:00
|
|
|
ENV['PATH'] = ENV['PATH'].split(File::PATH_SEPARATOR).insert(1, "#{HOMEBREW_PREFIX}/bin").join(File::PATH_SEPARATOR)
|
2012-09-23 21:06:09 -04:00
|
|
|
end
|
2012-08-29 11:21:15 -04:00
|
|
|
ENV['PS1'] = 'brew \[\033[1;32m\]\w\[\033[0m\]$ '
|
2012-08-31 14:12:14 -04:00
|
|
|
ENV['VERBOSE'] = '1'
|
2012-08-29 11:21:15 -04:00
|
|
|
puts <<-EOS.undent_________________________________________________________72
|
2012-09-03 11:57:18 -04:00
|
|
|
Your shell has been configured to use Homebrew's build environment:
|
2012-08-31 14:12:14 -04:00
|
|
|
this should help you build stuff. Notably though, the system versions of
|
|
|
|
gem and pip will ignore our configuration and insist on using the
|
2012-08-29 11:21:15 -04:00
|
|
|
environment they were built under (mostly). Sadly, scons will also
|
|
|
|
ignore our configuration.
|
2012-09-03 11:57:18 -04:00
|
|
|
When done, type `exit'.
|
2012-08-29 11:21:15 -04:00
|
|
|
EOS
|
|
|
|
exec ENV['SHELL']
|
|
|
|
end
|
|
|
|
end
|