math/mcl: avoid printf %n, switch HOMEPAGE and MASTER_SITES to https
and add a proper fix for -fno-common: all common variables come from iface.[ch], so we can simply extern them in the header. ok naddy
This commit is contained in:
parent
2433f9818f
commit
a93e19479a
@ -1,18 +1,20 @@
|
||||
# $OpenBSD: Makefile,v 1.14 2021/02/14 03:19:26 daniel Exp $
|
||||
# $OpenBSD: Makefile,v 1.15 2021/09/15 21:55:07 tb Exp $
|
||||
|
||||
COMMENT= clustering algorithm for graphs
|
||||
|
||||
V= 14-137
|
||||
DISTNAME= mcl-${V}
|
||||
PKGNAME= mcl-${V:S,-,_,}
|
||||
REVISION= 0
|
||||
|
||||
CATEGORIES= math
|
||||
|
||||
HOMEPAGE= http://micans.org/mcl/
|
||||
HOMEPAGE= https://micans.org/mcl/
|
||||
|
||||
# GPLv2
|
||||
PERMIT_PACKAGE= Yes
|
||||
|
||||
MASTER_SITES= http://micans.org/mcl/src/
|
||||
MASTER_SITES= https://micans.org/mcl/src/
|
||||
|
||||
WANTLIB= c m pthread
|
||||
|
||||
@ -21,7 +23,4 @@ USE_GROFF = Yes
|
||||
|
||||
FAKE_FLAGS= exampledir=${PREFIX}/share/examples/mcl/
|
||||
|
||||
# 20+ duplicate symbols
|
||||
CFLAGS+= -fcommon
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
31
math/mcl/patches/patch-src_impala_iface_h
Normal file
31
math/mcl/patches/patch-src_impala_iface_h
Normal file
@ -0,0 +1,31 @@
|
||||
$OpenBSD: patch-src_impala_iface_h,v 1.1 2021/09/15 21:55:07 tb Exp $
|
||||
|
||||
Fix for -fno-common
|
||||
|
||||
Index: src/impala/iface.h
|
||||
--- src/impala/iface.h.orig
|
||||
+++ src/impala/iface.h
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
/* This file currently provides nothing */
|
||||
|
||||
-dim nu_meet_can ;
|
||||
-dim nu_meet_sl ;
|
||||
-dim nu_meet_zip ;
|
||||
-dim nu_diff_can ;
|
||||
-dim nu_diff_sl ;
|
||||
-dim nu_diff_zip ;
|
||||
-double nu_magic ;
|
||||
+extern dim nu_meet_can ;
|
||||
+extern dim nu_meet_sl ;
|
||||
+extern dim nu_meet_zip ;
|
||||
+extern dim nu_diff_can ;
|
||||
+extern dim nu_diff_sl ;
|
||||
+extern dim nu_diff_zip ;
|
||||
+extern double nu_magic ;
|
||||
|
||||
-dim mclx_n_thread_g ;
|
||||
+extern dim mclx_n_thread_g ;
|
||||
|
||||
#endif
|
||||
|
42
math/mcl/patches/patch-src_impala_io_c
Normal file
42
math/mcl/patches/patch-src_impala_io_c
Normal file
@ -0,0 +1,42 @@
|
||||
$OpenBSD: patch-src_impala_io_c,v 1.3 2021/09/15 21:55:07 tb Exp $
|
||||
|
||||
Avoid printf %n
|
||||
|
||||
Index: src/impala/io.c
|
||||
--- src/impala/io.c.orig
|
||||
+++ src/impala/io.c
|
||||
@@ -1413,10 +1413,10 @@ static void mclva_dump
|
||||
; }
|
||||
|
||||
if (vid>=0)
|
||||
- { fprintf(fp, "%ld%n", (long) vid, &n_converted)
|
||||
+ { n_converted = fprintf(fp, "%ld", (long) vid)
|
||||
; nr_chars += n_converted
|
||||
; if (vec->val != 0.0)
|
||||
- fprintf(fp, ":%.*g%n", valdigits, (double) vec->val, &n_converted)
|
||||
+ n_converted = fprintf(fp, ":%.*g", valdigits, (double) vec->val)
|
||||
, nr_chars += n_converted
|
||||
; while (nr_chars+1 < leadwidth) /* we get one below */
|
||||
{ fputs(" ", fp)
|
||||
@@ -1426,18 +1426,17 @@ static void mclva_dump
|
||||
|
||||
for (d=0; d<vec->n_ivps;d++)
|
||||
{ if (valdigits > -1)
|
||||
- { fprintf
|
||||
+ { n_converted = fprintf
|
||||
( fp
|
||||
- , " %ld:%.*g%n"
|
||||
+ , " %ld:%.*g"
|
||||
, (long) (vec->ivps+d)->idx
|
||||
, (int) valdigits
|
||||
, (double) (vec->ivps+d)->val
|
||||
- , &n_converted
|
||||
)
|
||||
; nr_chars += n_converted
|
||||
; }
|
||||
else if (valdigits == MCLXIO_VALUE_NONE)
|
||||
- { fprintf(fp, " %ld%n", (long) (vec->ivps+d)->idx, &n_converted)
|
||||
+ { n_converted = fprintf(fp, " %ld", (long) (vec->ivps+d)->idx)
|
||||
; nr_chars += n_converted
|
||||
; }
|
||||
|
Loading…
Reference in New Issue
Block a user