diff options
| author | Jack Nagel | 2013-01-19 20:45:58 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-01-21 17:24:11 -0600 |
| commit | 09d4a7fb36de59839adbade95ae28681b219a2b3 (patch) | |
| tree | e6a75668cc73a149d5c30da340f0a09f12a5c2bc /Library/Homebrew | |
| parent | 2503cedf2c9ebb7e15029f126518f42ff0e5ee1c (diff) | |
| download | brew-09d4a7fb36de59839adbade95ae28681b219a2b3.tar.bz2 | |
Block-style env DSL examples
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/requirements.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb index b5d920bab..a905968f9 100644 --- a/Library/Homebrew/requirements.rb +++ b/Library/Homebrew/requirements.rb @@ -57,6 +57,8 @@ class X11Dependency < Requirement fatal true + env { x11 } + def initialize(*tags) tags.flatten! @min_version = tags.shift if /(\d\.)+\d/ === tags.first @@ -74,10 +76,6 @@ class X11Dependency < Requirement EOS end - def modify_build_environment - ENV.x11 - end - def <=> other unless other.is_a? X11Dependency raise TypeError, "expected X11Dependency" @@ -142,11 +140,11 @@ class MPIDependency < Requirement @unknown_langs.empty? and @non_functional.empty? end - def modify_build_environment + env do |req| # Set environment variables to help configure scripts find MPI compilers. # Variable names taken from: # http://www.gnu.org/software/autoconf-archive/ax_mpi.html - lang_list.each do |lang| + req.lang_list.each do |lang| compiler = 'mpi' + lang.to_s mpi_path = which compiler |
