wok-next rev 20757

bwm-ng: add patch
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jun 02 12:36:31 2018 +0300 (2018-06-02)
parents a7f2dd74f3bf
children 102ce3af4b0f
files bwm-ng/receipt bwm-ng/stuff/patches/fix-inline.patch bwm-ng/stuff/patches/series
line diff
     1.1 --- a/bwm-ng/receipt	Sat Jun 02 04:42:15 2018 +0300
     1.2 +++ b/bwm-ng/receipt	Sat Jun 02 12:36:31 2018 +0300
     1.3 @@ -1,9 +1,9 @@
     1.4 -# SliTaz package receipt.
     1.5 +# SliTaz package receipt v2.
     1.6  
     1.7  PACKAGE="bwm-ng"
     1.8  VERSION="0.6.1"
     1.9  CATEGORY="network"
    1.10 -SHORT_DESC="Bandwidth Monitor NG."
    1.11 +SHORT_DESC="Bandwidth Monitor NG"
    1.12  MAINTAINER="pascal.bellard@slitaz.org"
    1.13  LICENSE="GPL2"
    1.14  WEB_SITE="https://www.gropp.org/?id=projects&sub=bwm-ng"
    1.15 @@ -11,17 +11,17 @@
    1.16  TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.17  WGET_URL="https://www.gropp.org/$PACKAGE/$TARBALL"
    1.18  
    1.19 -DEPENDS="ncurses"
    1.20  BUILD_DEPENDS="ncurses-dev"
    1.21  
    1.22 -# Rules to configure and make the package.
    1.23 -compile_rules()
    1.24 -{
    1.25 -	./configure $CONFIGURE_ARGS && make && make install
    1.26 +compile_rules() {
    1.27 +	./configure $CONFIGURE_ARGS &&
    1.28 +	make &&
    1.29 +	make install || return 1
    1.30 +
    1.31 +	cook_pick_docs README
    1.32  }
    1.33  
    1.34 -# Rules to gen a SliTaz package suitable for Tazpkg.
    1.35 -genpkg_rules()
    1.36 -{
    1.37 -	copy bin/
    1.38 +genpkg_rules() {
    1.39 +	copy @std
    1.40 +	DEPENDS="ncurses"
    1.41  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/bwm-ng/stuff/patches/fix-inline.patch	Sat Jun 02 12:36:31 2018 +0300
     2.3 @@ -0,0 +1,98 @@
     2.4 +This fixes many link errors:
     2.5 +
     2.6 +  ...: undefined reference to `...'
     2.7 +
     2.8 +As gcc5 doc about "Different semantics for inline functions":
     2.9 +
    2.10 +  > C99 extern inline: An externally visible function is generated; \
    2.11 +  > same as GNU89 inline.
    2.12 +
    2.13 +  > To fix this, either mark the function foo as extern, or add the \
    2.14 +  > following declaration: extern inline int foo (void);
    2.15 +
    2.16 +(from https://gcc.gnu.org/gcc-5/porting_to.html)
    2.17 +
    2.18 +--- a/src/bwm-ng.c
    2.19 ++++ b/src/bwm-ng.c
    2.20 +@@ -26,7 +26,7 @@
    2.21 + 
    2.22 + /* handle interrupt signal */
    2.23 + void sigint(int sig) FUNCATTR_NORETURN;
    2.24 +-inline void init(void);
    2.25 ++extern inline void init(void);
    2.26 + 
    2.27 + /* clear stuff and exit */
    2.28 + #ifdef __STDC__
    2.29 +--- a/src/options.c
    2.30 ++++ b/src/options.c
    2.31 +@@ -30,12 +30,12 @@
    2.32 + char *trim_whitespace(char *str);
    2.33 + int read_config(const char *config_file);
    2.34 + #endif
    2.35 +-inline int str2output_unit(char *optarg);
    2.36 ++extern inline int str2output_unit(char *optarg);
    2.37 + #if EXTENDED_STATS
    2.38 +-inline int str2output_type(char *optarg);
    2.39 ++extern inline int str2output_type(char *optarg);
    2.40 + #endif
    2.41 +-inline int str2out_method(char *optarg);
    2.42 +-inline int str2in_method(char *optarg);
    2.43 ++extern inline int str2out_method(char *optarg);
    2.44 ++extern inline int str2in_method(char *optarg);
    2.45 + 
    2.46 + #ifdef CONFIG_FILE
    2.47 +  /******************************************************************************
    2.48 +--- a/src/output.c
    2.49 ++++ b/src/output.c
    2.50 +@@ -25,13 +25,13 @@
    2.51 + #include "output.h"
    2.52 + 
    2.53 + inline static const char *output_type2str(void);
    2.54 +-inline const char *input2str(void);
    2.55 +-inline const char *show_all_if2str(void);
    2.56 +-inline ullong direction2value(char mode,struct inout_long stats);
    2.57 ++extern inline const char *input2str(void);
    2.58 ++extern inline const char *show_all_if2str(void);
    2.59 ++extern inline ullong direction2value(char mode,struct inout_long stats);
    2.60 + #if EXTENDED_STATS
    2.61 +-inline double direction_max2value(char mode,struct inouttotal_double stats,int items);
    2.62 ++extern inline double direction_max2value(char mode,struct inouttotal_double stats,int items);
    2.63 + #endif
    2.64 +-inline char *dyn_byte_value2str(double value,char *str,int buf_size);
    2.65 ++extern inline char *dyn_byte_value2str(double value,char *str,int buf_size);
    2.66 + char *values2str(char mode,t_iface_speed_stats stats,t_iface_stats full_stats,float multiplier,char *str,int buf_size);
    2.67 + 
    2.68 + inline static const char *output_type2str(void) {
    2.69 +@@ -306,7 +306,7 @@
    2.70 +     return str;
    2.71 + }
    2.72 + 
    2.73 +-inline char *dyn_bit_value2str(double value,char *str,int buf_size) {
    2.74 ++extern inline char *dyn_bit_value2str(double value,char *str,int buf_size) {
    2.75 +     if (dynamic) {
    2.76 +         if (value<1000)
    2.77 +             snprintf(str,buf_size,"%15.2f  ",value);
    2.78 +--- a/src/process.c
    2.79 ++++ b/src/process.c
    2.80 +@@ -29,16 +29,16 @@
    2.81 + inline long tvdiff(struct timeval newer, struct timeval older);
    2.82 + float get_time_delay(int iface_num);
    2.83 + #endif
    2.84 +-inline ullong calc_new_values(ullong new, ullong old);
    2.85 ++extern inline ullong calc_new_values(ullong new, ullong old);
    2.86 + t_iface_speed_stats convert2calced_values(t_iface_speed_stats new, t_iface_speed_stats old);
    2.87 + t_iface_speed_stats convert2calced_disk_values(t_iface_speed_stats new, t_iface_speed_stats old);
    2.88 + #if EXTENDED_STATS
    2.89 +-inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
    2.90 +-inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
    2.91 +-inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier);
    2.92 ++extern inline void sub_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
    2.93 ++extern inline void add_avg_values(struct inouttotal_double *values,struct inouttotal_double data);
    2.94 ++extern inline void save_avg_values(struct inouttotal_double *values,struct inouttotal_double *data,struct inout_long calced_stats,float multiplier);
    2.95 + void save_avg(struct t_avg *avg,struct iface_speed_stats calced_stats,float multiplier);
    2.96 + inline void save_sum(struct inout_long *stats,struct inout_long new_stats_values);
    2.97 +-inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier);
    2.98 ++extern inline void save_max(struct inouttotal_double *stats,struct inout_long calced_stats,float multiplier);
    2.99 + #endif
   2.100 + 
   2.101 + /* returns the whether to show the iface or not
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/bwm-ng/stuff/patches/series	Sat Jun 02 12:36:31 2018 +0300
     3.3 @@ -0,0 +1,1 @@
     3.4 +fix-inline.patch