1 |
commit: 26f191abb524b771feccf464e81f5b0c8ba864eb |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 9 23:20:27 2017 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 9 23:20:43 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26f191ab |
7 |
|
8 |
net-analyzer/bwm-ng: Allow for compiling with Clang |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
net-analyzer/bwm-ng/bwm-ng-0.6.1-r1.ebuild | 15 +- |
13 |
.../files/bwm-ng-0.6.1-fix-buildsystem.patch | 4 +- |
14 |
.../bwm-ng/files/bwm-ng-0.6.1-static-inline.patch | 256 +++++++++++++++++++++ |
15 |
3 files changed, 265 insertions(+), 10 deletions(-) |
16 |
|
17 |
diff --git a/net-analyzer/bwm-ng/bwm-ng-0.6.1-r1.ebuild b/net-analyzer/bwm-ng/bwm-ng-0.6.1-r1.ebuild |
18 |
index 1a1421ba31..f822b25dc4 100644 |
19 |
--- a/net-analyzer/bwm-ng/bwm-ng-0.6.1-r1.ebuild |
20 |
+++ b/net-analyzer/bwm-ng/bwm-ng-0.6.1-r1.ebuild |
21 |
@@ -13,21 +13,20 @@ HOMEPAGE="http://www.gropp.org/" |
22 |
KEYWORDS="amd64 ~arm ~ppc x86" |
23 |
LICENSE="GPL-2" |
24 |
SLOT="0" |
25 |
-IUSE="html csv" |
26 |
+IUSE="csv html" |
27 |
|
28 |
-DEPEND=" |
29 |
- sys-libs/ncurses:0= |
30 |
- >=sys-apps/net-tools-1.60-r1 |
31 |
-" |
32 |
-RDEPEND="${DEPEND}" |
33 |
+RDEPEND="sys-libs/ncurses:0= |
34 |
+ >=sys-apps/net-tools-1.60-r1" |
35 |
+DEPEND="${RDEPEND}" |
36 |
|
37 |
PATCHES=( |
38 |
- "${FILESDIR}/${P}-fix-buildsystem.patch" |
39 |
+ "${FILESDIR}"/${P}-fix-buildsystem.patch |
40 |
+ "${FILESDIR}"/${P}-static-inline.patch |
41 |
) |
42 |
|
43 |
src_prepare() { |
44 |
- mv configure.{in,ac} || die |
45 |
default |
46 |
+ mv configure.{in,ac} || die |
47 |
eautoreconf |
48 |
} |
49 |
|
50 |
|
51 |
diff --git a/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-fix-buildsystem.patch b/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-fix-buildsystem.patch |
52 |
index 9b5f23c2ce..04c14392d6 100644 |
53 |
--- a/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-fix-buildsystem.patch |
54 |
+++ b/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-fix-buildsystem.patch |
55 |
@@ -2,8 +2,8 @@ |
56 |
* Fix ncurses underlinking caused by missing "-ltinfo" in $LIBS |
57 |
https://bugs.gentoo.org/show_bug.cgi?id=561718 |
58 |
|
59 |
---- a/configure.ac |
60 |
-+++ b/configure.ac |
61 |
+--- a/configure.in |
62 |
++++ b/configure.in |
63 |
@@ -3,7 +3,7 @@ |
64 |
|
65 |
AC_INIT([bwm-ng],[0.6.1],[bwmng@×××××.org],[bwm-ng]) |
66 |
|
67 |
diff --git a/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-static-inline.patch b/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-static-inline.patch |
68 |
new file mode 100644 |
69 |
index 0000000000..88e15ecefe |
70 |
--- /dev/null |
71 |
+++ b/net-analyzer/bwm-ng/files/bwm-ng-0.6.1-static-inline.patch |
72 |
@@ -0,0 +1,256 @@ |
73 |
+Make all 'inline' functions 'static inline' such that |
74 |
+the compiler can emit definitions when needed. |
75 |
+http://www.greenend.org.uk/rjk/tech/inline.html |
76 |
+ |
77 |
+--- a/src/bwm-ng.c |
78 |
++++ b/src/bwm-ng.c |
79 |
+@@ -26,7 +26,7 @@ |
80 |
+ |
81 |
+ /* handle interrupt signal */ |
82 |
+ void sigint(int sig) FUNCATTR_NORETURN; |
83 |
+-inline void init(void); |
84 |
++static inline void init(void); |
85 |
+ |
86 |
+ /* clear stuff and exit */ |
87 |
+ #ifdef __STDC__ |
88 |
+@@ -98,7 +98,7 @@ |
89 |
+ deinit(0, NULL); |
90 |
+ } |
91 |
+ |
92 |
+-inline void init(void) { |
93 |
++static inline void init(void) { |
94 |
+ if_count=0; |
95 |
+ delay=500; |
96 |
+ #if EXTENDED_STATS |
97 |
+--- a/src/help.c |
98 |
++++ b/src/help.c |
99 |
+@@ -24,9 +24,9 @@ |
100 |
+ #include "global_vars.h" |
101 |
+ #include "help.h" |
102 |
+ |
103 |
+-inline void print_help_line(const char *short_c,const char * long_c,const char *descr); |
104 |
++static inline void print_help_line(const char *short_c,const char * long_c,const char *descr); |
105 |
+ |
106 |
+-inline void print_help_line(const char *short_c,const char * long_c,const char *descr) { |
107 |
++static inline void print_help_line(const char *short_c,const char * long_c,const char *descr) { |
108 |
+ #ifdef LONG_OPTIONS |
109 |
+ printf(" %-23s",long_c); |
110 |
+ #else |
111 |
+--- a/src/options.c |
112 |
++++ b/src/options.c |
113 |
+@@ -30,12 +30,12 @@ |
114 |
+ char *trim_whitespace(char *str); |
115 |
+ int read_config(const char *config_file); |
116 |
+ #endif |
117 |
+-inline int str2output_unit(char *optarg); |
118 |
++static inline int str2output_unit(char *optarg); |
119 |
+ #if EXTENDED_STATS |
120 |
+-inline int str2output_type(char *optarg); |
121 |
++static inline int str2output_type(char *optarg); |
122 |
+ #endif |
123 |
+-inline int str2out_method(char *optarg); |
124 |
+-inline int str2in_method(char *optarg); |
125 |
++static inline int str2out_method(char *optarg); |
126 |
++static inline int str2in_method(char *optarg); |
127 |
+ |
128 |
+ #ifdef CONFIG_FILE |
129 |
+ /****************************************************************************** |
130 |
+@@ -65,7 +65,7 @@ |
131 |
+ /******************************************************************************/ |
132 |
+ #endif |
133 |
+ |
134 |
+-inline int str2output_unit(char *optarg) { |
135 |
++static inline int str2output_unit(char *optarg) { |
136 |
+ if (optarg) { |
137 |
+ if (!strcasecmp(optarg,"bytes")) return BYTES_OUT; |
138 |
+ if (!strcasecmp(optarg,"bits")) return BITS_OUT; |
139 |
+@@ -76,7 +76,7 @@ |
140 |
+ } |
141 |
+ |
142 |
+ #if EXTENDED_STATS |
143 |
+-inline int str2output_type(char *optarg) { |
144 |
++static inline int str2output_type(char *optarg) { |
145 |
+ if (optarg) { |
146 |
+ if (!strcasecmp(optarg,"rate")) return RATE_OUT; |
147 |
+ if (!strcasecmp(optarg,"max")) return MAX_OUT; |
148 |
+@@ -87,7 +87,7 @@ |
149 |
+ } |
150 |
+ #endif |
151 |
+ |
152 |
+-inline int str2out_method(char *optarg) { |
153 |
++static inline int str2out_method(char *optarg) { |
154 |
+ if (optarg) { |
155 |
+ if (!strcasecmp(optarg,"plain")) return PLAIN_OUT; |
156 |
+ #ifdef HAVE_CURSES |
157 |
+@@ -109,7 +109,7 @@ |
158 |
+ } |
159 |
+ |
160 |
+ |
161 |
+-inline int str2in_method(char *optarg) { |
162 |
++static inline int str2in_method(char *optarg) { |
163 |
+ if (optarg) { |
164 |
+ #ifdef PROC_NET_DEV |
165 |
+ if (!strcasecmp(optarg,"proc")) return PROC_IN; |
166 |
+--- a/src/output.c |
167 |
++++ b/src/output.c |
168 |
+@@ -25,13 +25,13 @@ |
169 |
+ #include "output.h" |
170 |
+ |
171 |
+ inline static const char *output_type2str(void); |
172 |
+-inline const char *input2str(void); |
173 |
+-inline const char *show_all_if2str(void); |
174 |
+-inline ullong direction2value(char mode,struct inout_long stats); |
175 |
++static inline const char *input2str(void); |
176 |
++static inline const char *show_all_if2str(void); |
177 |
++static inline ullong direction2value(char mode,struct inout_long stats); |
178 |
+ #if EXTENDED_STATS |
179 |
+-inline double direction_max2value(char mode,struct inouttotal_double stats,int items); |
180 |
++static inline double direction_max2value(char mode,struct inouttotal_double stats,int items); |
181 |
+ #endif |
182 |
+-inline char *dyn_byte_value2str(double value,char *str,int buf_size); |
183 |
++static inline char *dyn_byte_value2str(double value,char *str,int buf_size); |
184 |
+ char *values2str(char mode,t_iface_speed_stats stats,t_iface_stats full_stats,float multiplier,char *str,int buf_size); |
185 |
+ |
186 |
+ inline static const char *output_type2str(void) { |
187 |
+@@ -59,7 +59,7 @@ |
188 |
+ } |
189 |
+ |
190 |
+ |
191 |
+-inline const char *input2str(void) { |
192 |
++static inline const char *input2str(void) { |
193 |
+ switch (input_method) { |
194 |
+ #ifdef SYSCTL |
195 |
+ case SYSCTL_IN: |
196 |
+@@ -121,7 +121,7 @@ |
197 |
+ return ""; |
198 |
+ } |
199 |
+ |
200 |
+-inline const char *show_all_if2str(void) { |
201 |
++static inline const char *show_all_if2str(void) { |
202 |
+ switch (show_all_if) { |
203 |
+ case 1: |
204 |
+ return " (all)"; |
205 |
+@@ -262,7 +262,7 @@ |
206 |
+ } |
207 |
+ |
208 |
+ |
209 |
+-inline ullong direction2value(char mode,struct inout_long stats) { |
210 |
++static inline ullong direction2value(char mode,struct inout_long stats) { |
211 |
+ switch (mode) { |
212 |
+ case 0: |
213 |
+ return stats.in; |
214 |
+@@ -275,7 +275,7 @@ |
215 |
+ } |
216 |
+ |
217 |
+ #if EXTENDED_STATS |
218 |
+-inline double direction_max2value(char mode,struct inouttotal_double stats,int items) { |
219 |
++static inline double direction_max2value(char mode,struct inouttotal_double stats,int items) { |
220 |
+ switch (mode) { |
221 |
+ case 0: |
222 |
+ return (double)(stats.in/items); |
223 |
+@@ -288,7 +288,7 @@ |
224 |
+ } |
225 |
+ #endif |
226 |
+ |
227 |
+-inline char *dyn_byte_value2str(double value,char *str,int buf_size) { |
228 |
++static inline char *dyn_byte_value2str(double value,char *str,int buf_size) { |
229 |
+ if (dynamic) { |
230 |
+ if (value<1024) |
231 |
+ snprintf(str,buf_size,"%15.2f ",value); |
232 |
+@@ -306,7 +306,7 @@ |
233 |
+ return str; |
234 |
+ } |
235 |
+ |
236 |
+-inline char *dyn_bit_value2str(double value,char *str,int buf_size) { |
237 |
++static inline char *dyn_bit_value2str(double value,char *str,int buf_size) { |
238 |
+ if (dynamic) { |
239 |
+ if (value<1000) |
240 |
+ snprintf(str,buf_size,"%15.2f ",value); |
241 |
+--- a/src/process.c |
242 |
++++ b/src/process.c |
243 |
+@@ -26,19 +26,19 @@ |
244 |
+ |
245 |
+ short show_iface(char *instr, char *searchstr,char iface_is_up); |
246 |
+ #if HAVE_GETTIMEOFDAY |
247 |
+-inline long tvdiff(struct timeval newer, struct timeval older); |
248 |
++static inline long tvdiff(struct timeval newer, struct timeval older); |
249 |
+ float get_time_delay(int iface_num); |
250 |
+ #endif |
251 |
+-inline ullong calc_new_values(ullong new, ullong old); |
252 |
++static inline ullong calc_new_values(ullong new, ullong old); |
253 |
+ t_iface_speed_stats convert2calced_values(t_iface_speed_stats new, t_iface_speed_stats old); |
254 |
+ t_iface_speed_stats convert2calced_disk_values(t_iface_speed_stats new, t_iface_speed_stats old); |
255 |
+ #if EXTENDED_STATS |
256 |
+-inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data); |
257 |
+-inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data); |
258 |
+-inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier); |
259 |
++static inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data); |
260 |
++static inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data); |
261 |
++static inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier); |
262 |
+ void save_avg(struct t_avg *avg,struct iface_speed_stats calced_stats,float multiplier); |
263 |
+-inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values); |
264 |
+-inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier); |
265 |
++static inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values); |
266 |
++static inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier); |
267 |
+ #endif |
268 |
+ |
269 |
+ /* returns the whether to show the iface or not |
270 |
+@@ -74,7 +74,7 @@ |
271 |
+ |
272 |
+ #if HAVE_GETTIMEOFDAY |
273 |
+ /* Returns: the time difference in milliseconds. */ |
274 |
+-inline long tvdiff(struct timeval newer, struct timeval older) { |
275 |
++static inline long tvdiff(struct timeval newer, struct timeval older) { |
276 |
+ return labs((newer.tv_sec-older.tv_sec)*1000+ |
277 |
+ (newer.tv_usec-older.tv_usec)/1000); |
278 |
+ } |
279 |
+@@ -92,7 +92,7 @@ |
280 |
+ #endif |
281 |
+ |
282 |
+ /* basically new-old, but handles "overflow" of source aswell */ |
283 |
+-inline ullong calc_new_values(ullong new, ullong old) { |
284 |
++static inline ullong calc_new_values(ullong new, ullong old) { |
285 |
+ /* FIXME: WRAP_AROUND _might_ be wrong for libstatgrab, where the type is always long long */ |
286 |
+ return (new>=old) ? (ullong)(new-old) : (ullong)(( |
287 |
+ #ifdef HAVE_LIBKSTAT |
288 |
+@@ -133,13 +133,13 @@ |
289 |
+ |
290 |
+ #if EXTENDED_STATS |
291 |
+ /* sub old values from cached for avg stats */ |
292 |
+-inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { |
293 |
++static inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { |
294 |
+ values->in-=data.in; |
295 |
+ values->out-=data.out; |
296 |
+ values->total-=data.total; |
297 |
+ } |
298 |
+ |
299 |
+-inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { |
300 |
++static inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data) { |
301 |
+ values->in+=data.in; |
302 |
+ values->out+=data.out; |
303 |
+ values->total+=data.total; |
304 |
+@@ -148,7 +148,7 @@ |
305 |
+ |
306 |
+ /* put new-old bytes in inout_long struct into a inouttotal_double struct |
307 |
+ * and add values to cached .value struct */ |
308 |
+-inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier) { |
309 |
++static inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier) { |
310 |
+ data->in=calced_stats.in*multiplier; |
311 |
+ data->out=calced_stats.out*multiplier; |
312 |
+ data->total=(calced_stats.in+calced_stats.out)*multiplier; |
313 |
+@@ -198,13 +198,13 @@ |
314 |
+ } |
315 |
+ |
316 |
+ /* add current in and out bytes to totals struct */ |
317 |
+-inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values) { |
318 |
++static inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values) { |
319 |
+ stats->in+=new_stats_values.in; |
320 |
+ stats->out+=new_stats_values.out; |
321 |
+ } |
322 |
+ |
323 |
+ /* lookup old max values and save new if higher */ |
324 |
+-inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier) { |
325 |
++static inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier) { |
326 |
+ if (multiplier*calced_stats.in > stats->in) |
327 |
+ stats->in=multiplier*calced_stats.in; |
328 |
+ if (multiplier*calced_stats.out>stats->out) |