diff --git a/var/spack/repos/builtin/packages/git/package.py b/var/spack/repos/builtin/packages/git/package.py index e8c3400c941..97986b97779 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 @@ def setup_environment(self, spack_env, run_env): 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 @@ def configure_args(self): '--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':