1 |
commit: 9ccc914e8d3ddd9daedc72e84d685c316d33093f |
2 |
Author: Cristian Othón Martínez Vera <cfuga <AT> cfuga <DOT> mx> |
3 |
AuthorDate: Thu Mar 16 20:07:02 2023 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 19 00:08:22 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ccc914e |
7 |
|
8 |
net-misc/nx: fix musl build |
9 |
|
10 |
This patch comes from the following upstream commits. |
11 |
|
12 |
* mesa - Remove use of fpu_control.h (https://gitlab.freedesktop.org/mesa/mesa/-/commit/eb0ff1a1c0f1978d867c748bf2525f717a56bfce) |
13 |
|
14 |
* xorg/xserver - Drop workaround for pre-glibc linux (https://gitlab.freedesktop.org/xorg/xserver/-/commit/6634ffc4d26846dcf892f27682f9021f6d9956a9) |
15 |
|
16 |
Closes: https://github.com/gentoo/gentoo/pull/30165 |
17 |
Closes: https://bugs.gentoo.org/713418 |
18 |
|
19 |
Signed-off-by: Cristian Othón Martínez Vera <cfuga <AT> cfuga.mx> |
20 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
21 |
|
22 |
net-misc/nx/files/nx-3.5.99.25-musl.patch | 54 ++++++++++++++++++++++++++++++ |
23 |
net-misc/nx/files/nx-3.5.99.26-musl.patch | 55 +++++++++++++++++++++++++++++++ |
24 |
net-misc/nx/nx-3.5.99.25.ebuild | 6 +++- |
25 |
net-misc/nx/nx-3.5.99.26.ebuild | 3 +- |
26 |
4 files changed, 116 insertions(+), 2 deletions(-) |
27 |
|
28 |
diff --git a/net-misc/nx/files/nx-3.5.99.25-musl.patch b/net-misc/nx/files/nx-3.5.99.25-musl.patch |
29 |
new file mode 100644 |
30 |
index 000000000000..d7f76c04802c |
31 |
--- /dev/null |
32 |
+++ b/net-misc/nx/files/nx-3.5.99.25-musl.patch |
33 |
@@ -0,0 +1,54 @@ |
34 |
+diff -uNr a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h |
35 |
+--- a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h 2020-11-04 06:43:58.000000000 -0600 |
36 |
++++ b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h 2023-03-16 12:58:34.515215736 -0600 |
37 |
+@@ -62,9 +62,6 @@ |
38 |
+ #include <stdlib.h> |
39 |
+ #include <stdio.h> |
40 |
+ #include <string.h> |
41 |
+-#if defined(__linux__) && defined(__i386__) |
42 |
+-#include <fpu_control.h> |
43 |
+-#endif |
44 |
+ #endif |
45 |
+ #include <float.h> |
46 |
+ #include <stdarg.h> |
47 |
+diff -uNr a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c |
48 |
+--- a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c 2020-11-04 06:43:58.000000000 -0600 |
49 |
++++ b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c 2023-03-16 12:59:23.828001633 -0600 |
50 |
+@@ -1169,20 +1169,6 @@ |
51 |
+ static GLboolean initialized = GL_FALSE; |
52 |
+ if (!initialized) { |
53 |
+ init_sqrt_table(); |
54 |
+- |
55 |
+-#if defined(_FPU_GETCW) && defined(_FPU_SETCW) |
56 |
+- { |
57 |
+- const char *debug = _mesa_getenv("MESA_DEBUG"); |
58 |
+- if (debug && _mesa_strcmp(debug, "FP")==0) { |
59 |
+- /* die on FP exceptions */ |
60 |
+- fpu_control_t mask; |
61 |
+- _FPU_GETCW(mask); |
62 |
+- mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM |
63 |
+- | _FPU_MASK_OM | _FPU_MASK_UM); |
64 |
+- _FPU_SETCW(mask); |
65 |
+- } |
66 |
+- } |
67 |
+-#endif |
68 |
+ initialized = GL_TRUE; |
69 |
+ } |
70 |
+ |
71 |
+diff -uNr a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c |
72 |
+--- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c 2020-11-04 06:43:58.000000000 -0600 |
73 |
++++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c 2023-03-16 13:01:30.256598143 -0600 |
74 |
+@@ -40,13 +40,6 @@ |
75 |
+ |
76 |
+ #include <sys/types.h> |
77 |
+ #ifdef HAS_SHM |
78 |
+-#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2) |
79 |
+-/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */ |
80 |
+-/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers): |
81 |
+- Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define |
82 |
+- PAGE_SIZE. It is defined in <asm/page.h>. */ |
83 |
+-#include <asm/page.h> |
84 |
+-#endif |
85 |
+ #ifdef SVR4 |
86 |
+ #include <sys/sysmacros.h> |
87 |
+ #endif |
88 |
|
89 |
diff --git a/net-misc/nx/files/nx-3.5.99.26-musl.patch b/net-misc/nx/files/nx-3.5.99.26-musl.patch |
90 |
new file mode 100644 |
91 |
index 000000000000..738b7a2469aa |
92 |
--- /dev/null |
93 |
+++ b/net-misc/nx/files/nx-3.5.99.26-musl.patch |
94 |
@@ -0,0 +1,55 @@ |
95 |
+diff -uNr a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h |
96 |
+--- a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h 2021-02-04 07:34:56.000000000 -0600 |
97 |
++++ b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h 2023-03-16 13:55:33.983114692 -0600 |
98 |
+@@ -62,9 +62,6 @@ |
99 |
+ #include <stdlib.h> |
100 |
+ #include <stdio.h> |
101 |
+ #include <string.h> |
102 |
+-#if defined(__linux__) && defined(__i386__) |
103 |
+-#include <fpu_control.h> |
104 |
+-#endif |
105 |
+ #endif |
106 |
+ #include <float.h> |
107 |
+ #include <stdarg.h> |
108 |
+diff -uNr a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c |
109 |
+--- a/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c 2021-02-04 07:34:56.000000000 -0600 |
110 |
++++ b/nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c 2023-03-16 13:56:25.569122176 -0600 |
111 |
+@@ -1169,20 +1169,6 @@ |
112 |
+ static GLboolean initialized = GL_FALSE; |
113 |
+ if (!initialized) { |
114 |
+ init_sqrt_table(); |
115 |
+- |
116 |
+-#if defined(_FPU_GETCW) && defined(_FPU_SETCW) |
117 |
+- { |
118 |
+- const char *debug = _mesa_getenv("MESA_DEBUG"); |
119 |
+- if (debug && _mesa_strcmp(debug, "FP")==0) { |
120 |
+- /* die on FP exceptions */ |
121 |
+- fpu_control_t mask; |
122 |
+- _FPU_GETCW(mask); |
123 |
+- mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM |
124 |
+- | _FPU_MASK_OM | _FPU_MASK_UM); |
125 |
+- _FPU_SETCW(mask); |
126 |
+- } |
127 |
+- } |
128 |
+-#endif |
129 |
+ initialized = GL_TRUE; |
130 |
+ } |
131 |
+ |
132 |
+diff -uNr a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c |
133 |
+--- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c 2021-02-04 07:34:56.000000000 -0600 |
134 |
++++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c 2023-03-16 13:57:30.694956647 -0600 |
135 |
+@@ -40,14 +40,7 @@ |
136 |
+ |
137 |
+ #include <sys/types.h> |
138 |
+ #ifdef HAS_SHM |
139 |
+-#if defined(linux) && (!defined(__GNU_LIBRARY__) || __GNU_LIBRARY__ < 2) |
140 |
+-/* libc4 does not define __GNU_LIBRARY__, libc5 defines __GNU_LIBRARY__ as 1 */ |
141 |
+-/* Linux libc4 and libc5 only (because glibc doesn't include kernel headers): |
142 |
+- Linux 2.0.x and 2.2.x define SHMLBA as PAGE_SIZE, but forget to define |
143 |
+- PAGE_SIZE. It is defined in <asm/page.h>. */ |
144 |
+-#include <asm/page.h> |
145 |
+ #include <limits.h> |
146 |
+-#endif |
147 |
+ #ifdef SVR4 |
148 |
+ #include <sys/sysmacros.h> |
149 |
+ #endif |
150 |
|
151 |
diff --git a/net-misc/nx/nx-3.5.99.25.ebuild b/net-misc/nx/nx-3.5.99.25.ebuild |
152 |
index 10bdd7240081..90e978be610a 100644 |
153 |
--- a/net-misc/nx/nx-3.5.99.25.ebuild |
154 |
+++ b/net-misc/nx/nx-3.5.99.25.ebuild |
155 |
@@ -1,4 +1,4 @@ |
156 |
-# Copyright 1999-2022 Gentoo Authors |
157 |
+# Copyright 1999-2023 Gentoo Authors |
158 |
# Distributed under the terms of the GNU General Public License v2 |
159 |
|
160 |
EAPI=7 |
161 |
@@ -42,6 +42,10 @@ BDEPEND="sys-apps/which |
162 |
|
163 |
S="${WORKDIR}/nx-libs-${PV}" |
164 |
|
165 |
+PATCHES=( |
166 |
+ "${FILESDIR}/${PN}-3.5.99.25-musl.patch" |
167 |
+) |
168 |
+ |
169 |
src_prepare() { |
170 |
default |
171 |
|
172 |
|
173 |
diff --git a/net-misc/nx/nx-3.5.99.26.ebuild b/net-misc/nx/nx-3.5.99.26.ebuild |
174 |
index 2e50edab9c33..55392ed99c6b 100644 |
175 |
--- a/net-misc/nx/nx-3.5.99.26.ebuild |
176 |
+++ b/net-misc/nx/nx-3.5.99.26.ebuild |
177 |
@@ -1,4 +1,4 @@ |
178 |
-# Copyright 1999-2022 Gentoo Authors |
179 |
+# Copyright 1999-2023 Gentoo Authors |
180 |
# Distributed under the terms of the GNU General Public License v2 |
181 |
|
182 |
EAPI=7 |
183 |
@@ -47,6 +47,7 @@ PATCHES=( |
184 |
"${FILESDIR}/${PN}-3.5.99.26-binutils-2.36.patch" |
185 |
# https://github.com/ArcticaProject/nx-libs/pull/1023 |
186 |
"${FILESDIR}/${PN}-3.5.99.26-riscv64-support.patch" |
187 |
+ "${FILESDIR}/${PN}-3.5.99.26-musl.patch" |
188 |
) |
189 |
|
190 |
src_prepare() { |