Skip to content

Commit

Permalink
liboping*: fix building
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Dec 13, 2024
1 parent b2fab58 commit 9c50ce2
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 8 deletions.
23 changes: 15 additions & 8 deletions net/liboping/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ PortGroup github 1.0

name liboping
categories net
platforms darwin
license LGPL-2.1 GPL-2
maintainers nomaintainer
description C library and program for ICMP echo requests
Expand All @@ -22,25 +21,33 @@ if {${subport} eq ${name}} {
checksums rmd160 97cfca317c5884f68a0f7d88d5b022864e4f91ce \
sha256 c206b05743d0730814be3115b48abd0b00016677525153c78730da307aba0846 \
size 395596

# https://github.com/octo/liboping/issues/72
patchfiles-append \
patch-oping.c.diff
}

subport ${name}-devel {
github.setup octo liboping f9115d65b561adeb6d36ded952949f065ad0a572
version 20170914
revision 1
github.setup octo liboping 656ea6996d083090cbbae1581287a3b1a5dcfb56
version 20200601
revision 0
conflicts liboping

checksums rmd160 40dcd0a11db6a9e0c4ec6a97313d2070a7280934 \
sha256 00d017bde998ca5a99a2922cef389510cd0248561662044df1225808e5283a03 \
size 65495
checksums rmd160 e20c99cf49a0ba3ebae43e70ccf96f3c1189c231 \
sha256 fe309c135b719ae5a5f9cfe7133c7ca6f70fd1e5310e73a780a7f53ebfde153a \
size 65534

# https://github.com/octo/liboping/issues/72
patchfiles-append \
devel-patch-oping.c.diff

use_autoreconf yes
}

homepage https://noping.cc

depends_build-append \
port:pkgconfig
path:bin/pkg-config:pkgconfig

depends_lib-append port:ncurses

Expand Down
30 changes: 30 additions & 0 deletions net/liboping/files/devel-patch-oping.c.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- src/oping.c
+++ src/oping.c 2024-12-13 15:38:31.000000000 +0800
@@ -1155,7 +1155,7 @@
wattron (ctx->window, COLOR_PAIR(color));

if (has_utf8())
- mvwprintw (ctx->window, /* y = */ y_max, /* x = */ x + 2, symbol);
+ mvwprintw (ctx->window, /* y = */ y_max, /* x = */ x + 2, "%s", symbol);
else
mvwaddch (ctx->window, /* y = */ y_max, /* x = */ x + 2, symbolc);

@@ -1261,7 +1261,7 @@
mvwaddch (ctx->window, /* y = */ y_max, /* x = */ x + 2, ' ');
else if (has_utf8 ())
mvwprintw (ctx->window, /* y = */ y_max, /* x = */ x + 2,
- hist_symbols_utf8[index]);
+ "%s", hist_symbols_utf8[index]);
else
mvwaddch (ctx->window, /* y = */ y_max, /* x = */ x + 2,
hist_symbols_acs[index] | A_ALTCHARSET);
@@ -1638,8 +1638,7 @@

HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
data_len, context->host, context->addr,
- sequence, recv_ttl,
- format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
+ sequence, recv_ttl);
if ((recv_qos != 0) || (opt_send_qos != 0))
{
HOST_PRINTF ("qos=%s ",
30 changes: 30 additions & 0 deletions net/liboping/files/patch-oping.c.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- src/oping.c
+++ src/oping.c 2024-12-04 10:11:24.000000000 +0800
@@ -1125,7 +1125,7 @@
wattron (ctx->window, COLOR_PAIR(color));

if (has_utf8())
- mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol);
+ mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, "%s", symbol);
else
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, symbolc);

@@ -1223,7 +1223,7 @@
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, ' ');
else if (has_utf8 ())
mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2,
- hist_symbols_utf8[index]);
+ "%s", hist_symbols_utf8[index]);
else
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2,
hist_symbols_acs[index] | A_ALTCHARSET);
@@ -1600,8 +1600,7 @@

HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
data_len, context->host, context->addr,
- sequence, recv_ttl,
- format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
+ sequence, recv_ttl);
if ((recv_qos != 0) || (opt_send_qos != 0))
{
HOST_PRINTF ("qos=%s ",

0 comments on commit 9c50ce2

Please sign in to comment.