hdf5: fix showconfig (#34920)

Co-authored-by: Bernhard Kaindl <43588962+bernhardkaindl@users.noreply.github.com>
This commit is contained in:
Sergey Kosukhin 2023-05-15 18:03:03 +02:00 committed by GitHub
parent b8c5099cde
commit 192e564e26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -686,6 +686,24 @@ def fix_package_config(self):
if not os.path.exists(tgt_filename): if not os.path.exists(tgt_filename):
symlink(src_filename, tgt_filename) symlink(src_filename, tgt_filename)
@run_after("install")
def fix_showconfig(self):
# The 'Extra libraries' entry of the 'h5cc -showconfig' command is a space-separated list
# of linker flags if the package is installed with Autotools, and a semicolon-separated
# list of library names if the package is installed with CMake. There are use cases that
# rely on the old Autotools behavior. Here, we make sure that the output of the command
# looks like it was before we switch to CMake.
filter_file(
r"^(\s*Extra libraries: )(.*)",
lambda match: "{0}{1}".format(
match.group(1),
" ".join("-l{0}".format(name) for name in filter(None, match.group(2).split(";"))),
),
self.prefix.lib.join("libhdf5.settings"),
backup=False,
ignore_absent=True,
)
@run_after("install") @run_after("install")
@on_package_attributes(run_tests=True) @on_package_attributes(run_tests=True)
def check_install(self): def check_install(self):