From 909c5f5019648d39e94a82a1a6fdb6bca5a4e606 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Thu, 11 Jul 2019 22:21:17 -0500 Subject: [PATCH] Add variants for tk package (#11956) 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'. --- .../repos/builtin/packages/tk/package.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/tk/package.py b/var/spack/repos/builtin/packages/tk/package.py index c9bc2ce3e6b..2a09333740a 100644 --- a/var/spack/repos/builtin/packages/tk/package.py +++ b/var/spack/repos/builtin/packages/tk/package.py @@ -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' @@ -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):