summaryrefslogtreecommitdiff
path: root/templates/modules/modulefile.lua
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-03-23 23:16:37 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-06-24 16:38:36 -0700
commitc4c1d37fcdeb17680a85af25431314dae4fa3584 (patch)
tree8abe5909edf418ef0810a53771eb7871b6050d19 /templates/modules/modulefile.lua
parent6517dabbce06a7a62154e00ecea427116d9ef801 (diff)
downloadspack-c4c1d37fcdeb17680a85af25431314dae4fa3584.tar.gz
spack-c4c1d37fcdeb17680a85af25431314dae4fa3584.tar.bz2
spack-c4c1d37fcdeb17680a85af25431314dae4fa3584.tar.xz
spack-c4c1d37fcdeb17680a85af25431314dae4fa3584.zip
refactor: move templates from root to share/spack
- This complies with the unix directory hierarchy standard (which Spack attempts to follow) - Also unclutters the repo root directory.
Diffstat (limited to 'templates/modules/modulefile.lua')
-rw-r--r--templates/modules/modulefile.lua91
1 files changed, 0 insertions, 91 deletions
diff --git a/templates/modules/modulefile.lua b/templates/modules/modulefile.lua
deleted file mode 100644
index cf37595228..0000000000
--- a/templates/modules/modulefile.lua
+++ /dev/null
@@ -1,91 +0,0 @@
--- -*- lua -*-
--- Module file created by spack (https://github.com/spack/spack) on {{ timestamp }}
---
--- {{ spec.short_spec }}
---
-
-{% block header %}
-{% if short_description %}
-whatis([[Name : {{ spec.name }}]])
-whatis([[Version : {{ spec.version }}]])
-whatis([[Short description : {{ short_description }}]])
-{% endif %}
-{% if configure_options %}
-whatis([[Configure options : {{ configure_options }}]])
-{% endif %}
-
-{% if long_description %}
-help([[{{ long_description| textwrap(72)| join() }}]])
-{% endif %}
-{% endblock %}
-
-{% block provides %}
-{# Prepend the path I unlock as a provider of #}
-{# services and set the families of services I provide #}
-{% if has_modulepath_modifications %}
--- Services provided by the package
-{% for name in provides %}
-family("{{ name }}")
-{% endfor %}
-
--- Loading this module unlocks the path below unconditionally
-{% for path in unlocked_paths %}
-prepend_path("MODULEPATH", "{{ path }}")
-{% endfor %}
-
-{# Try to see if missing providers have already #}
-{# been loaded into the environment #}
-{% if has_conditional_modifications %}
--- Try to load variables into path to see if providers are there
-{% for name in missing %}
-local {{ name }}_name = os.getenv("LMOD_{{ name|upper() }}_NAME")
-local {{ name }}_version = os.getenv("LMOD_{{ name|upper() }}_VERSION")
-{% endfor %}
-
--- Change MODULEPATH based on the result of the tests above
-{% for condition, path in conditionally_unlocked_paths %}
-if {{ condition }} then
- local t = pathJoin({{ path }})
- prepend_path("MODULEPATH", t)
-end
-{% endfor %}
-
--- Set variables to notify the provider of the new services
-{% for name in provides %}
-setenv("LMOD_{{ name|upper() }}_NAME", "{{ name_part }}")
-setenv("LMOD_{{ name|upper() }}_VERSION", "{{ version_part }}")
-{% endfor %}
-{% endif %}
-{% endif %}
-{% endblock %}
-
-{% block autoloads %}
-{% for module in autoload %}
-if not isloaded("{{ module }}") then
-{% if verbose %}
- LmodMessage("Autoloading {{ module }}")
-{% endif %}
- load("{{ module }}")
-end
-{% endfor %}
-{% endblock %}
-
-{% block environment %}
-{% for command_name, cmd in environment_modifications %}
-{% if command_name == 'PrependPath' %}
-prepend_path("{{ cmd.name }}", "{{ cmd.value }}")
-{% elif command_name == 'AppendPath' %}
-append_path("{{ cmd.name }}", "{{ cmd.value }}")
-{% elif command_name == 'RemovePath' %}
-remove_path("{{ cmd.name }}", "{{ cmd.value }}")
-{% elif command_name == 'SetEnv' %}
-setenv("{{ cmd.name }}", "{{ cmd.value }}")
-{% elif command_name == 'UnsetEnv' %}
-unsetenv("{{ cmd.name }}")
-{% endif %}
-{% endfor %}
-{% endblock %}
-
-{% block footer %}
-{# In case the module needs to be extended with custom LUA code #}
-{% endblock %}