Block-style env DSL examples
This commit is contained in:
parent
2503cedf2c
commit
09d4a7fb36
@ -57,6 +57,8 @@ class X11Dependency < Requirement
|
|||||||
|
|
||||||
fatal true
|
fatal true
|
||||||
|
|
||||||
|
env { x11 }
|
||||||
|
|
||||||
def initialize(*tags)
|
def initialize(*tags)
|
||||||
tags.flatten!
|
tags.flatten!
|
||||||
@min_version = tags.shift if /(\d\.)+\d/ === tags.first
|
@min_version = tags.shift if /(\d\.)+\d/ === tags.first
|
||||||
@ -74,10 +76,6 @@ class X11Dependency < Requirement
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def modify_build_environment
|
|
||||||
ENV.x11
|
|
||||||
end
|
|
||||||
|
|
||||||
def <=> other
|
def <=> other
|
||||||
unless other.is_a? X11Dependency
|
unless other.is_a? X11Dependency
|
||||||
raise TypeError, "expected X11Dependency"
|
raise TypeError, "expected X11Dependency"
|
||||||
@ -142,11 +140,11 @@ class MPIDependency < Requirement
|
|||||||
@unknown_langs.empty? and @non_functional.empty?
|
@unknown_langs.empty? and @non_functional.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
def modify_build_environment
|
env do |req|
|
||||||
# Set environment variables to help configure scripts find MPI compilers.
|
# Set environment variables to help configure scripts find MPI compilers.
|
||||||
# Variable names taken from:
|
# Variable names taken from:
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_mpi.html
|
# 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
|
compiler = 'mpi' + lang.to_s
|
||||||
mpi_path = which compiler
|
mpi_path = which compiler
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user