From 689e0cb24b8681c709aa3122e2b99020edcbc4d9 Mon Sep 17 00:00:00 2001 From: "Kelly (KT) Thompson" Date: Sat, 9 Jun 2018 15:16:36 -0600 Subject: Git's gitk needs TK's wish to be found in PATH (#8360) * Git's gitk needs TK's wish to be found in PATH * Add a _runtime_ dependency on `tk` * Add an environment rule to add the path to TK's `wish` program to $PATH for the generated `git` modulefile. * Make TclTk run environment an optional variant for git. * Cleanup based on PR recommendations. --- var/spack/repos/builtin/packages/git/package.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py index e8c3400c94..97986b9777 100644 --- a/var/spack/repos/builtin/packages/git/package.py +++ b/var/spack/repos/builtin/packages/git/package.py @@ -160,6 +160,9 @@ class Git(AutotoolsPackage): placement='git-manpages', when='@{0}'.format(release['version'])) + variant('tcltk', default=False, + description='Gitk: provide Tcl/Tk in the run environment') + depends_on('curl') depends_on('expat') depends_on('gettext') @@ -174,6 +177,7 @@ class Git(AutotoolsPackage): depends_on('automake', type='build') depends_on('libtool', type='build') depends_on('m4', type='build') + depends_on('tk', type=('build', 'link'), when='+tcltk') # See the comment in setup_environment re EXTLIBS. def patch(self): @@ -202,7 +206,7 @@ class Git(AutotoolsPackage): def configure_args(self): spec = self.spec - return [ + configure_args = [ '--with-curl={0}'.format(spec['curl'].prefix), '--with-expat={0}'.format(spec['expat'].prefix), '--with-iconv={0}'.format(spec['libiconv'].prefix), @@ -212,6 +216,14 @@ class Git(AutotoolsPackage): '--with-zlib={0}'.format(spec['zlib'].prefix), ] + if '+tcltk' in self.spec: + configure_args.append('--with-tcltk={0}'.format( + self.spec['tk'].prefix.bin.wish)) + else: + configure_args.append('--without-tcltk') + + return configure_args + @run_after('configure') def filter_rt(self): if sys.platform == 'darwin': -- cgit v1.2.3-70-g09d2