aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-08-19 12:32:57 -0500
committerJack Nagel2013-08-19 12:32:57 -0500
commiteebc04ec9bfaca32024e2cb80ebf52b8ee68a7c9 (patch)
tree91e42effc0282b126858bf5cf4b13d08bd672877 /Library
parentbf0e32901076c5397faf4fa34bbab263f3292440 (diff)
downloadbrew-eebc04ec9bfaca32024e2cb80ebf52b8ee68a7c9.tar.bz2
Move common stuff to extend/ENV.rb
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/build.rb2
-rw-r--r--Library/Homebrew/cmd/--env.rb2
-rw-r--r--Library/Homebrew/cmd/audit.rb2
-rw-r--r--Library/Homebrew/cmd/sh.rb2
-rw-r--r--Library/Homebrew/extend/ENV.rb21
-rw-r--r--Library/Homebrew/requirement.rb2
-rw-r--r--Library/Homebrew/superenv.rb21
7 files changed, 26 insertions, 26 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index bb4325e5b..6d812ea68 100755
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -34,7 +34,7 @@ def main
require 'hardware'
require 'keg'
- require 'superenv'
+ require 'extend/ENV'
# Force any future invocations of sudo to require the user's password to be
# re-entered. This is in-case any build script call sudo. Certainly this is
diff --git a/Library/Homebrew/cmd/--env.rb b/Library/Homebrew/cmd/--env.rb
index 8cc1b1b40..d0dda1d8b 100644
--- a/Library/Homebrew/cmd/--env.rb
+++ b/Library/Homebrew/cmd/--env.rb
@@ -1,4 +1,4 @@
-require 'superenv'
+require 'extend/ENV'
require 'hardware'
module Homebrew extend self
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 492291ab9..060285d7e 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -1,6 +1,6 @@
require 'formula'
require 'utils'
-require 'superenv'
+require 'extend/ENV'
require 'formula_cellar_checks'
module Homebrew extend self
diff --git a/Library/Homebrew/cmd/sh.rb b/Library/Homebrew/cmd/sh.rb
index 5e8f26580..a1ff30dfc 100644
--- a/Library/Homebrew/cmd/sh.rb
+++ b/Library/Homebrew/cmd/sh.rb
@@ -1,4 +1,4 @@
-require 'superenv'
+require 'extend/ENV'
require 'formula'
module Homebrew extend self
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 41850fef8..5e35bace5 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -1,4 +1,25 @@
require 'hardware'
+require 'superenv'
+
+def superenv?
+ return false if MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?
+ return false unless Superenv.bin && Superenv.bin.directory?
+ return false if ARGV.include? "--env=std"
+ true
+end
+
+module EnvActivation
+ def activate_extensions!
+ if superenv?
+ extend(Superenv)
+ else
+ extend(HomebrewEnvExtension)
+ prepend 'PATH', "#{HOMEBREW_PREFIX}/bin", ':' unless ORIGINAL_PATHS.include? HOMEBREW_PREFIX/'bin'
+ end
+ end
+end
+
+ENV.extend(EnvActivation)
module HomebrewEnvExtension
SAFE_CFLAGS_FLAGS = "-w -pipe"
diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb
index f710fd021..0e021a959 100644
--- a/Library/Homebrew/requirement.rb
+++ b/Library/Homebrew/requirement.rb
@@ -1,6 +1,7 @@
require 'dependable'
require 'dependency'
require 'build_environment'
+require 'extend/ENV'
# A base class for non-formula requirements needed by formulae.
# A "fatal" requirement is one that will fail the build if it is not present.
@@ -117,7 +118,6 @@ class Requirement
if instance_variable_defined?(:@satisfied)
@satisfied
elsif @options[:build_env]
- require 'superenv'
ENV.with_build_environment do
ENV.userpaths!
yield @proc
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index 17ffddd08..3fb42b74b 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -1,4 +1,3 @@
-require 'extend/ENV'
require 'macos'
### Why `superenv`?
@@ -11,26 +10,6 @@ require 'macos'
# 7) Simpler formula that *just work*
# 8) Build-system agnostic configuration of the tool-chain
-def superenv?
- return false if MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?
- return false unless Superenv.bin && Superenv.bin.directory?
- return false if ARGV.include? "--env=std"
- true
-end
-
-module EnvActivation
- def activate_extensions!
- if superenv?
- extend(Superenv)
- else
- extend(HomebrewEnvExtension)
- prepend 'PATH', "#{HOMEBREW_PREFIX}/bin", ':' unless ORIGINAL_PATHS.include? HOMEBREW_PREFIX/'bin'
- end
- end
-end
-
-ENV.extend(EnvActivation)
-
module Superenv
attr_accessor :keg_only_deps, :deps, :x11
alias_method :x11?, :x11