R: ensure Makeconf has full libs directories (#48323)

This commit is contained in:
Wouter Deconinck 2025-01-04 03:28:46 -06:00 committed by GitHub
parent 0471af4c16
commit 5fd15dc541
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -76,6 +76,10 @@ def flag_handler(self, name, flags):
flags.append(getattr(self.compiler, f"cxx{self.spec.variants['cxxstd'].value}_flag"))
return (None, flags, None)
@property
def libs(self):
return find_libraries("libicu*", root=self.prefix, recursive=True)
class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder):

View File

@ -232,6 +232,20 @@ def configure_args(self):
@run_after("install")
def copy_makeconf(self):
# Ensure full library flags are included in Makeconf
for _lib, _pkg in [
("lzma", "xz"),
("bz2", "bzip2"),
("z", "zlib-api"),
("tirpc", "libtirpc"),
("icuuc", "icu4c"),
]:
filter_file(
f"-l{_lib}",
f"-L{self.spec[_pkg].libs.directories[0]} -l{_lib}",
join_path(self.etcdir, "Makeconf"),
)
# Make a copy of Makeconf because it will be needed to properly build R
# dependencies in Spack.
src_makeconf = join_path(self.etcdir, "Makeconf")