Fix ruby dependent extensions. (#26729)

* Fix ruby dependent extensions.

* Added Kerilk as maintainer.
This commit is contained in:
Brice Videau
2021-10-15 11:59:32 -05:00
committed by GitHub
parent 33da53e325
commit 0bc1bffe50
2 changed files with 17 additions and 6 deletions

View File

@@ -10,6 +10,8 @@ class Ruby(AutotoolsPackage):
"""A dynamic, open source programming language with a focus on
simplicity and productivity."""
maintainers = ['Kerilk']
homepage = "https://www.ruby-lang.org/"
url = "https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.gz"
list_url = "https://cache.ruby-lang.org/pub/ruby/"
@@ -88,16 +90,18 @@ def configure_args(self):
def setup_dependent_build_environment(self, env, dependent_spec):
# TODO: do this only for actual extensions.
# Set GEM_PATH to include dependent gem directories
ruby_paths = []
for d in dependent_spec.traverse():
for d in dependent_spec.traverse(deptype=('build', 'run', 'test'), root=True):
if d.package.extends(self.spec):
ruby_paths.append(d.prefix)
env.set_path('GEM_PATH', ruby_paths)
env.prepend_path('GEM_PATH', d.prefix)
# The actual installation path for this gem
env.set('GEM_HOME', dependent_spec.prefix)
def setup_dependent_run_environment(self, env, dependent_spec):
for d in dependent_spec.traverse(deptype=('run'), root=True):
if d.package.extends(self.spec):
env.prepend_path('GEM_PATH', d.prefix)
def setup_dependent_package(self, module, dependent_spec):
"""Called before ruby modules' install() methods. Sets GEM_HOME
and GEM_PATH to values appropriate for the package being built.