'Called before R modules\' install() methods. In most cases,
extensions will only need to have one line:
R(\'CMD\', \'INSTALL\', \'--library={0}\'.format(self.module.r_lib_dir),
self.stage.source_path)'

def setup_dependent_package(self, module, dependent_spec):

    module.R = Executable(join_path(self.spec.prefix.bin, 'R'))
    module.r_lib_dir = join_path(dependent_spec.prefix, self.r_lib_dir)
    if dependent_spec.package.is_extension:
        mkdirp(module.r_lib_dir)
