gnuplot: add X11 dependency and QT terminal (#9722)
This commit is contained in:
		
				
					committed by
					
						
						Peter Scheibel
					
				
			
			
				
	
			
			
			
						parent
						
							553cecaade
						
					
				
				
					commit
					e04adbca66
				
			@@ -46,6 +46,8 @@ class Gnuplot(AutotoolsPackage):
 | 
				
			|||||||
            description='Build with libcerf support')
 | 
					            description='Build with libcerf support')
 | 
				
			||||||
    variant('pbm',     default=False,
 | 
					    variant('pbm',     default=False,
 | 
				
			||||||
            description='Enable PBM (Portable Bit Map) and other older bitmap terminals')  # NOQA: ignore=E501
 | 
					            description='Enable PBM (Portable Bit Map) and other older bitmap terminals')  # NOQA: ignore=E501
 | 
				
			||||||
 | 
					    variant('qt',      default=False,
 | 
				
			||||||
 | 
					            description='Build with QT')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # required dependencies
 | 
					    # required dependencies
 | 
				
			||||||
    depends_on('readline')
 | 
					    depends_on('readline')
 | 
				
			||||||
@@ -60,6 +62,8 @@ class Gnuplot(AutotoolsPackage):
 | 
				
			|||||||
    depends_on('wx', when='+wx')
 | 
					    depends_on('wx', when='+wx')
 | 
				
			||||||
    depends_on('pango@1.10:', when='+wx')
 | 
					    depends_on('pango@1.10:', when='+wx')
 | 
				
			||||||
    depends_on('pango@1.10:', when='+cairo')
 | 
					    depends_on('pango@1.10:', when='+cairo')
 | 
				
			||||||
 | 
					    depends_on('libx11', when='+X')
 | 
				
			||||||
 | 
					    depends_on('qt@5.7:+opengl', when='+qt')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def configure_args(self):
 | 
					    def configure_args(self):
 | 
				
			||||||
        # see https://github.com/Homebrew/homebrew-core/blob/master/Formula/gnuplot.rb
 | 
					        # see https://github.com/Homebrew/homebrew-core/blob/master/Formula/gnuplot.rb
 | 
				
			||||||
@@ -86,6 +90,34 @@ def configure_args(self):
 | 
				
			|||||||
        else:
 | 
					        else:
 | 
				
			||||||
            options.append('--without-x')
 | 
					            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:
 | 
					        if '+wx' in spec:
 | 
				
			||||||
            options.append('--with-wx=%s' % spec['wx'].prefix)
 | 
					            options.append('--with-wx=%s' % spec['wx'].prefix)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
@@ -110,9 +142,6 @@ def configure_args(self):
 | 
				
			|||||||
        # '--with-pdf=%s' % spec['pdflib-lite'].prefix  (or pdflib)
 | 
					        # '--with-pdf=%s' % spec['pdflib-lite'].prefix  (or pdflib)
 | 
				
			||||||
        options.append('--without-pdf')
 | 
					        options.append('--without-pdf')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # TODO: Enable qt terminal qt@5.7
 | 
					 | 
				
			||||||
        options.append('--with-qt=no')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        # TODO: Enable lua-based terminals
 | 
					        # TODO: Enable lua-based terminals
 | 
				
			||||||
        options.append('--without-lua')
 | 
					        options.append('--without-lua')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user