Fri Oct 6 13:40:47 2023 UTC ()
netcdf-cxx: fix build, especially on Darwin, by avoiding missing symbols


(adam)
diff -r1.25 -r1.26 pkgsrc/devel/netcdf-cxx/Makefile
diff -r1.22 -r1.23 pkgsrc/devel/netcdf-cxx/buildlink3.mk
diff -r1.5 -r1.6 pkgsrc/devel/netcdf-cxx/distinfo
diff -r0 -r1.1 pkgsrc/devel/netcdf-cxx/patches/patch-Makefile.in
diff -r0 -r1.1 pkgsrc/devel/netcdf-cxx/patches/patch-plugins_H5Zbzip2.c
diff -r0 -r1.1 pkgsrc/devel/netcdf-cxx/patches/patch-plugins_H5Ztemplate.c

cvs diff -r1.25 -r1.26 pkgsrc/devel/netcdf-cxx/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/netcdf-cxx/Makefile 2023/06/03 03:38:52 1.25
+++ pkgsrc/devel/netcdf-cxx/Makefile 2023/10/06 13:40:47 1.26
@@ -1,19 +1,20 @@ @@ -1,19 +1,20 @@
1# $NetBSD: Makefile,v 1.25 2023/06/03 03:38:52 mef Exp $ 1# $NetBSD: Makefile,v 1.26 2023/10/06 13:40:47 adam Exp $
2 2
3DISTNAME= netcdf-cxx4-4.3.1 3DISTNAME= netcdf-cxx4-4.3.1
4PKGNAME= ${DISTNAME:S/cxx4/cxx/} 4PKGNAME= ${DISTNAME:S/cxx4/cxx/}
5CATEGORIES= devel 5CATEGORIES= devel
6MASTER_SITES= https://downloads.unidata.ucar.edu/netcdf-cxx/4.3.1/ 6MASTER_SITES= https://downloads.unidata.ucar.edu/netcdf-cxx/${PKGVERSION_NOREV}/
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://www.unidata.ucar.edu/software/netcdf/index.html 9HOMEPAGE= https://www.unidata.ucar.edu/software/netcdf/index.html
10COMMENT= C++ support for NetCDF 10COMMENT= C++ support for NetCDF
11#LICENSE= NetCDF copyright, See COPYRIGHT file 11#LICENSE= NetCDF copyright, See COPYRIGHT file
12 12
13USE_LANGUAGES= c c++ 13USE_LANGUAGES= c c++
14USE_LIBTOOL= yes 14USE_LIBTOOL= yes
15GNU_CONFIGURE= yes 15GNU_CONFIGURE= yes
16INFO_FILES= yes 16INFO_FILES= yes
 17TEST_TARGET= check
17 18
18.include "../../devel/netcdf/buildlink3.mk" 19.include "../../devel/netcdf/buildlink3.mk"
19.include "../../mk/bsd.pkg.mk" 20.include "../../mk/bsd.pkg.mk"

cvs diff -r1.22 -r1.23 pkgsrc/devel/netcdf-cxx/buildlink3.mk (expand / switch to unified diff)

--- pkgsrc/devel/netcdf-cxx/buildlink3.mk 2023/04/19 08:08:18 1.22
+++ pkgsrc/devel/netcdf-cxx/buildlink3.mk 2023/10/06 13:40:47 1.23
@@ -1,15 +1,15 @@ @@ -1,15 +1,15 @@
1# $NetBSD: buildlink3.mk,v 1.22 2023/04/19 08:08:18 adam Exp $ 1# $NetBSD: buildlink3.mk,v 1.23 2023/10/06 13:40:47 adam Exp $
2 2
3BUILDLINK_TREE+= netcdf-cxx 3BUILDLINK_TREE+= netcdf-cxx
4 4
5.if !defined(NETCDF_CXX_BUILDLINK3_MK) 5.if !defined(NETCDF_CXX_BUILDLINK3_MK)
6NETCDF_CXX_BUILDLINK3_MK:= 6NETCDF_CXX_BUILDLINK3_MK:=
7 7
8BUILDLINK_API_DEPENDS.netcdf-cxx+= netcdf-cxx>=4.2 8BUILDLINK_API_DEPENDS.netcdf-cxx+= netcdf-cxx>=4.2
9BUILDLINK_ABI_DEPENDS.netcdf-cxx?= netcdf-cxx>=4.2nb22 9BUILDLINK_ABI_DEPENDS.netcdf-cxx+= netcdf-cxx>=4.2nb22
10BUILDLINK_PKGSRCDIR.netcdf-cxx?= ../../devel/netcdf-cxx 10BUILDLINK_PKGSRCDIR.netcdf-cxx?= ../../devel/netcdf-cxx
11 11
12.include "../../devel/netcdf/buildlink3.mk" 12.include "../../devel/netcdf/buildlink3.mk"
13.endif # NETCDF_CXX_BUILDLINK3_MK 13.endif # NETCDF_CXX_BUILDLINK3_MK
14 14
15BUILDLINK_TREE+= -netcdf-cxx 15BUILDLINK_TREE+= -netcdf-cxx

