libtirpc: Fix directories returned for header files (#23332)

libtirpc puts its header files under prefix/include/tirpc, but
spack was returning just prefix/include for location of headers.

This will cause spack to return both prefix/include and
prefix/include/tirpc for headers, so both

include <rpc/xdr.h>

or

include <tirpc/rpc/xdr.h>

should work.
This commit is contained in:
Tom Payerle 2021-04-28 18:08:42 -04:00 committed by GitHub
parent 239e8db319
commit c0e53827aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,3 +23,13 @@ class Libtirpc(AutotoolsPackage):
# FIXME: build error on macOS
# auth_none.c:81:9: error: unknown type name 'mutex_t'
conflicts('platform=darwin', msg='Does not build on macOS')
@property
def headers(self):
hdrs = find_all_headers(self.prefix.include)
# libtirpc puts headers under include/tirpc, but some codes (e.g. hdf)
# do not expect a tirpc component. Since some might, we return
# both prefix.include.tirpc and prefix.include as header paths
if hdrs:
hdrs.directories = [self.prefix.include.tirpc, self.prefix.include]
return hdrs or None