1 |
commit: 76a4ccbb500e479ff544c6a49227f654d7e72a19 |
2 |
Author: Bernd Waibel <waebbl <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Jan 13 19:35:23 2019 +0000 |
4 |
Commit: Craig Andrews <candrews <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 15 20:11:27 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76a4ccbb |
7 |
|
8 |
media-libs/glew: add mesa compatibility |
9 |
|
10 |
* update to EAPI 7 |
11 |
* add compatibility for >=mesa-18 in glext.h |
12 |
|
13 |
Closes: https://bugs.gentoo.org/671486 |
14 |
Closes: https://bugs.gentoo.org/673172 |
15 |
Package-Manager: Portage-2.3.54, Repoman-2.3.12 |
16 |
Signed-off-by: Bernd Waibel <waebbl <AT> gmail.com> |
17 |
Closes: https://github.com/gentoo/gentoo/pull/10828 |
18 |
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org> |
19 |
|
20 |
media-libs/glew/files/glew-2.1.0-mesa-compat.patch | 21 +++++ |
21 |
media-libs/glew/glew-2.1.0-r1.ebuild | 104 +++++++++++++++++++++ |
22 |
2 files changed, 125 insertions(+) |
23 |
|
24 |
diff --git a/media-libs/glew/files/glew-2.1.0-mesa-compat.patch b/media-libs/glew/files/glew-2.1.0-mesa-compat.patch |
25 |
new file mode 100644 |
26 |
index 00000000000..391420e8138 |
27 |
--- /dev/null |
28 |
+++ b/media-libs/glew/files/glew-2.1.0-mesa-compat.patch |
29 |
@@ -0,0 +1,21 @@ |
30 |
+diff --git a/include/GL/glew.h b/include/GL/glew.h |
31 |
+index b5b6987..a9f9e4b 100644 |
32 |
+--- a/include/GL/glew.h |
33 |
++++ b/include/GL/glew.h |
34 |
+@@ -93,7 +93,7 @@ |
35 |
+ #if defined(__REGAL_H__) |
36 |
+ #error Regal.h included before glew.h |
37 |
+ #endif |
38 |
+-#if defined(__glext_h_) || defined(__GLEXT_H_) |
39 |
++#if defined(__glext_h_) || defined(__GLEXT_H_) || defined(__gl_glext_h_) |
40 |
+ #error glext.h included before glew.h |
41 |
+ #endif |
42 |
+ #if defined(__gl_ATI_h_) |
43 |
+@@ -109,6 +109,7 @@ |
44 |
+ #define __X_GL_H |
45 |
+ #define __glext_h_ |
46 |
+ #define __GLEXT_H_ |
47 |
++#define __gl_glext_h_ |
48 |
+ #define __gl_ATI_h_ |
49 |
+ |
50 |
+ #if defined(_WIN32) |
51 |
|
52 |
diff --git a/media-libs/glew/glew-2.1.0-r1.ebuild b/media-libs/glew/glew-2.1.0-r1.ebuild |
53 |
new file mode 100644 |
54 |
index 00000000000..4b13c557e27 |
55 |
--- /dev/null |
56 |
+++ b/media-libs/glew/glew-2.1.0-r1.ebuild |
57 |
@@ -0,0 +1,104 @@ |
58 |
+# Copyright 1999-2019 Gentoo Authors |
59 |
+# Distributed under the terms of the GNU General Public License v2 |
60 |
+ |
61 |
+EAPI=7 |
62 |
+ |
63 |
+inherit multilib-minimal toolchain-funcs |
64 |
+ |
65 |
+DESCRIPTION="The OpenGL Extension Wrangler Library" |
66 |
+HOMEPAGE="http://glew.sourceforge.net/" |
67 |
+SRC_URI="mirror://sourceforge/${PN}/${P}.tgz" |
68 |
+ |
69 |
+LICENSE="BSD MIT" |
70 |
+SLOT="0/$(ver_cut 1-2)" |
71 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" |
72 |
+IUSE="doc static-libs" |
73 |
+ |
74 |
+DEPEND=" |
75 |
+ >=virtual/glu-9.0-r1[${MULTILIB_USEDEP}] |
76 |
+ >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] |
77 |
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}] |
78 |
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}] |
79 |
+ >=x11-libs/libXi-1.7.2[${MULTILIB_USEDEP}] |
80 |
+ >=x11-libs/libXmu-1.1.1-r1[${MULTILIB_USEDEP}] |
81 |
+" |
82 |
+RDEPEND="${DEPEND}" |
83 |
+ |
84 |
+src_prepare() { |
85 |
+ local PATCHES=( |
86 |
+ "${FILESDIR}"/${PN}-2.0.0-install-headers.patch |
87 |
+ "${FILESDIR}"/${P}-mesa-compat.patch |
88 |
+ ) |
89 |
+ |
90 |
+ sed -i \ |
91 |
+ -e '/INSTALL/s:-s::' \ |
92 |
+ -e '/$(CC) $(CFLAGS) -o/s:$(CFLAGS):$(CFLAGS) $(LDFLAGS):' \ |
93 |
+ -e '/^.PHONY: .*\.pc$/d' \ |
94 |
+ Makefile || die |
95 |
+ |
96 |
+ if ! use static-libs ; then |
97 |
+ sed -i \ |
98 |
+ -e '/glew.lib:/s|lib/$(LIB.STATIC) ||' \ |
99 |
+ -e '/glew.lib.mx:/s|lib/$(LIB.STATIC.MX) ||' \ |
100 |
+ -e '/INSTALL.*LIB.STATIC/d' \ |
101 |
+ Makefile || die |
102 |
+ fi |
103 |
+ |
104 |
+ # don't do stupid Solaris specific stuff that won't work in Prefix |
105 |
+ cp config/Makefile.linux config/Makefile.solaris || die |
106 |
+ # and let freebsd be built as on linux too |
107 |
+ cp config/Makefile.linux config/Makefile.freebsd || die |
108 |
+ |
109 |
+ default |
110 |
+ multilib_copy_sources |
111 |
+} |
112 |
+ |
113 |
+glew_system() { |
114 |
+ # Set the SYSTEM variable instead of probing. #523444 #595280 |
115 |
+ case ${CHOST} in |
116 |
+ *linux*) echo "linux" ;; |
117 |
+ *-freebsd*) echo "freebsd" ;; |
118 |
+ *-darwin*) echo "darwin" ;; |
119 |
+ *-solaris*) echo "solaris" ;; |
120 |
+ mingw*|*-mingw*) echo "mingw" ;; |
121 |
+ *) die "Unknown system ${CHOST}" ;; |
122 |
+ esac |
123 |
+} |
124 |
+ |
125 |
+set_opts() { |
126 |
+ myglewopts=( |
127 |
+ AR="$(tc-getAR)" |
128 |
+ STRIP=true |
129 |
+ CC="$(tc-getCC)" |
130 |
+ LD="$(tc-getCC) ${LDFLAGS}" |
131 |
+ SYSTEM="$(glew_system)" |
132 |
+ M_ARCH="" |
133 |
+ LDFLAGS.EXTRA="" |
134 |
+ POPT="${CFLAGS}" |
135 |
+ ) |
136 |
+} |
137 |
+ |
138 |
+multilib_src_compile() { |
139 |
+ set_opts |
140 |
+ emake \ |
141 |
+ GLEW_PREFIX="${EPREFIX}/usr" \ |
142 |
+ GLEW_DEST="${EPREFIX}/usr" \ |
143 |
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ |
144 |
+ "${myglewopts[@]}" |
145 |
+} |
146 |
+ |
147 |
+multilib_src_install() { |
148 |
+ set_opts |
149 |
+ emake \ |
150 |
+ GLEW_DEST="${ED}/usr" \ |
151 |
+ LIBDIR="${ED}/usr/$(get_libdir)" \ |
152 |
+ PKGDIR="${ED}/usr/$(get_libdir)/pkgconfig" \ |
153 |
+ "${myglewopts[@]}" \ |
154 |
+ install.all |
155 |
+ |
156 |
+ dodoc README.md |
157 |
+ if use doc; then |
158 |
+ docinto html |
159 |
+ dodoc doc/* |
160 |
+ fi |
161 |
+} |