cvs diff -r1.5 -r1.6 pkgsrc/devel/netcdf-cxx/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/netcdf-cxx/distinfo 2023/06/03 03:38:52 1.5
+++ pkgsrc/devel/netcdf-cxx/distinfo 2023/10/06 13:40:47 1.6
@@ -1,5 +1,8 @@ @@ -1,5 +1,8 @@
1$NetBSD: distinfo,v 1.5 2023/06/03 03:38:52 mef Exp $ 1$NetBSD: distinfo,v 1.6 2023/10/06 13:40:47 adam Exp $
2 2
3BLAKE2s (netcdf-cxx4-4.3.1.tar.gz) = 4558e0ef38dfe6a4ac399c445e2ede0fcafcded616419dcf8090a524ded89959 3BLAKE2s (netcdf-cxx4-4.3.1.tar.gz) = 4558e0ef38dfe6a4ac399c445e2ede0fcafcded616419dcf8090a524ded89959
4SHA512 (netcdf-cxx4-4.3.1.tar.gz) = f5d9d26fb9f57430d0d681a9c7396bb0f03ed6446ac6fed51058dcc43690c02565da3f729f98b268b0bd923ca8b5b3cfa8340aca6a4f18f512c0c320ea20703f 4SHA512 (netcdf-cxx4-4.3.1.tar.gz) = f5d9d26fb9f57430d0d681a9c7396bb0f03ed6446ac6fed51058dcc43690c02565da3f729f98b268b0bd923ca8b5b3cfa8340aca6a4f18f512c0c320ea20703f
5Size (netcdf-cxx4-4.3.1.tar.gz) = 598335 bytes 5Size (netcdf-cxx4-4.3.1.tar.gz) = 598335 bytes
 6SHA1 (patch-Makefile.in) = 13b4abce5248fbdeb60a50f12ddb7eedab258df3
 7SHA1 (patch-plugins_H5Zbzip2.c) = 053b15728755c107b775d1c49319fac23fe83444
 8SHA1 (patch-plugins_H5Ztemplate.c) = 9b2a3e0e59a77c05836c23b180d3aeedb896ef5e

File Added: pkgsrc/devel/netcdf-cxx/patches/patch-Makefile.in
$NetBSD: patch-Makefile.in,v 1.1 2023/10/06 13:40:47 adam Exp $

Link against libnetcdf.

--- cxx4/Makefile.in.orig	2023-10-06 13:23:06.487803070 +0000
+++ cxx4/Makefile.in
@@ -137,7 +137,7 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libnetcdf_c__4_la_LIBADD =
+libnetcdf_c__4_la_LIBADD = -lnetcdf
 am_libnetcdf_c__4_la_OBJECTS = ncAtt.lo ncCheck.lo ncCompoundType.lo \
 	ncDim.lo ncEnumType.lo ncException.lo ncFile.lo ncGroup.lo \
 	ncGroupAtt.lo ncOpaqueType.lo ncType.lo ncVar.lo ncVarAtt.lo \

File Added: pkgsrc/devel/netcdf-cxx/patches/patch-plugins_H5Zbzip2.c
$NetBSD: patch-plugins_H5Zbzip2.c,v 1.1 2023/10/06 13:40:47 adam Exp $

Avoid missing symbols.

--- plugins/H5Zbzip2.c.orig	2023-10-06 13:31:12.412087559 +0000
+++ plugins/H5Zbzip2.c
@@ -201,7 +201,11 @@ size_t H5Z_filter_bzip2(unsigned int fla
 
   /* Always replace the input buffer with the output buffer. */
 
+#ifdef HAVE_H5FREE_MEMORY
   H5free_memory(*buf);
+#else
+  free(*buf);
+#endif
 
   *buf = outbuf;
   *buf_size = outbuflen;
@@ -209,7 +213,11 @@ size_t H5Z_filter_bzip2(unsigned int fla
 
  cleanupAndFail:
   if (outbuf)
+#ifdef HAVE_H5FREE_MEMORY
     H5free_memory(outbuf);
+#else
+    free(outbuf);
+#endif
 
   return 0;
 }

File Added: pkgsrc/devel/netcdf-cxx/patches/patch-plugins_H5Ztemplate.c
$NetBSD: patch-plugins_H5Ztemplate.c,v 1.1 2023/10/06 13:40:47 adam Exp $

Avoid missing symbols.

--- plugins/H5Ztemplate.c.orig	2023-10-06 13:30:10.395421663 +0000
+++ plugins/H5Ztemplate.c
@@ -92,13 +92,21 @@ size_t H5Z_filter_xxxx(unsigned int flag
   }
 
   /* Always replace the input buffer with the output buffer. */
+#ifdef HAVE_H5FREE_MEMORY
   H5free_memory(*buf);
+#else
+  free(*buf);
+#endif
   *buf = outbuf;
   *buf_size = outbuflen;
   return outdatalen;
 
  cleanupAndFail:
   if (outbuf)
+#ifdef HAVE_H5FREE_MEMORY
     H5free_memory(outbuf);
+#else
+    free(outbud);
+#endif
   return 0;
 }