summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/graphviz/package.py49
1 files changed, 30 insertions, 19 deletions
diff --git a/var/spack/repos/builtin/packages/graphviz/package.py b/var/spack/repos/builtin/packages/graphviz/package.py
index 18b69b9f2b..89e7ffc635 100644
--- a/var/spack/repos/builtin/packages/graphviz/package.py
+++ b/var/spack/repos/builtin/packages/graphviz/package.py
@@ -36,9 +36,6 @@ class Graphviz(AutotoolsPackage):
# We try to leave language bindings enabled if they don't cause
# build issues or add dependencies.
- variant('swig', default=False,
- description='Enable for optional swig language bindings'
- ' (not yet functional)')
variant('sharp', default=False,
description='Enable for optional sharp language bindings'
' (not yet functional)')
@@ -79,7 +76,20 @@ class Graphviz(AutotoolsPackage):
parallel = False
- depends_on('swig', when='+swig')
+ # These language bindings have been tested, we know they work.
+ tested_bindings = ('+java', )
+
+ # These language bindings have not yet been tested. They
+ # likely need additional dependencies to get working.
+ untested_bindings = (
+ '+perl',
+ '+sharp', '+go', '+guile', '+io',
+ '+lua', '+ocaml', '+php',
+ '+python', '+r', '+ruby', '+tcl')
+
+ for b in tested_bindings + untested_bindings:
+ depends_on('swig', when=b)
+
depends_on('ghostscript')
depends_on('freetype')
depends_on('expat')
@@ -93,19 +103,11 @@ class Graphviz(AutotoolsPackage):
spec = self.spec
options = []
- # These language bindings have been tested, we know they work.
- tested_bindings = ('+java', '+perl')
+ need_swig = False
- # These language bindings have not yet been tested. They
- # likely need additional dependencies to get working.
- untested_bindings = (
- '+swig', '+sharp', '+go', '+guile', '+io',
- '+lua', '+ocaml', '+php',
- '+python', '+r', '+ruby', '+tcl')
-
- for var in untested_bindings:
+ for var in self.untested_bindings:
if var in spec:
- raise SpackException(
+ raise InstallError(
"The variant {0} for language bindings has not been "
"tested. It might or might not work. To try it "
"out, run `spack edit graphviz`, and then move '{0}' "
@@ -113,11 +115,20 @@ class Graphviz(AutotoolsPackage):
"`tested_bindings` list. Be prepared to add "
"required dependencies. "
"Please then submit a pull request to "
- "http://github.com/llnl/spack")
+ "http://github.com/llnl/spack".format(var))
+ options.append('--disable-%s' % var[1:])
+
+ for var in self.tested_bindings:
+ if var in spec:
+ need_swig = True
+ options.append('--enable-{0}'.format(var[1:]))
+ else:
+ options.append('--disable-{0}'.format(var[1:]))
- for var in tested_bindings:
- enable = 'enable' if (var in spec) else 'disable'
- options.append('--%s-%s' % (enable, var[1:]))
+ if need_swig:
+ options.append('--enable-swig=yes')
+ else:
+ options.append('--enable-swig=no')
# On OSX fix the compiler error:
# In file included from tkStubLib.c:15: