summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hartzell <hartzell@alerce.com>2016-07-21 13:58:16 -0400
committerGeorge Hartzell <hartzell@alerce.com>2016-07-21 13:58:16 -0400
commit9523e50732ff651e1ae073791708c312217bedb1 (patch)
tree6b255bcef456b81cc108254226cc9e7f7142d211
parent52f0249c61a0336efeb593a930af6ed61f07333b (diff)
downloadspack-9523e50732ff651e1ae073791708c312217bedb1.tar.gz
spack-9523e50732ff651e1ae073791708c312217bedb1.tar.bz2
spack-9523e50732ff651e1ae073791708c312217bedb1.tar.xz
spack-9523e50732ff651e1ae073791708c312217bedb1.zip
Fix shebang line in tcl scripts
Lmod's configure script goes to the trouble of finding tclsh. This change uses that info to rewrite the #! lines in the tcl scripts so that they call the tclsh that the configure script discovered. It needs to massage the existing shebang lines into something that the sed statement in the makefile can manipulate and it needs to add the path_to_tclsh info into the set of sed statements. Checked with versions 6.4.1 and 6.3.7 (the checksum for 6.0.1 is incorrect, a fix for another time).
-rw-r--r--var/spack/repos/builtin/packages/lmod/fix_tclsh_paths.patch10
-rw-r--r--var/spack/repos/builtin/packages/lmod/package.py11
2 files changed, 20 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/lmod/fix_tclsh_paths.patch b/var/spack/repos/builtin/packages/lmod/fix_tclsh_paths.patch
new file mode 100644
index 0000000000..70f0d47925
--- /dev/null
+++ b/var/spack/repos/builtin/packages/lmod/fix_tclsh_paths.patch
@@ -0,0 +1,10 @@
+--- a/Makefile.in 2016-07-21 13:03:27.861000000 -0400
++++ b/Makefile.in 2016-07-21 13:03:58.416000000 -0400
+@@ -197,6 +197,7 @@
+ -e 's|@colorize@|$(COLORIZE)|g' \
+ -e 's|@duplicate_paths@|$(DUPLICATE_PATHS)|g' \
+ -e 's|@allow_tcl_mfiles@|$(ALLOW_TCL_MFILES)|g' \
++ -e 's|@path_to_tclsh@|$(PATH_TO_TCLSH)|g' \
+ -e 's|@mpath_avail@|$(MPATH_AVAIL)|g' \
+ -e 's|@short_time@|$(SHORT_TIME)|g' \
+ -e 's|@cacheDirs@|$(SPIDER_CACHE_DIRS)|g' \
diff --git a/var/spack/repos/builtin/packages/lmod/package.py b/var/spack/repos/builtin/packages/lmod/package.py
index 14b6e02b3a..c8936d768b 100644
--- a/var/spack/repos/builtin/packages/lmod/package.py
+++ b/var/spack/repos/builtin/packages/lmod/package.py
@@ -23,7 +23,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
-
+from glob import glob
class Lmod(Package):
"""
@@ -54,6 +54,15 @@ class Lmod(Package):
spack_env.append_path('LUA_PATH', stage_lua_path.format(
version=self.version), separator=';')
+ patch('fix_tclsh_paths.patch')
+ def patch(self):
+ """The tcl scripts should use the tclsh that was discovered
+ by the configure script. Touch up their #! lines so that the
+ sed in the Makefile's install step has something to work on.
+ Requires the change in the associated patch file.fg"""
+ for tclscript in glob('src/*.tcl'):
+ filter_file(r'^#!.*tclsh', '#!@path_to_tclsh@', tclscript)
+
def install(self, spec, prefix):
configure('--prefix=%s' % prefix)
make('install')