Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for hdf4: remove ncgen ncdump if netCDF is not supposed to be built #138

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion var/spack/repos/builtin/packages/hdf/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ def cached_tests_work_dir(self):
return join_path(self.test_suite.current_test_cache_dir,
self.extra_install_tests)

@run_after('install')
def remove_ncgen_ncdump(self):
"""Remove binaries ncdump and ncgen. These get built and
installed even if the netCDF API is turned off (known bug)."""
if self.spec.satisfies('~netcdf'):
exes_to_remove = ['ncdump', 'ncgen']
for exe in exes_to_remove:
os.remove(os.path.join(self.prefix.bin, exe))

@run_after('install')
def setup_build_tests(self):
"""Copy the build test files after the package is installed to an
Expand All @@ -200,7 +209,11 @@ def _test_check_versions(self):
"""Perform version checks on selected installed package binaries."""
spec_vers_str = 'Version {0}'.format(self.spec.version.up_to(2))

exes = ['hdfimport', 'hrepack', 'ncdump', 'ncgen']
# ncdump and ncgen are removed when the netCDF API isn't built
exes = ['hdfimport', 'hrepack']
if self.spec.satisfies('+netcdf'):
exes += ['ncdump', 'ncgen']

for exe in exes:
reason = 'test: ensuring version of {0} is {1}' \
.format(exe, spec_vers_str)
Expand Down