hdf: Add option to link against libtirpc package (#15993)

This adds a boolean 'libtirpc' variant to the hdf package.
Default is false, which will reproduce previous behavior (which
was to rely either on system xdr headers/library, or have hdf use
it's builtin xdr lib/headers (which are only for 32 bit))

If true, a dependency is added on 'libtirpc', and the LIBS and
CPPFLAGS are updated in the configure command to find the libtirpc
library and xdr.h header.

This is needed as RHEL8 (and presumably other distros have or will be)
removed xdr.h from glib-headers package,which was breaking the previous
behavior of using system xdr headers.
This commit is contained in:
Tom Payerle 2020-04-10 14:23:05 -04:00 committed by GitHub
parent c01a968ada
commit 343a499aa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,9 +21,11 @@ class Hdf(AutotoolsPackage):
version('4.2.11', sha256='c3f7753b2fb9b27d09eced4d2164605f111f270c9a60b37a578f7de02de86d24')
variant('szip', default=False, description="Enable szip support")
variant('libtirpc', default=False, description="Use xdr library from libtirpc package; if false, will use system or hdf internal")
depends_on('jpeg@6b:')
depends_on('szip', when='+szip')
depends_on('libtirpc', when='+libtirpc')
depends_on('zlib@1.1.4:')
depends_on('bison', type='build')
@ -49,4 +51,9 @@ def configure_args(self):
else:
config_args.append('--without-szlib')
if '+libtirpc' in spec:
config_args.append('LIBS=-ltirpc')
config_args.append('CPPFLAGS=-I{0}/include/tirpc'.format(
spec['libtirpc'].prefix))
return config_args