Hello ports, Here is an update for math/netcdf, laying the groundwork for py-netcdf and python-pvlib, two ports I need for my projects.
Things to consider: - it's been decades since I worked in ports - netcdf is now split into C, C++ and Fortran parts, this update only preserves the C functionality - C++ and Fortran are available with different version numbers so they should probably go in their own packages which could follow at a later point - passes make test, needs gdiff and bash as TEST_DEPENDS, remote tests are disabled due to sporadic problems with the test server - docs are also gone, therefore the two patches from 3.6.2 can go away - the only dependency in-tree right now seems to be graphichs/gmt, checked it still builds OK - update probably needs some tuning (see #1) -m Index: Makefile =================================================================== RCS file: /cvs/ports/math/netcdf/Makefile,v retrieving revision 1.33 diff -u -p -u -p -r1.33 Makefile --- Makefile 28 Oct 2018 07:31:29 -0000 1.33 +++ Makefile 5 Mar 2019 09:29:41 -0000 @@ -1,45 +1,54 @@ -# $OpenBSD: Makefile,v 1.33 2018/10/28 07:31:29 bentley Exp $ +# $OpenBSD: Makefile,v 1.33 2018/10/28 07:31:29 bentley Exp $ -BROKEN-powerpc= fails to build -BROKEN-hppa = fails to configure +# let's give it a chance? +#BROKEN-powerpc= fails to build +#BROKEN-hppa = fails to configure COMMENT= library for machine-independent, array-oriented data access -DISTNAME= netcdf-3.6.2 -REVISION = 7 +V= 4.6.3 +NAME= netcdf +DISTNAME= ${NAME}-${V} +DISTFILES= ${NAME}-c-${V}${EXTRACT_SUFX} + CATEGORIES= math -SHARED_LIBS= netcdf 4.0 \ - netcdff 4.0 \ - netcdf_c++ 4.0 +SHARED_LIBS= netcdf 4.0 HOMEPAGE= http://www.unidata.ucar.edu/software/netcdf/ MAINTAINER= Tom Knienieder <t...@knienieder.com> -MODULES = fortran -MODFORTRAN_COMPILER = g77 -BUILD_DEPENDS = ${MODFORTRAN_BUILD_DEPENDS} + +DIST_SUBDIR= ${DISTNAME} +WRKDIST= ${WRKDIR}/${NAME}-c-${V} # BSD-like PERMIT_PACKAGE_CDROM= Yes -WANTLIB= c m ${COMPILER_LIBCXX} +WANTLIB= c m z pthread +WANTLIB+= curl crypto nghttp2 ssl +WANTLIB+= hdf5 hdf5_hl + +LIB_DEPENDS = net/curl \ + math/hdf5 + +TEST_DEPENDS= shells/bash \ + textproc/gdiff COMPILER = base-clang ports-gcc base-gcc MASTER_SITES= ftp://ftp.unidata.ucar.edu/pub/netcdf/ CONFIGURE_STYLE= gnu -CONFIGURE_ENV= CPPFLAGS="-Df2cFortran" +CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib" \ + CPPFLAGS="-I${LOCALBASE}/include" + CONFIGURE_ARGS+= --enable-shared \ - --disable-f90 + --disable-doxygen \ + --with-hdf5=${LOCALBASE} \ + --disable-dap-remote-tests USE_GMAKE= Yes SEPARATE_BUILD= Yes - -post-install: - ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/netcdf - @cd ${WRKSRC}/man && ${INSTALL_DATA} *.txt *.pdf \ - ${PREFIX}/share/doc/netcdf .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/math/netcdf/distinfo,v retrieving revision 1.6 diff -u -p -u -p -r1.6 distinfo --- distinfo 18 Jan 2015 03:14:28 -0000 1.6 +++ distinfo 5 Mar 2019 09:29:41 -0000 @@ -1,2 +1,2 @@ -SHA256 (netcdf-3.6.2.tar.gz) = /qp2c/Np5ftX/MUUJuK+aUIo3cwUH8P9IDmSaftrkxE= -SIZE (netcdf-3.6.2.tar.gz) = 5312882 +SHA256 (netcdf-4.6.3/netcdf-c-4.6.3.tar.gz) = M1/fFtdTH0MK115zLtGpo/yDrT75H7M6cBGaVV3VQVw= +SIZE (netcdf-4.6.3/netcdf-c-4.6.3.tar.gz) = 5961248 Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/math/netcdf/pkg/PLIST,v retrieving revision 1.6 diff -u -p -u -p -r1.6 PLIST --- pkg/PLIST 16 Mar 2015 18:07:50 -0000 1.6 +++ pkg/PLIST 5 Mar 2019 09:29:41 -0000 @@ -1,36 +1,27 @@ -@comment $OpenBSD: PLIST,v 1.6 2015/03/16 18:07:50 naddy Exp $ +@comment $OpenBSD: PLIST,v$ +bin/nc-config +@bin bin/nccopy @bin bin/ncdump @bin bin/ncgen -include/ncvalues.h +@bin bin/ncgen3 include/netcdf.h -include/netcdf.hh -include/netcdf.inc -include/netcdfcpp.h +include/netcdf_aux.h +include/netcdf_filter.h +include/netcdf_mem.h +include/netcdf_meta.h +lib/libbzip2.a +lib/libbzip2.la +lib/libbzip2.so +lib/libmisc.a +lib/libmisc.la +lib/libmisc.so lib/libnetcdf.a lib/libnetcdf.la +lib/libnetcdf.settings @lib lib/libnetcdf.so.${LIBnetcdf_VERSION} -lib/libnetcdf_c++.a -lib/libnetcdf_c++.la -@lib lib/libnetcdf_c++.so.${LIBnetcdf_c++_VERSION} -lib/libnetcdff.a -lib/libnetcdff.la -@lib lib/libnetcdff.so.${LIBnetcdff_VERSION} +lib/pkgconfig/netcdf.pc +@man man/man1/nccopy.1 @man man/man1/ncdump.1 @man man/man1/ncgen.1 +@man man/man1/ncgen3.1 @man man/man3/netcdf.3 -@man man/man3/netcdf_f77.3 -share/doc/netcdf/ -share/doc/netcdf/netcdf-c.pdf -share/doc/netcdf/netcdf-c.txt -share/doc/netcdf/netcdf-cxx.pdf -share/doc/netcdf/netcdf-cxx.txt -share/doc/netcdf/netcdf-f77.pdf -share/doc/netcdf/netcdf-f77.txt -share/doc/netcdf/netcdf-f90.pdf -share/doc/netcdf/netcdf-f90.txt -share/doc/netcdf/netcdf-install.pdf -share/doc/netcdf/netcdf-install.txt -share/doc/netcdf/netcdf-tutorial.pdf -share/doc/netcdf/netcdf-tutorial.txt -share/doc/netcdf/netcdf.pdf -share/doc/netcdf/netcdf.txt --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-dap4_test_test_data_sh Mon Mar 4 19:58:19 2019 @@ -0,0 +1,32 @@ +$OpenBSD$ + +Index: dap4_test/test_data.sh +--- dap4_test/test_data.sh.orig ++++ dap4_test/test_data.sh +@@ -21,8 +21,8 @@ for f in $F ; do + fi + ${NCDUMP} ./results_test_data/${f}.nc > ./results_test_data/${f}.d4d + if test "x${TEST}" = x1 ; then +- if ! diff -wBb ${BASELINE}/${f}.d4d ./results_test_data/${f}.d4d ; then +- failure "diff -wBb ${BASELINE}/${f}.d4d ./results_test_data/${f}.d4d" ++ if ! gdiff -wBb ${BASELINE}/${f}.d4d ./results_test_data/${f}.d4d ; then ++ failure "gdiff -wBb ${BASELINE}/${f}.d4d ./results_test_data/${f}.d4d" + fi + elif test "x${RESET}" = x1 ; then + echo "${f}:" +@@ -77,13 +77,13 @@ if test "x${CDLDIFF}" = x1 ; then + echo "Not found: ${CDLTESTFILES}/${STEM}.cdl" + continue + fi +- echo "diff -wBb ${CDLTESTFILES}/${STEM}.cdl ./results_test_data/${f}.d4d" ++ echo "gdiff -wBb ${CDLTESTFILES}/${STEM}.cdl ./results_test_data/${f}.d4d" + rm -f ./b1 ./b2 ./r1 ./r2 + trim ${CDLTESTFILES}/${STEM}.cdl ./b1 + trim ./results_test_data/${f}.d4d ./r1 + baseclean b1 b2 + resultclean r1 r2 +- if ! diff -wBb ./b2 ./r2 ; then ++ if ! gdiff -wBb ./b2 ./r2 ; then + failure "${f}" + fi + done --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-dap4_test_test_meta_sh Mon Mar 4 19:58:19 2019 @@ -0,0 +1,32 @@ +$OpenBSD$ + +Index: dap4_test/test_meta.sh +--- dap4_test/test_meta.sh.orig ++++ dap4_test/test_meta.sh +@@ -34,8 +34,8 @@ for f in ${F} ; do + fi + ${NCDUMP} ${DUMPFLAGS} -h ./results_test_meta/${f} > ./results_test_meta/${f}.d4m + if test "x${TEST}" = x1 ; then +- if ! diff -wBb ${BASELINE}/${f}.d4m ./results_test_meta/${f}.d4m ; then +- failure "diff -wBb ${BASELINE}/${f}.ncdump ./results_test_meta/${f}.d4m" ++ if ! gdiff -wBb ${BASELINE}/${f}.d4m ./results_test_meta/${f}.d4m ; then ++ failure "gdiff -wBb ${BASELINE}/${f}.ncdump ./results_test_meta/${f}.d4m" + fi + elif test "x${RESET}" = x1 ; then + echo "${f}:" +@@ -45,12 +45,12 @@ done + + if test "x${CDLDIFF}" = x1 ; then + for f in $CDL ; do +- echo "diff -wBb ${CDLTESTFILES}/${f}.cdl ./results_test_meta/${f}.d4m" ++ echo "gdiff -wBb ${CDLTESTFILES}/${f}.cdl ./results_test_meta/${f}.d4m" + rm -f ./tmp + cat ${CDLTESTFILES}/${f}.cdl \ + cat >./tmp +- echo diff -wBbu ./tmp ./results_test_meta/${f}.d4m +- if ! diff -wBbu ./tmp ./results_test_meta/${f}.d4m ; then ++ echo gdiff -wBbu ./tmp ./results_test_meta/${f}.d4m ++ if ! gdiff -wBbu ./tmp ./results_test_meta/${f}.d4m ; then + failure "${f}" + fi + done --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-dap4_test_test_parse_sh Mon Mar 4 19:58:19 2019 @@ -0,0 +1,27 @@ +$OpenBSD$ + +Index: dap4_test/test_parse.sh +--- dap4_test/test_parse.sh.orig ++++ dap4_test/test_parse.sh +@@ -20,18 +20,18 @@ for f in $F ; do + failure "${f}" + fi + if test "x${TEST}" = x1 ; then +- if ! diff -wBb ${BASELINE}/${f}.d4p ./results_test_parse/${f}.d4p ; then ++ if ! gdiff -wBb ${BASELINE}/${f}.d4p ./results_test_parse/${f}.d4p ; then + failure "${f}" + fi + elif test "x${DIFF}" = x1 ; then +- echo "diff -wBb ${DMRTESTFILES}/${f}.dmr ./results_test_parse/${f}.d4p" ++ echo "gdiff -wBb ${DMRTESTFILES}/${f}.dmr ./results_test_parse/${f}.d4p" + rm -f ./tmp + cat ./results_test_parse/${f}.d4p \ + | sed -e '/<Dimensions>/d' -e '/<Types>'/d -e '/<Variables>'/d -e '/<Groups>'/d \ + | sed -e '/<\/Dimensions>/d' -e '/<\/Types>'/d -e '/<\/Variables>'/d -e '/<\/Groups>'/d \ + | sed -e '/_edu.ucar.opaque.size/,+2d' \ + | cat > ./tmp +- if ! diff -wBb ${DMRTESTFILES}/${f}.dmr ./tmp ; then ++ if ! gdiff -wBb ${DMRTESTFILES}/${f}.dmr ./tmp ; then + failure "${f}" + fi + elif test "x${RESET}" = x1 ; then --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-dap4_test_test_raw_sh Mon Mar 4 19:58:19 2019 @@ -0,0 +1,27 @@ +$OpenBSD$ + +Index: dap4_test/test_raw.sh +--- dap4_test/test_raw.sh.orig ++++ dap4_test/test_raw.sh +@@ -51,8 +51,8 @@ for f in $F ; do + failure "${URL}" + fi + if test "x${TEST}" = x1 ; then +- if ! diff -wBb ${BASELINERAW}/${f}.dmp ${builddir}/results_test_raw/${f}.dmp ; then +- failure "diff ${f}.dmp" ++ if ! gdiff -wBb ${BASELINERAW}/${f}.dmp ${builddir}/results_test_raw/${f}.dmp ; then ++ failure "gdiff ${f}.dmp" + fi + elif test "x${RESET}" = x1 ; then + echo "${f}:" +@@ -60,8 +60,8 @@ for f in $F ; do + elif test "x${DIFF}" = x1 ; then + echo "hdrtest: ${f}" + baseclean +- if ! diff -wBb ${BASELINERAW}/${f}.dmp ${BASELINE}/${f}.ncdump ; then +- failure diff -wBb ${BASELINERAW}/${f}.dmp ${BASELINE}/${f}.ncdump ++ if ! gdiff -wBb ${BASELINERAW}/${f}.dmp ${BASELINE}/${f}.ncdump ; then ++ failure gdiff -wBb ${BASELINERAW}/${f}.dmp ${BASELINE}/${f}.ncdump + fi + fi + done --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-libdispatch_dfile_c Tue Mar 5 09:01:04 2019 @@ -0,0 +1,13 @@ +$OpenBSD$ + +Index: libdispatch/dfile.c +--- libdispatch/dfile.c.orig ++++ libdispatch/dfile.c +@@ -32,7 +32,6 @@ + #ifdef HAVE_STDIO_H + #include <stdio.h> + #endif +-extern int fileno(FILE*); + + #include "ncdispatch.h" + #include "netcdf_mem.h" --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-libdispatch_dparallel_c Tue Mar 5 09:00:56 2019 @@ -0,0 +1,13 @@ +$OpenBSD$ + +Index: libdispatch/dparallel.c +--- libdispatch/dparallel.c.orig ++++ libdispatch/dparallel.c +@@ -10,7 +10,6 @@ + #ifdef HAVE_STDIO_H + #include <stdio.h> + #endif +-extern int fileno(FILE*); + + /** + Create a netCDF file for parallel I/O. --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-nc_test4_tst_camrun_c Mon Mar 4 12:09:14 2019 @@ -0,0 +1,17 @@ +$OpenBSD$ + +Index: nc_test4/tst_camrun.c +--- nc_test4/tst_camrun.c.orig ++++ nc_test4/tst_camrun.c +@@ -685,10 +685,10 @@ get_mem_used2(int *mem_used) + fscanf(pf, "%u %u %u %u %u %u", &size, &resident, &share, + &text, &lib, &data); + *mem_used = (data * page_size) / MEGABYTE; ++ fclose(pf); + } + else + *mem_used = -1; +- fclose(pf); + } + + int --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-ncgen3_ncgen_l Tue Mar 5 09:00:56 2019 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: ncgen3/ncgen.l +--- ncgen3/ncgen.l.orig ++++ ncgen3/ncgen.l +@@ -25,8 +25,6 @@ + We include lexical definitions for all three, but use the second version. + */ + +-extern int fileno(FILE*); +- + /* lex specification for tokens for ncgen */ + + /* Fill value used by ncdump from version 2.4 and later. Should match --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-ncgen3_ncgen_y Tue Mar 5 09:00:56 2019 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: ncgen3/ncgen.y +--- ncgen3/ncgen.y.orig ++++ ncgen3/ncgen.y +@@ -19,8 +19,6 @@ static char SccsId[] = "$Id: ncgen.y,v 1.34 2010/03/31 + #include "ncgen.h" + #include "genlib.h" /* for grow_darray() et al */ + +-extern int fileno(FILE*); +- + typedef struct Symbol { /* symbol table entry */ + char *name; + struct Symbol *next; --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-ncgen3_ncgentab_c Tue Mar 5 09:00:56 2019 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: ncgen3/ncgentab.c +--- ncgen3/ncgentab.c.orig ++++ ncgen3/ncgentab.c +@@ -84,8 +84,6 @@ static char SccsId[] = "$Id: ncgen.y,v 1.34 2010/03/31 + #include "ncgen.h" + #include "genlib.h" /* for grow_darray() et al */ + +-extern int fileno(FILE*); +- + typedef struct Symbol { /* symbol table entry */ + char *name; + struct Symbol *next; --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-ncgen3_ncgenyy_c Tue Mar 5 09:00:56 2019 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: ncgen3/ncgenyy.c +--- ncgen3/ncgenyy.c.orig ++++ ncgen3/ncgenyy.c +@@ -865,8 +865,6 @@ char *ncgtext; + We include lexical definitions for all three, but use the second version. + */ + +-extern int fileno(FILE*); +- + /* lex specification for tokens for ncgen */ + + /* Fill value used by ncdump from version 2.4 and later. Should match --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-ncgen_ncgen_l Tue Mar 5 09:34:24 2019 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: ncgen/ncgen.l +--- ncgen/ncgen.l.orig ++++ ncgen/ncgen.l +@@ -38,8 +38,6 @@ + #include "ncgen.h" + #include "ncgeny.h" + +-EXTERNL int fileno(FILE*); +- + #define FILL_STRING "_" + #define XDR_INT32_MIN (-2147483647-1) + #define XDR_INT32_MAX 2147483647 --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-ncgen_ncgenl_c Tue Mar 5 09:34:20 2019 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: ncgen/ncgenl.c +--- ncgen/ncgenl.c.orig ++++ ncgen/ncgenl.c +@@ -1420,8 +1420,6 @@ char *yytext; + #include "ncgen.h" + #include "ncgeny.h" + +-EXTERNL int fileno(FILE*); +- + #define FILL_STRING "_" + #define XDR_INT32_MIN (-2147483647-1) + #define XDR_INT32_MAX 2147483647 --- /dev/null Tue Mar 5 11:15:40 2019 +++ patches/patch-oc2_ocdump_c Tue Mar 5 09:00:56 2019 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: oc2/ocdump.c +--- oc2/ocdump.c.orig ++++ oc2/ocdump.c +@@ -10,8 +10,6 @@ + #include <sys/stat.h> + #endif + +-extern int fileno(FILE*); +- + #include "ocinternal.h" + #include "ocdebug.h" +