Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 671486 - media-libs/glew-2.1.0 with media-libs/mesa-18.2.5 - /usr/include/GL/glext.h with /usr/include/GL/glew.h: error: conflicting declaration ‘typedef void (* PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum, GLenum, const GLfloat*)’
Summary: media-libs/glew-2.1.0 with media-libs/mesa-18.2.5 - /usr/include/GL/glext.h w...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-11-19 02:52 UTC by Israel G. Lugo
Modified: 2019-01-15 20:11 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log for =media-libs/opencolorio-1.1.0-r1 (build.log,137.59 KB, text/x-log)
2018-11-19 02:52 UTC, Israel G. Lugo
Details
Patch for glew for compatibility with newer mesa (glew-2.1.0-mesa-compat.patch,606 bytes, patch)
2018-12-14 11:43 UTC, Bernd Feige
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Israel G. Lugo 2018-11-19 02:52:26 UTC
Created attachment 555692 [details]
build.log for =media-libs/opencolorio-1.1.0-r1

Emerging media-libs/opencolorio-1.1.0-r1 fails with conflicting definitions for multiple types:

/usr/x86_64-pc-linux-gnu/gcc-bin/7.3.0/x86_64-pc-linux-gnu-g++ -DUSE_SSE -I/var/tmp/portage/media-libs/opencolorio-1.1.0-r1/work/opencolorio-1.1.0/export -Iexport  -DNDEBUG -O2 -march=native -mmmx -mpopcnt -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mavx -maes -mfpmath=sse -pipe -fno-stack-protector -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2 -msse2   -DCMAKE_BUILD_TYPE=Gentoo -MD -MT src/apps/ociodisplay/CMakeFiles/ociodisplay.dir/main.cpp.o -MF src/apps/ociodisplay/CMakeFiles/ociodisplay.dir/main.cpp.o.d -o src/apps/ociodisplay/CMakeFiles/ociodisplay.dir/main.cpp.o -c /var/tmp/portage/media-libs/opencolorio-1.1.0-r1/work/opencolorio-1.1.0/src/apps/ociodisplay/main.cpp
In file included from /var/tmp/portage/media-libs/opencolorio-1.1.0-r1/work/opencolorio-1.1.0/src/apps/ociodisplay/main.cpp:58:0:
/usr/include/GL/glext.h:12066:105: error: conflicting declaration ‘typedef void (* PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum, GLenum, const GLfloat*)’
 typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);
                                                                                                         ^
In file included from /var/tmp/portage/media-libs/opencolorio-1.1.0-r1/work/opencolorio-1.1.0/src/apps/ociodisplay/main.cpp:56:0:
/usr/include/GL/glew.h:18734:28: note: previous declaration as ‘typedef void (* PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum, GLenum, GLfloat*)’
 typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/tmp/portage/media-libs/opencolorio-1.1.0-r1/work/opencolorio-1.1.0/src/apps/ociodisplay/main.cpp:58:0:
/usr/include/GL/glext.h:12068:103: error: conflicting declaration ‘typedef void (* PFNGLFRAGMENTLIGHTIVSGIXPROC)(GLenum, GLenum, const GLint*)’
 typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params);
                                                                                                       ^
In file included from /var/tmp/portage/media-libs/opencolorio-1.1.0-r1/work/opencolorio-1.1.0/src/apps/ociodisplay/main.cpp:56:0:
/usr/include/GL/glew.h:18736:28: note: previous declaration as ‘typedef void (* PFNGLFRAGMENTLIGHTIVSGIXPROC)(GLenum, GLenum, GLint*)’
 typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params);
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
[...]


The root cause seems to be a mismatch in how these type definitions are guarded, in /usr/include/GL/glext.h and /usr/include/GL/glew.h.

/usr/include/GL/glext.h uses the GL_SGIX_fragment_lighting macro:

#ifndef GL_SGIX_fragment_lighting
#define GL_SGIX_fragment_lighting 1                                                                                   
#define GL_FRAGMENT_LIGHTING_SGIX         0x8400
#define GL_FRAGMENT_COLOR_MATERIAL_SGIX   0x8401
/* ... */
typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);                               
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);                     
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params);            
typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);              
/* ... */


whereas /usr/include/GL/glew.h uses GL_SGIX_fragment_specular_lighting:

#ifndef GL_SGIX_fragment_specular_lighting
#define GL_SGIX_fragment_specular_lighting 1

typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params);
/* ... */


I'm seeing this during an update of world.

/usr/include/GL/glext.h belongs to media-libs/mesa, which was among the updated packages (from media-libs/mesa-18.2.4 to media-libs/mesa-18.2.5).

/usr/include/GL/glew.h belongs to media-libs/glew-2.1.0, which has not been updated in a few months.

It would seem these two versions of mesa and glew are incompatible. Perhaps just setting both GL_SGIX_fragment_specular_lighting and GL_SGIX_fragment_lighting in glext.h might solve the problem?
Comment 1 Bernd Feige 2018-12-14 11:43:23 UTC
Created attachment 557762 [details, diff]
Patch for glew for compatibility with newer mesa

Note that this also breaks compilation of media-libs/opencolorio currently.

The attached patch fixes it. See here:
https://github.com/nigels-com/glew/pull/198/commits/d6c2c3b9ca52af697088f280c30fe5b27f7a694f
Comment 2 Andrei Slavoiu 2018-12-17 21:42:11 UTC
games-rpg/eternal-lands is also affected by this bug
Comment 3 hsk17 2019-01-15 16:04:01 UTC
another breakage:  can't emerge pymol because of the current incompatibility of glew and mesa

anyone out there to add the patch proposed by bernd feige in comment #2 to media-libs/glew-2.1.0.ebuild ??
Comment 4 Bernd 2019-01-15 16:58:19 UTC
(In reply to hsk17 from comment #3)
> anyone out there to add the patch proposed by bernd feige in comment #2 to
> media-libs/glew-2.1.0.ebuild ??

There's already a PR open as you can see from the comment above yours.
Comment 5 Larry the Git Cow gentoo-dev 2019-01-15 20:11:40 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76a4ccbb500e479ff544c6a49227f654d7e72a19

commit 76a4ccbb500e479ff544c6a49227f654d7e72a19
Author:     Bernd Waibel <waebbl@gmail.com>
AuthorDate: 2019-01-13 19:35:23 +0000
Commit:     Craig Andrews <candrews@gentoo.org>
CommitDate: 2019-01-15 20:11:27 +0000

    media-libs/glew: add mesa compatibility
    
    * update to EAPI 7
    * add compatibility for >=mesa-18 in glext.h
    
    Closes: https://bugs.gentoo.org/671486
    Closes: https://bugs.gentoo.org/673172
    Package-Manager: Portage-2.3.54, Repoman-2.3.12
    Signed-off-by: Bernd Waibel <waebbl@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/10828
    Signed-off-by: Craig Andrews <candrews@gentoo.org>

 media-libs/glew/files/glew-2.1.0-mesa-compat.patch |  21 +++++
 media-libs/glew/glew-2.1.0-r1.ebuild               | 104 +++++++++++++++++++++
 2 files changed, 125 insertions(+)