gnuplot: add X11 dependency and QT terminal (#9722)
This commit is contained in:
parent
553cecaade
commit
e04adbca66
@ -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 @@ def configure_args(self):
|
||||
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 @@ def configure_args(self):
|
||||
# '--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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user