Hi,

I've spotted this while lurking the sparc64 bulk, netcdf fails to build:

> libdispatch/dfilter.c:681:1: error: static declaration of 'byteswap8'
> follows non-static declaration
(and more)

A pull request has already been made to the upstream GitHub repo [0],
this fixes the build on macppc [1], and amd64 is still fine.

Some patches got regenerated as well :)

Test returns 1 failure on macppc in tst_netcdf4.sh, but this seems
harmless, from the log:

> *** Testing '-s' option for special attributes.
> *** creating special attributes test file tst_special_atts.nc...ok.
> *** Tests successful!
> *** comparing tst_special_atts.cdl with ref_tst_special_atts.cdl...
> 48c48
> <               var6:_Endianness = "big" ;
> ---
> >               var6:_Endianness = "little" ;
> 51c51
> <               var7:_Endianness = "big" ;
> ---
> >               var7:_Endianness = "little" ;
> FAIL tst_netcdf4.sh (exit status: 1)

Comments/feedback are welcome,

Charlène.


[0] https://github.com/Unidata/netcdf-c/pull/1688
[1] https://bin.charlenew.xyz/netcdf.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/math/netcdf/Makefile,v
retrieving revision 1.41
diff -u -p -u -p -r1.41 Makefile
--- Makefile    31 Mar 2020 11:57:58 -0000      1.41
+++ Makefile    4 Apr 2020 15:51:38 -0000
@@ -6,7 +6,7 @@ V=              4.7.4
 NAME=          netcdf
 DISTNAME=      ${NAME}-c-${V}
 PKGNAME=       ${NAME}-${V}
-REVISION=      0
+REVISION=      1
 
 CATEGORIES=    math
 
Index: patches/patch-libdispatch_dfilter_c
===================================================================
RCS file: patches/patch-libdispatch_dfilter_c
diff -N patches/patch-libdispatch_dfilter_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-libdispatch_dfilter_c 4 Apr 2020 15:51:38 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+Fix build on BE_ARCHS, see:
+https://github.com/Unidata/netcdf-c/pull/1688
+
+Index: libdispatch/dfilter.c
+--- libdispatch/dfilter.c.orig
++++ libdispatch/dfilter.c
+@@ -40,6 +40,10 @@ Unified filter related code
+ 
+ /* Forward */
+ static int gettype(const int q0, const int q1, int* unsignedp);
++#ifdef WORDS_BIGENDIAN
++static void byteswap8(unsigned char* mem);
++static void byteswap4(unsigned char* mem);
++#endif
+ 
+ const struct LegalFormat {
+     const char* tag;
Index: patches/patch-nc_test4_tst_filterparser_c
===================================================================
RCS file: patches/patch-nc_test4_tst_filterparser_c
diff -N patches/patch-nc_test4_tst_filterparser_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-nc_test4_tst_filterparser_c   4 Apr 2020 15:51:38 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+Fix build on BE_ARCHS, see:
+https://github.com/Unidata/netcdf-c/pull/1688
+
+Index: nc_test4/tst_filterparser.c
+--- nc_test4/tst_filterparser.c.orig
++++ nc_test4/tst_filterparser.c
+@@ -122,6 +122,11 @@ static const char* spectype[] = {"i", "b", "ub", "s", 
+ 
+ static int nerrs = 0;
+ 
++#ifdef WORDS_BIGENDIAN
++static void byteswap8(unsigned char* mem);
++static void byteswap4(unsigned char* mem);
++#endif
++
+ static void
+ mismatch(size_t i, unsigned int *params, const char* tag)
+ {
Index: patches/patch-ncdap_test_tst_urls_sh
===================================================================
RCS file: /cvs/ports/math/netcdf/patches/patch-ncdap_test_tst_urls_sh,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-ncdap_test_tst_urls_sh
--- patches/patch-ncdap_test_tst_urls_sh        13 Mar 2019 20:27:40 -0000      
1.1
+++ patches/patch-ncdap_test_tst_urls_sh        4 Apr 2020 15:51:38 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-ncdap_test_tst_urls_sh,v
 Index: ncdap_test/tst_urls.sh
 --- ncdap_test/tst_urls.sh.orig
 +++ ncdap_test/tst_urls.sh
-@@ -8,7 +8,7 @@
+@@ -9,7 +9,7 @@
  # Define various sets of test targets
  
  # Figure our dst server; if none, then just stop
@@ -11,4 +11,4 @@ Index: ncdap_test/tst_urls.sh
 +DTS=`./findtestserver dap2 dts`
  if test "x$DTS" = "x" ; then
  echo "WARNING: Cannot locate test server for dts"
- exit 1
+ exit 0
Index: patches/patch-ncgen3_ncgenyy_c
===================================================================
RCS file: /cvs/ports/math/netcdf/patches/patch-ncgen3_ncgenyy_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-ncgen3_ncgenyy_c
--- patches/patch-ncgen3_ncgenyy_c      13 Mar 2019 20:27:40 -0000      1.1
+++ patches/patch-ncgen3_ncgenyy_c      4 Apr 2020 15:51:38 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-ncgen3_ncgenyy_c,v 1.1 2
 Index: ncgen3/ncgenyy.c
 --- ncgen3/ncgenyy.c.orig
 +++ ncgen3/ncgenyy.c
-@@ -865,8 +865,6 @@ char *ncgtext;
+@@ -1081,8 +1081,6 @@ char *yytext;
     We include lexical definitions for all three, but use the second version.
  */
  
Index: patches/patch-ncgen_ncgenl_c
===================================================================
RCS file: /cvs/ports/math/netcdf/patches/patch-ncgen_ncgenl_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-ncgen_ncgenl_c
--- patches/patch-ncgen_ncgenl_c        13 Mar 2019 20:27:40 -0000      1.1
+++ patches/patch-ncgen_ncgenl_c        4 Apr 2020 15:51:38 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-ncgen_ncgenl_c,v 1.1 201
 Index: ncgen/ncgenl.c
 --- ncgen/ncgenl.c.orig
 +++ ncgen/ncgenl.c
-@@ -1420,8 +1420,6 @@ char *yytext;
+@@ -1204,8 +1204,6 @@ char *ncgtext;
  #include "ncgen.h"
  #include "ncgeny.h"
  
Index: patches/patch-plugins_H5Zutil_c
===================================================================
RCS file: patches/patch-plugins_H5Zutil_c
diff -N patches/patch-plugins_H5Zutil_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-plugins_H5Zutil_c     4 Apr 2020 15:51:38 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+
+Fix build on BE_ARCHS, see:
+https://github.com/Unidata/netcdf-c/pull/1688
+
+Index: plugins/H5Zutil.c
+--- plugins/H5Zutil.c.orig
++++ plugins/H5Zutil.c
+@@ -4,6 +4,7 @@
+  */
+ 
+ 
++#include "config.h"
+ #include <hdf5.h>
+ 
+ /*

Reply via email to