1 |
commit: b65f37dd215869eae0bc6fd367a515281e301f6a |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 21 23:04:19 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 21 23:04:29 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b65f37dd |
7 |
|
8 |
app-text/mupdf: tweak for gcc-10 |
9 |
|
10 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
11 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
12 |
|
13 |
.../mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch | 80 ++++++++++++++++++++++ |
14 |
app-text/mupdf/mupdf-1.16.1.ebuild | 3 +- |
15 |
2 files changed, 82 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/app-text/mupdf/files/mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch b/app-text/mupdf/files/mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..c9c37e2efac |
20 |
--- /dev/null |
21 |
+++ b/app-text/mupdf/files/mupdf-1.16.1-freeglut-fg_gl2-gcc-10.patch |
22 |
@@ -0,0 +1,80 @@ |
23 |
+From 5791564dd934d193df771a0a7c52013e9f456aa1 Mon Sep 17 00:00:00 2001 |
24 |
+From: Sergei Trofimovich <slyfox@g.o> |
25 |
+Date: Tue, 21 Jan 2020 22:33:49 +0000 |
26 |
+Subject: [PATCH] fg_gl2: fix build failure against gcc-10 |
27 |
+ |
28 |
+On gcc-10 (and gcc-9 -fno-common) build fails as: |
29 |
+ |
30 |
+``` |
31 |
+[ 31%] Linking C executable bin/Lorenz_static |
32 |
+/usr/bin/cmake -E cmake_link_script CMakeFiles/Lorenz_static.dir/link.txt --verbose=1 |
33 |
+/usr/lib/ccache/bin/cc -Wall -pedantic -rdynamic CMakeFiles/Lorenz_static.dir/progs/demos/Lorenz/lorenz.c.o \ |
34 |
+ -o bin/Lorenz_static -lGLU -lGL -lm -lX11 -lXrandr -lXxf86vm -lXi -lm lib/libglut.a -lGL -lm -lX11 -lXrandr -lXxf86vm -lXi |
35 |
+ld: lib/libglut.a(fg_gl2.c.o):(.bss+0x0): |
36 |
+ multiple definition of `fghGenBuffers'; lib/libglut.a(fg_window.c.o):(.bss+0x0): first defined here |
37 |
+ld: lib/libglut.a(fg_gl2.c.o):(.bss+0x8): |
38 |
+ multiple definition of `fghDeleteBuffers'; lib/libglut.a(fg_window.c.o):(.bss+0x8): first defined here |
39 |
+``` |
40 |
+ |
41 |
+Note: duplicate definition comes here from 'fg_gl2.h'. |
42 |
+The fix is to move declaration to a 'fg_gl2.c' file. |
43 |
+ |
44 |
+gcc-10 will change the default from -fcommon to fno-common: |
45 |
+https://gcc.gnu.org/PR85678. |
46 |
+ |
47 |
+The error also happens if CFLAGS=-fno-common passed explicitly. |
48 |
+ |
49 |
+Bug: https://bugs.gentoo.org/705840 |
50 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
51 |
+--- |
52 |
+ freeglut/freeglut/src/fg_gl2.c | 12 ++++++++++++ |
53 |
+ freeglut/freeglut/src/fg_gl2.h | 14 +++++++------- |
54 |
+ 2 files changed, 19 insertions(+), 7 deletions(-) |
55 |
+ |
56 |
+--- a/thirdparty/freeglut/src/fg_gl2.c |
57 |
++++ b/thirdparty/freeglut/src/fg_gl2.c |
58 |
+@@ -27,6 +27,18 @@ |
59 |
+ #include "fg_internal.h" |
60 |
+ #include "fg_gl2.h" |
61 |
+ |
62 |
++#ifdef GL_ES_VERSION_2_0 |
63 |
++/* Use existing functions on GLES 2.0 */ |
64 |
++#else |
65 |
++FGH_PFNGLGENBUFFERSPROC fghGenBuffers; |
66 |
++FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; |
67 |
++FGH_PFNGLBINDBUFFERPROC fghBindBuffer; |
68 |
++FGH_PFNGLBUFFERDATAPROC fghBufferData; |
69 |
++FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; |
70 |
++FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; |
71 |
++FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; |
72 |
++#endif |
73 |
++ |
74 |
+ void FGAPIENTRY glutSetVertexAttribCoord3(GLint attrib) { |
75 |
+ if (fgStructure.CurrentWindow != NULL) |
76 |
+ fgStructure.CurrentWindow->Window.attribute_v_coord = attrib; |
77 |
+--- a/thirdparty/freeglut/src/fg_gl2.h |
78 |
++++ b/thirdparty/freeglut/src/fg_gl2.h |
79 |
+@@ -67,13 +67,13 @@ typedef void (APIENTRY *FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); |
80 |
+ typedef void (APIENTRY *FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); |
81 |
+ typedef void (APIENTRY *FGH_PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); |
82 |
+ |
83 |
+-FGH_PFNGLGENBUFFERSPROC fghGenBuffers; |
84 |
+-FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; |
85 |
+-FGH_PFNGLBINDBUFFERPROC fghBindBuffer; |
86 |
+-FGH_PFNGLBUFFERDATAPROC fghBufferData; |
87 |
+-FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; |
88 |
+-FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; |
89 |
+-FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; |
90 |
++extern FGH_PFNGLGENBUFFERSPROC fghGenBuffers; |
91 |
++extern FGH_PFNGLDELETEBUFFERSPROC fghDeleteBuffers; |
92 |
++extern FGH_PFNGLBINDBUFFERPROC fghBindBuffer; |
93 |
++extern FGH_PFNGLBUFFERDATAPROC fghBufferData; |
94 |
++extern FGH_PFNGLENABLEVERTEXATTRIBARRAYPROC fghEnableVertexAttribArray; |
95 |
++extern FGH_PFNGLDISABLEVERTEXATTRIBARRAYPROC fghDisableVertexAttribArray; |
96 |
++extern FGH_PFNGLVERTEXATTRIBPOINTERPROC fghVertexAttribPointer; |
97 |
+ |
98 |
+ # endif |
99 |
+ |
100 |
+-- |
101 |
+2.25.0 |
102 |
+ |
103 |
|
104 |
diff --git a/app-text/mupdf/mupdf-1.16.1.ebuild b/app-text/mupdf/mupdf-1.16.1.ebuild |
105 |
index 117de7bc199..a7b99956515 100644 |
106 |
--- a/app-text/mupdf/mupdf-1.16.1.ebuild |
107 |
+++ b/app-text/mupdf/mupdf-1.16.1.ebuild |
108 |
@@ -1,4 +1,4 @@ |
109 |
-# Copyright 1999-2019 Gentoo Authors |
110 |
+# Copyright 1999-2020 Gentoo Authors |
111 |
# Distributed under the terms of the GNU General Public License v2 |
112 |
|
113 |
EAPI=7 |
114 |
@@ -46,6 +46,7 @@ PATCHES=( |
115 |
"${FILESDIR}"/${PN}-1.10a-add-desktop-pc-xpm-files.patch |
116 |
# See bugs #662352 |
117 |
"${FILESDIR}"/${PN}-1.15-openssl-x11.patch |
118 |
+ "${FILESDIR}"/${PN}-1.16.1-freeglut-fg_gl2-gcc-10.patch |
119 |
) |
120 |
|
121 |
src_prepare() { |