summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hartzell <hartzell@alerce.com>2017-06-06 04:06:36 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2017-06-06 06:06:36 -0500
commitaa51e766cd710cc5602cb2988fa7d5d5f1fb64a9 (patch)
tree4a6f376a038a79fe6e864abc638822d1565ee9f8
parent54cc8dd7fd956b37e17982173e5624d0c98f8ce3 (diff)
downloadspack-aa51e766cd710cc5602cb2988fa7d5d5f1fb64a9.tar.gz
spack-aa51e766cd710cc5602cb2988fa7d5d5f1fb64a9.tar.bz2
spack-aa51e766cd710cc5602cb2988fa7d5d5f1fb64a9.tar.xz
spack-aa51e766cd710cc5602cb2988fa7d5d5f1fb64a9.zip
Add add'l output formats for graphviz (#4431)
* Add add'l output formats for graphviz Add support for additional output formats to graphviz, including gif, jpg, pdf, and png. Graphviz calls its pango+cairo option *pangocairo* so I followed suit. Libgd was missing jpeg/jpg support. None of the other supported formats are conditionalized and there is no --with/--without support, so I followed suit. * Fix ghostscript plugin When I installed thusly: spack install graphviz+pangocairo+libgd^cairo+X^pango+X the ghostscript plugin tripped over some variable names that had changes in `gs@9.18:`. This fixes them. * Remove wayward import of tty
-rw-r--r--var/spack/repos/builtin/packages/graphviz/package.py22
-rw-r--r--var/spack/repos/builtin/packages/libgd/package.py1
2 files changed, 23 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/graphviz/package.py b/var/spack/repos/builtin/packages/graphviz/package.py
index 89e7ffc635..9a0337e656 100644
--- a/var/spack/repos/builtin/packages/graphviz/package.py
+++ b/var/spack/repos/builtin/packages/graphviz/package.py
@@ -74,6 +74,11 @@ class Graphviz(AutotoolsPackage):
description='Enable for optional tcl language bindings'
' (not yet functional)')
+ variant('pangocairo', default=False,
+ description='Build with pango+cairo support (more output formats)')
+ variant('libgd', default=False,
+ description='Build with libgd support (more output formats)')
+
parallel = False
# These language bindings have been tested, we know they work.
@@ -90,6 +95,9 @@ class Graphviz(AutotoolsPackage):
for b in tested_bindings + untested_bindings:
depends_on('swig', when=b)
+ depends_on('cairo', when='+pangocairo')
+ depends_on('pango', when='+pangocairo')
+ depends_on('libgd', when='+libgd')
depends_on('ghostscript')
depends_on('freetype')
depends_on('expat')
@@ -99,6 +107,14 @@ class Graphviz(AutotoolsPackage):
depends_on('jdk', when='+java')
depends_on('python@2:2.8', when='+python')
+ def patch(self):
+ # Fix a few variable names, gs after 9.18 renamed them
+ # See http://lists.linuxfromscratch.org/pipermail/blfs-book/2015-October/056960.html
+ if self.spec.satisfies('^ghostscript@9.18:'):
+ kwargs = {'ignore_absent': False, 'backup': True, 'string': True}
+ filter_file(' e_', ' gs_error_', 'plugin/gs/gvloadimage_gs.c',
+ **kwargs)
+
def configure_args(self):
spec = self.spec
options = []
@@ -130,6 +146,12 @@ class Graphviz(AutotoolsPackage):
else:
options.append('--enable-swig=no')
+ for var in ('+pangocairo', '+libgd'):
+ if var in spec:
+ options.append('--with-{0}'.format(var[1:]))
+ else:
+ options.append('--without-{0}'.format(var[1:]))
+
# On OSX fix the compiler error:
# In file included from tkStubLib.c:15:
# /usr/include/tk.h:78:11: fatal error: 'X11/Xlib.h' file not found
diff --git a/var/spack/repos/builtin/packages/libgd/package.py b/var/spack/repos/builtin/packages/libgd/package.py
index c70d8b56fd..d3cb549f4c 100644
--- a/var/spack/repos/builtin/packages/libgd/package.py
+++ b/var/spack/repos/builtin/packages/libgd/package.py
@@ -54,5 +54,6 @@ class Libgd(AutotoolsPackage):
depends_on('libiconv')
depends_on('libpng')
+ depends_on('jpeg')
depends_on('libtiff')
depends_on('fontconfig')