From a27cb639d805b247c0e6d8348466cfb759f93191 Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Fri, 15 Jul 2016 16:40:15 -0400 Subject: The lmod package should depend_on('tcl') The lmod package needs a tclsh. Up until now it just assumed that one was available on the system. This change adds a depends_on('tcl') to the lmod package. The tcl package installs a tclsh script with an embedded version number (e.g. tclsh8.6) but the lmod configuration looks for tclsh. This change extends the tcl package to symlink tclshX.Y to tclsh in the tcl package bin directory. --- var/spack/repos/builtin/packages/lmod/package.py | 1 + var/spack/repos/builtin/packages/tcl/package.py | 2 ++ 2 files changed, 3 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/lmod/package.py b/var/spack/repos/builtin/packages/lmod/package.py index efa235f646..caa9ea17b1 100644 --- a/var/spack/repos/builtin/packages/lmod/package.py +++ b/var/spack/repos/builtin/packages/lmod/package.py @@ -44,6 +44,7 @@ class Lmod(Package): depends_on('lua@5.2:') depends_on('lua-luaposix', type=nolink) depends_on('lua-luafilesystem', type=nolink) + depends_on('tcl') parallel = False diff --git a/var/spack/repos/builtin/packages/tcl/package.py b/var/spack/repos/builtin/packages/tcl/package.py index ef922314d8..16d896acc6 100644 --- a/var/spack/repos/builtin/packages/tcl/package.py +++ b/var/spack/repos/builtin/packages/tcl/package.py @@ -57,3 +57,5 @@ class Tcl(Package): configure("--prefix={0}".format(prefix)) make() make("install") + with working_dir(prefix.bin): + symlink('tclsh{0}'.format(self.version.up_to(2)), 'tclsh') -- cgit v1.2.3-70-g09d2 From 52f0249c61a0336efeb593a930af6ed61f07333b Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Fri, 15 Jul 2016 18:58:32 -0400 Subject: tcl is actually a runtime dependency. lmod uses tclsh at runtime, so adjust the depends_on accordingly (thanks @davydden!). --- var/spack/repos/builtin/packages/lmod/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/lmod/package.py b/var/spack/repos/builtin/packages/lmod/package.py index caa9ea17b1..14b6e02b3a 100644 --- a/var/spack/repos/builtin/packages/lmod/package.py +++ b/var/spack/repos/builtin/packages/lmod/package.py @@ -44,7 +44,7 @@ class Lmod(Package): depends_on('lua@5.2:') depends_on('lua-luaposix', type=nolink) depends_on('lua-luafilesystem', type=nolink) - depends_on('tcl') + depends_on('tcl', type=nolink) parallel = False -- cgit v1.2.3-70-g09d2 From 9523e50732ff651e1ae073791708c312217bedb1 Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Thu, 21 Jul 2016 13:58:16 -0400 Subject: 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). --- var/spack/repos/builtin/packages/lmod/fix_tclsh_paths.patch | 10 ++++++++++ var/spack/repos/builtin/packages/lmod/package.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/lmod/fix_tclsh_paths.patch (limited to 'var') 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') -- cgit v1.2.3-70-g09d2 From 4c105895abe249962e0651fdba8875c70752551a Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Thu, 21 Jul 2016 14:24:51 -0400 Subject: Fix flake8 violations --- var/spack/repos/builtin/packages/lmod/package.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/lmod/package.py b/var/spack/repos/builtin/packages/lmod/package.py index c8936d768b..01911c1a30 100644 --- a/var/spack/repos/builtin/packages/lmod/package.py +++ b/var/spack/repos/builtin/packages/lmod/package.py @@ -25,6 +25,7 @@ from spack import * from glob import glob + class Lmod(Package): """ Lmod is a Lua based module system that easily handles the MODULEPATH @@ -55,6 +56,7 @@ class Lmod(Package): 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 -- cgit v1.2.3-70-g09d2