summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/gnuplot/package.py35
1 files changed, 32 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/gnuplot/package.py b/var/spack/repos/builtin/packages/gnuplot/package.py
index 374d6cd234..e010c4d3fe 100644
--- a/var/spack/repos/builtin/packages/gnuplot/package.py
+++ b/var/spack/repos/builtin/packages/gnuplot/package.py
@@ -46,6 +46,8 @@ class Gnuplot(AutotoolsPackage):
description='Build with libcerf support')
variant('pbm', default=False,
description='Enable PBM (Portable Bit Map) and other older bitmap terminals') # NOQA: ignore=E501
+ variant('qt', default=False,
+ description='Build with QT')
# required dependencies
depends_on('readline')
@@ -60,6 +62,8 @@ class Gnuplot(AutotoolsPackage):
depends_on('wx', when='+wx')
depends_on('pango@1.10:', when='+wx')
depends_on('pango@1.10:', when='+cairo')
+ depends_on('libx11', when='+X')
+ depends_on('qt@5.7:+opengl', when='+qt')
def configure_args(self):
# see https://github.com/Homebrew/homebrew-core/blob/master/Formula/gnuplot.rb
@@ -86,6 +90,34 @@ class Gnuplot(AutotoolsPackage):
else:
options.append('--without-x')
+ if '+qt' in spec:
+ options.append('--with-qt=qt5')
+ # QT needs C++11 compiler:
+ os.environ['CXXFLAGS'] = '{0}'.format(self.compiler.cxx11_flag)
+
+ if spec.satisfies('platform=darwin'):
+ qt_path = spec['qt'].prefix
+ # see
+ # http://gnuplot.10905.n7.nabble.com/Building-with-Qt-depends-on-pkg-config-Qt-5-term-doesn-t-work-on-OS-X-td18063.html
+ os.environ['QT_LIBS'] = (
+ '-F{0}/lib ' +
+ '-framework QtCore ' +
+ '-framework QtGui ' +
+ '-framework QtWidgets ' +
+ '-framework QtNetwork ' +
+ '-framework QtSvg ' +
+ '-framework QtPrintSupport').format(qt_path)
+
+ os.environ['QT_CFLAGS'] = (
+ '-F{0}/lib ' +
+ '-I{0}/lib/QtCore.framework/Headers ' +
+ '-I{0}/lib/QtGui.framework/Headers ' +
+ '-I{0}/lib/QtWidgets.framework/Headers ' +
+ '-I{0}/lib/QtNetwork.framework/Headers ' +
+ '-I{0}/lib/QtSvg.framework/Headers').format(qt_path)
+ else:
+ options.append('--with-qt=no')
+
if '+wx' in spec:
options.append('--with-wx=%s' % spec['wx'].prefix)
else:
@@ -110,9 +142,6 @@ class Gnuplot(AutotoolsPackage):
# '--with-pdf=%s' % spec['pdflib-lite'].prefix (or pdflib)
options.append('--without-pdf')
- # TODO: Enable qt terminal qt@5.7
- options.append('--with-qt=no')
-
# TODO: Enable lua-based terminals
options.append('--without-lua')