From 7e6386803e1f43c9541b20e8fdda358b90dc0e82 Mon Sep 17 00:00:00 2001 From: Amiya Maji Date: Tue, 6 Apr 2021 03:45:00 -0400 Subject: fltk: add explicit dependency on gl and a variant to activate it (#22761) * The fltk package can build libraries with opengl support. By default, the configure script looks for opengl headers in the sytem include paths. If 'devel' packages have not been installed on the system it omits the 'ftlk_gl.so' library. This can break packages like 'octave' which expects 'fltk' to have opengl support and looks for the library 'fltk_gl'. Make opengl support explicit in fltk by adding a dependency on 'gl' and adding a new variant of the same name 'gl' (default On). With these modifications 'fltk_gl' and 'octave' build successfully on CentOS8. The default behavior is to always enable opengl. https://www.fltk.org/doc-1.3/intro.html --- var/spack/repos/builtin/packages/fltk/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/fltk/package.py b/var/spack/repos/builtin/packages/fltk/package.py index 2c1f93578d..99509b6308 100644 --- a/var/spack/repos/builtin/packages/fltk/package.py +++ b/var/spack/repos/builtin/packages/fltk/package.py @@ -38,6 +38,12 @@ class Fltk(Package): variant('shared', default=True, description='Enables the build of shared libraries') + variant('gl', default=True, + description='Enables opengl support') + + # variant dependencies + depends_on('gl', when='+gl') + def install(self, spec, prefix): options = ['--prefix=%s' % prefix, '--enable-localjpeg', @@ -47,6 +53,9 @@ class Fltk(Package): if '+shared' in spec: options.append('--enable-shared') + if '~gl' in spec: + options.append('--disable-gl') + # FLTK needs to be built in-source configure(*options) make() -- cgit v1.2.3-60-g2f50