Skip to content
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
13 changes: 11 additions & 2 deletions easybuild/easyblocks/o/ocaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,21 @@ def sanity_check_step(self):
binaries.append('bin/opam')
dirs.append(OPAM_SUBDIR)

extension_names = [ext_name for ext_name, _ in self.cfg['exts_list']]

custom_commands = ["ocaml --help"]
if 'ocamlfind' in extension_names:
custom_commands.append("ocamlfind list")

if 'dune' in extension_names:
custom_commands.append("dune --version")

custom_paths = {
'files': binaries,
'dirs': dirs,
}

super(EB_OCaml, self).sanity_check_step(custom_paths=custom_paths)
super(EB_OCaml, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)

def make_module_req_guess(self):
"""Custom extra paths/variables to define in generated module for OCaml."""
Expand All @@ -160,7 +169,7 @@ def make_module_req_guess(self):
guesses.update({
'CAML_LD_LIBRARY_PATH': ['lib'],
'OPAMROOT': [OPAM_SUBDIR],
'PATH': ['bin', os.path.join(OPAM_SUBDIR, 'system', 'bin')],
'PATH': ['bin', os.path.join(OPAM_SUBDIR, 'default', 'bin')],
})

return guesses