Skip to content

Commit

Permalink
Add variants for tk package (spack#11956)
Browse files Browse the repository at this point in the history
TK can be built with support for libXft and X Screensaver. Both of these
are turned on in the Tk configure script. That means the system
libraries will get picked up if they are on the system and nothing is
specified in the package. Since the default for both of them is 'True' I
set the default value for the variants to 'True'.
  • Loading branch information
glennpj authored and adamjstewart committed Jul 12, 2019
1 parent 4288dac commit 909c5f5
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions var/spack/repos/builtin/packages/tk/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,17 @@ class Tk(AutotoolsPackage):
version('8.6.3', '85ca4dbf4dcc19777fd456f6ee5d0221')
version('8.5.19', 'e89df710447cce0fc0bde65667c12f85')

variant('xft', default=True,
description='Enable X FreeType')
variant('xss', default=True,
description='Enable X Screen Saver')

extends('tcl')

depends_on('tcl@8.6:', when='@8.6:')
depends_on('libx11')
depends_on('libxft', when='+xft')
depends_on('libxscrnsaver', when='+xss')

configure_directory = 'unix'

Expand Down Expand Up @@ -65,9 +72,15 @@ def setup_dependent_environment(self, spack_env, run_env, dependent_spec):

def configure_args(self):
spec = self.spec
return ['--with-tcl={0}'.format(spec['tcl'].prefix.lib),
'--x-includes={0}'.format(spec['libx11'].prefix.include),
'--x-libraries={0}'.format(spec['libx11'].prefix.lib)]
config_args = [
'--with-tcl={0}'.format(spec['tcl'].prefix.lib),
'--x-includes={0}'.format(spec['libx11'].prefix.include),
'--x-libraries={0}'.format(spec['libx11'].prefix.lib)
]
config_args += self.enable_or_disable('xft')
config_args += self.enable_or_disable('xss')

return config_args

@run_after('install')
def symlink_wish(self):
Expand Down

0 comments on commit 909c5f5

Please sign in to comment.