1 |
commit: 4ca7fb9be00c1d64e8d963012bca7fb0e64fb575 |
2 |
Author: Josiah Mullins <JoMull01 <AT> protonmail <DOT> com> |
3 |
AuthorDate: Wed Aug 11 22:10:35 2021 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 24 08:50:26 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ca7fb9b |
7 |
|
8 |
net-im/toxic: Fix incorrect header file inclusion |
9 |
|
10 |
It seems that the upstream developer believes that |
11 |
the macros NAME_MAX and PATH_MAX are defined in |
12 |
<limits.h> when they are really defined in |
13 |
<linux/limits.h>. More interestingly, it seems |
14 |
that GCC automatically corrects for this while |
15 |
clang does not. This commit adds patches necessary |
16 |
to fix this as well as some minor fixes. |
17 |
|
18 |
Signed-off-by: Josiah Mullins <JoMull01 <AT> protonmail.com> |
19 |
Closes: https://bugs.gentoo.org/803404 |
20 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
21 |
|
22 |
.../files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch | 49 ++++++++++++++++++++++ |
23 |
.../files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch | 49 ++++++++++++++++++++++ |
24 |
...{toxic-0.10.1.ebuild => toxic-0.10.1-r1.ebuild} | 14 +++++-- |
25 |
...toxic-0.8.3-r2.ebuild => toxic-0.8.3-r3.ebuild} | 11 +++-- |
26 |
4 files changed, 115 insertions(+), 8 deletions(-) |
27 |
|
28 |
diff --git a/net-im/toxic/files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch b/net-im/toxic/files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch |
29 |
new file mode 100644 |
30 |
index 00000000000..68cb0bb59cc |
31 |
--- /dev/null |
32 |
+++ b/net-im/toxic/files/toxic-0.10.1-NAME_MAX-and-PATH_MAX.patch |
33 |
@@ -0,0 +1,49 @@ |
34 |
+diff -ruN src/autocomplete.c src/autocomplete.c |
35 |
+--- src/autocomplete.c 2021-07-26 15:04:59.172715491 -0400 |
36 |
++++ src/autocomplete.c 2021-07-26 15:22:06.652686609 -0400 |
37 |
+@@ -25,10 +25,12 @@ |
38 |
+ #include <string.h> |
39 |
+ |
40 |
+ #ifdef __APPLE__ |
41 |
+-#include <sys/types.h> |
42 |
+ #include <sys/dir.h> |
43 |
++#include <sys/types.h> |
44 |
++#include <sys/sysinfo.h> |
45 |
+ #else |
46 |
+ #include <dirent.h> |
47 |
++#include <linux/limits.h> |
48 |
+ #endif /* __APPLE__ */ |
49 |
+ |
50 |
+ #include "configdir.h" |
51 |
+diff -ruN src/file_transfers.h src/file_transfers.h |
52 |
+--- src/file_transfers.h 2021-07-26 15:39:36.765990567 -0400 |
53 |
++++ src/file_transfers.h 2021-07-26 15:39:41.899323757 -0400 |
54 |
+@@ -24,6 +24,12 @@ |
55 |
+ #define FILE_TRANSFERS_H |
56 |
+ |
57 |
+ #include <limits.h> |
58 |
++//This includes NAME_MAX and PATH_MAX |
59 |
++#ifdef __APPLE__ |
60 |
++#include <sys/sysinfo.h> |
61 |
++#elif __linux__ |
62 |
++#include <linux/limits.h> |
63 |
++#endif |
64 |
+ |
65 |
+ #include "notify.h" |
66 |
+ #include "toxic.h" |
67 |
+diff -ruN src/settings.h src/settings.h |
68 |
+--- src/settings.h 2021-07-26 15:04:59.176048823 -0400 |
69 |
++++ src/settings.h 2021-07-26 15:12:01.772703590 -0400 |
70 |
+@@ -24,6 +24,12 @@ |
71 |
+ #define SETTINGS_H |
72 |
+ |
73 |
+ #include <limits.h> |
74 |
++//This includes NAME_MAX and PATH_MAX |
75 |
++#ifdef __APPLE__ |
76 |
++#include <sys/sysinfo.h> |
77 |
++#elif __linux__ |
78 |
++#include <linux/limits.h> |
79 |
++#endif |
80 |
+ |
81 |
+ #include <tox/tox.h> |
82 |
+ |
83 |
|
84 |
diff --git a/net-im/toxic/files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch b/net-im/toxic/files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch |
85 |
new file mode 100644 |
86 |
index 00000000000..11dc43c6b77 |
87 |
--- /dev/null |
88 |
+++ b/net-im/toxic/files/toxic-0.8.3-NAME_MAX-and-PATH_MAX.patch |
89 |
@@ -0,0 +1,49 @@ |
90 |
+diff -ruN src/autocomplete.c src/autocomplete.c |
91 |
+--- src/autocomplete.c 2021-07-26 10:43:37.453154392 -0400 |
92 |
++++ src/autocomplete.c 2021-07-26 10:59:29.856460938 -0400 |
93 |
+@@ -27,8 +27,11 @@ |
94 |
+ #ifdef __APPLE__ |
95 |
+ #include <sys/types.h> |
96 |
+ #include <sys/dir.h> |
97 |
+-#else |
98 |
++//This include NAME_MAX |
99 |
++#include <sys/sysinfo.h> |
100 |
++#elif __linux__ |
101 |
+ #include <dirent.h> |
102 |
++#include <linux/limits.h>//This includes NAME_MAX |
103 |
+ #endif /* __APPLE__ */ |
104 |
+ |
105 |
+ #include "windows.h" |
106 |
+diff -ruN src/file_transfers.h src/file_transfers.h |
107 |
+--- src/file_transfers.h 2021-07-26 10:43:37.456487724 -0400 |
108 |
++++ src/file_transfers.h 2021-07-26 11:41:30.513057111 -0400 |
109 |
+@@ -24,6 +24,12 @@ |
110 |
+ #define FILE_TRANSFERS_H |
111 |
+ |
112 |
+ #include <limits.h> |
113 |
++//This includes PATH_MAX |
114 |
++#ifdef __APPLE__ |
115 |
++#include <sys/sysinfo.h> |
116 |
++#elif __linux__ |
117 |
++#include <linux/limits.h> |
118 |
++#endif |
119 |
+ |
120 |
+ #include "toxic.h" |
121 |
+ #include "windows.h" |
122 |
+diff -ruN src/settings.h src/settings.h |
123 |
+--- src/settings.h 2021-07-26 10:43:37.459821058 -0400 |
124 |
++++ src/settings.h 2021-07-26 11:45:46.709716594 -0400 |
125 |
+@@ -25,6 +25,13 @@ |
126 |
+ |
127 |
+ #include <limits.h> |
128 |
+ |
129 |
++//This includes PATH_MAX |
130 |
++#ifdef __APPLE__ |
131 |
++#include <sys/sysinfo.h> |
132 |
++#elif __linux__ |
133 |
++#include <linux/limits.h> |
134 |
++#endif |
135 |
++ |
136 |
+ #include <tox/tox.h> |
137 |
+ |
138 |
+ /* Represents line_* hints max strlen */ |
139 |
|
140 |
diff --git a/net-im/toxic/toxic-0.10.1.ebuild b/net-im/toxic/toxic-0.10.1-r1.ebuild |
141 |
similarity index 83% |
142 |
rename from net-im/toxic/toxic-0.10.1.ebuild |
143 |
rename to net-im/toxic/toxic-0.10.1-r1.ebuild |
144 |
index 4f0639961dc..931dd62fc29 100644 |
145 |
--- a/net-im/toxic/toxic-0.10.1.ebuild |
146 |
+++ b/net-im/toxic/toxic-0.10.1-r1.ebuild |
147 |
@@ -3,7 +3,7 @@ |
148 |
|
149 |
EAPI=7 |
150 |
|
151 |
-PYTHON_COMPAT=( python3_{7,8,9} ) |
152 |
+PYTHON_COMPAT=( python3_{7,8,9,10} ) |
153 |
|
154 |
inherit python-single-r1 xdg |
155 |
|
156 |
@@ -18,10 +18,12 @@ IUSE="+audio-notify debug doc llvm notification png python qrcode +sound +video |
157 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) |
158 |
video? ( sound X ) " |
159 |
|
160 |
-RDEPEND="dev-libs/libconfig:= |
161 |
- net-libs/tox:= |
162 |
+BDEPEND="dev-libs/libconfig" |
163 |
+ |
164 |
+RDEPEND="net-libs/tox:= |
165 |
net-misc/curl |
166 |
sys-libs/ncurses:= |
167 |
+ sys-kernel/linux-headers |
168 |
audio-notify? ( |
169 |
media-libs/freealut |
170 |
media-libs/openal |
171 |
@@ -58,6 +60,10 @@ src_prepare() { |
172 |
#This line changes the "lazy set if absent" assignment to a "lazy set" assignment. |
173 |
#look below in src_configure to see how CFLAGS are passed to the makefile in USER_CFLAGS |
174 |
sed -i -e 's/?=/=/g' Makefile || die "Unable to force CFLAGS and LDFLAGS" |
175 |
+ #Fix incomplete invocation of python-config |
176 |
+ sed -i -e "s/--ldflags/--ldflags --embed/" cfg/checks/python.mk || die "Unable to fix python linking" |
177 |
+ #Fix incorrect include statements for NAME_MAX and PATH_MAX macros |
178 |
+ eapply -p0 "${FILESDIR}/${P}-NAME_MAX-and-PATH_MAX.patch" || die "Unable to fix header inclusion" |
179 |
} |
180 |
|
181 |
src_configure() { |
182 |
@@ -101,6 +107,6 @@ src_configure() { |
183 |
src_install() { |
184 |
default |
185 |
if ! use audio-notify; then |
186 |
- rm -r "${ED}"/usr/share/${PN}/sounds || die "Could not remove sounds directory" |
187 |
+ rm -r "${ED}"/usr/share/"${PN}"/sounds || die "Could not remove sounds directory" |
188 |
fi |
189 |
} |
190 |
|
191 |
diff --git a/net-im/toxic/toxic-0.8.3-r2.ebuild b/net-im/toxic/toxic-0.8.3-r3.ebuild |
192 |
similarity index 85% |
193 |
rename from net-im/toxic/toxic-0.8.3-r2.ebuild |
194 |
rename to net-im/toxic/toxic-0.8.3-r3.ebuild |
195 |
index fb4792fc89e..97ed2aa0ae3 100644 |
196 |
--- a/net-im/toxic/toxic-0.8.3-r2.ebuild |
197 |
+++ b/net-im/toxic/toxic-0.8.3-r3.ebuild |
198 |
@@ -3,7 +3,7 @@ |
199 |
|
200 |
EAPI=7 |
201 |
|
202 |
-PYTHON_COMPAT=( python3_{7,8,9} ) |
203 |
+PYTHON_COMPAT=( python3_{7,8,9,10} ) |
204 |
|
205 |
inherit python-single-r1 xdg |
206 |
|
207 |
@@ -17,11 +17,12 @@ KEYWORDS="amd64 x86" |
208 |
IUSE="notification python qrcode +sound +video +X" |
209 |
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
210 |
|
211 |
-RDEPEND=" |
212 |
- dev-libs/libconfig:= |
213 |
- >=net-libs/tox-0.2.8:= |
214 |
+BDEPEND="dev-libs/libconfig" |
215 |
+ |
216 |
+RDEPEND="net-libs/tox:= |
217 |
net-misc/curl |
218 |
sys-libs/ncurses:= |
219 |
+ sys-kernel/linux-headers |
220 |
notification? ( x11-libs/libnotify ) |
221 |
python? ( ${PYTHON_DEPS} ) |
222 |
qrcode? ( media-gfx/qrencode:= ) |
223 |
@@ -45,6 +46,8 @@ src_prepare() { |
224 |
default |
225 |
#prevent man files from being compressed. |
226 |
sed -i -e "/gzip/d" cfg/targets/install.mk || die "Unable to prevent compression of man pages." |
227 |
+ #Fix incorrect include declarations for NAME_MAX and PATH_MAX. |
228 |
+ eapply -p0 "${FILESDIR}/${P}-NAME_MAX-and-PATH_MAX.patch" || die "Unable to fix include statements" |
229 |
} |
230 |
|
231 |
src_configure() { |