Fix X11 proxy constant lookup under 1.9+
This commit is contained in:
parent
3701081b65
commit
9561b4bc8e
@ -109,10 +109,19 @@ class X11Dependency < Requirement
|
|||||||
class Proxy < self
|
class Proxy < self
|
||||||
PACKAGES = [:libpng, :freetype, :fontconfig]
|
PACKAGES = [:libpng, :freetype, :fontconfig]
|
||||||
|
|
||||||
def self.for(name, *tags)
|
class << self
|
||||||
|
def defines_const?(const)
|
||||||
|
if ::RUBY_VERSION >= "1.9"
|
||||||
|
const_defined?(const, false)
|
||||||
|
else
|
||||||
|
const_defined?(const)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def for(name, *tags)
|
||||||
constant = name.capitalize
|
constant = name.capitalize
|
||||||
|
|
||||||
if const_defined?(constant)
|
if defines_const?(constant)
|
||||||
klass = const_get(constant)
|
klass = const_get(constant)
|
||||||
else
|
else
|
||||||
klass = Class.new(self) do
|
klass = Class.new(self) do
|
||||||
@ -125,6 +134,7 @@ class X11Dependency < Requirement
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
# There are multiple implementations of MPI-2 available.
|
# There are multiple implementations of MPI-2 available.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user