public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/netcdf/, sci-libs/netcdf/files/
@ 2021-02-25  8:56 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2021-02-25  8:56 UTC (permalink / raw
  To: gentoo-commits

commit:     9cc8bb601465002ad5fb20b232faeee75f440b94
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 25 08:55:47 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Feb 25 08:55:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cc8bb60

sci-libs/netcdf: fix big endian build/tests

Closes: https://bugs.gentoo.org/772863
Package-Manager: Portage-3.0.15, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/netcdf-4.7.4-big-endian-build.patch      | 63 ++++++++++++++++++++++
 .../files/netcdf-4.7.4-big-endian-test.patch       | 16 ++++++
 sci-libs/netcdf/netcdf-4.7.4.ebuild                |  6 ++-
 3 files changed, 84 insertions(+), 1 deletion(-)

diff --git a/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-build.patch b/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-build.patch
new file mode 100644
index 00000000000..edad05a21e6
--- /dev/null
+++ b/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-build.patch
@@ -0,0 +1,63 @@
+https://github.com/DennisHeimbigner/netcdf-c/commit/6f86660da86f279cad1f2804cf3242767de27630.patch
+https://github.com/Unidata/netcdf-c/issues/1687
+https://bugs.gentoo.org/772863
+
+From 6f86660da86f279cad1f2804cf3242767de27630 Mon Sep 17 00:00:00 2001
+From: Dennis Heimbigner <dmh@ucar.edu>
+Date: Fri, 3 Apr 2020 20:15:34 -0600
+Subject: [PATCH] Fix missing forward declarations
+
+re: issue https://github.com/Unidata/netcdf-c/issues/1687
+
+static functions are being used before decl and it causes
+errors. Only occurs when BIG_ENDIAN is defined.
+Solution is to add the forward declarations.
+---
+ libdispatch/dfilter.c       | 4 ++++
+ nc_test4/tst_filterparser.c | 5 +++++
+ plugins/H5Zutil.c           | 1 +
+ 3 files changed, 10 insertions(+)
+
+diff --git a/libdispatch/dfilter.c b/libdispatch/dfilter.c
+index 893846457..0e490a3d6 100644
+--- a/libdispatch/dfilter.c
++++ b/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;
+diff --git a/nc_test4/tst_filterparser.c b/nc_test4/tst_filterparser.c
+index 7d02f2bc7..b32094a25 100644
+--- a/nc_test4/tst_filterparser.c
++++ b/nc_test4/tst_filterparser.c
+@@ -122,6 +122,11 @@ static const char* spectype[] = {"i", "b", "ub", "s", "us", "i", "ui", "i", "i",
+ 
+ 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)
+ {
+diff --git a/plugins/H5Zutil.c b/plugins/H5Zutil.c
+index cb36dc96c..86dfb0cfa 100644
+--- a/plugins/H5Zutil.c
++++ b/plugins/H5Zutil.c
+@@ -4,6 +4,7 @@
+  */
+ 
+ 
++#include "config.h"
+ #include <hdf5.h>
+ 
+ /*

diff --git a/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-test.patch b/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-test.patch
new file mode 100644
index 00000000000..cdc39a6a772
--- /dev/null
+++ b/sci-libs/netcdf/files/netcdf-4.7.4-big-endian-test.patch
@@ -0,0 +1,16 @@
+Fixes ncdump_tst_netcdf4 test failure on big endian.
+https://github.com/Unidata/netcdf-c/issues/1896
+diff --git a/ncdump/tst_special_atts.c b/ncdump/tst_special_atts.c
+index 9655b86..e71cb7e 100644
+--- a/ncdump/tst_special_atts.c
++++ b/ncdump/tst_special_atts.c
+@@ -145,6 +145,10 @@ main(int argc, char **argv)
+    /* Set _Storage as compact */
+    if (nc_def_var_chunking(ncid, var6id, NC_COMPACT, NULL)) ERR;
+    if (nc_def_var_chunking(ncid, var7id, NC_COMPACT, NULL)) ERR;
++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++   if (nc_def_var_endian(ncid, var6id, NC_ENDIAN_LITTLE)) ERR;
++   if (nc_def_var_endian(ncid, var7id, NC_ENDIAN_LITTLE)) ERR;
++#endif
+ 
+    if (nc_enddef(ncid)) ERR;

diff --git a/sci-libs/netcdf/netcdf-4.7.4.ebuild b/sci-libs/netcdf/netcdf-4.7.4.ebuild
index 0e3c2b88868..c45ee223982 100644
--- a/sci-libs/netcdf/netcdf-4.7.4.ebuild
+++ b/sci-libs/netcdf/netcdf-4.7.4.ebuild
@@ -8,6 +8,7 @@ inherit cmake
 DESCRIPTION="Scientific library and interface for array oriented data access"
 HOMEPAGE="https://www.unidata.ucar.edu/software/netcdf/"
 SRC_URI="https://github.com/Unidata/netcdf-c/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-c-${PV}"
 
 LICENSE="UCAR-Unidata"
 SLOT="0/18"
@@ -33,7 +34,10 @@ REQUIRED_USE="
 	szip? ( hdf5 )
 	mpi? ( hdf5 )"
 
-S="${WORKDIR}/${PN}-c-${PV}"
+PATCHES=(
+	"${FILESDIR}/${PN}-4.7.4-big-endian-build.patch"
+	"${FILESDIR}/${PN}-4.7.4-big-endian-test.patch"
+)
 
 src_prepare() {
 	# skip test that requires network


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sci-libs/netcdf/, sci-libs/netcdf/files/
@ 2021-11-25  1:45 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2021-11-25  1:45 UTC (permalink / raw
  To: gentoo-commits

commit:     03e409f30d966755e399c476cc7bf2f508cafae4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 25 01:44:46 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 25 01:45:05 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03e409f3

sci-libs/netcdf: add 4.8.1

Doesn't seem to hardcode libdl path anymore which avoids glibc-2.34 issues.

Closes: https://bugs.gentoo.org/827188
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/netcdf/Manifest                           |  1 +
 .../files/netcdf-4.8.1-big-endian-build.patch      | 24 +++++++
 sci-libs/netcdf/netcdf-4.8.1.ebuild                | 74 ++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/sci-libs/netcdf/Manifest b/sci-libs/netcdf/Manifest
index d286a0bb2449..8232d5518f32 100644
--- a/sci-libs/netcdf/Manifest
+++ b/sci-libs/netcdf/Manifest
@@ -1 +1,2 @@
 DIST netcdf-4.7.4.tar.gz 19711158 BLAKE2B b49532e6f87b458e7f5654f70ec932d6c8c81272c97ce44df3d27bb61b01d3e005f918b959ce12e42e26f7c12309ab72eeb57a35216d20ab5761837db65741a4 SHA512 15922818fdd71be285eb7dd2fc9be2594fe9af979de3ed316465636c7bbdaec65eb151ca57ef8b703e6a360cdba036b8f9bc193ddff01ff7ce4214c0a66efa79
+DIST netcdf-4.8.1.tar.gz 18957280 BLAKE2B 05fc6cd10cb5cbb11dc077b9a884fbc63c4cb840b241e782702da58ad9831fba065a6f1e97c2be092437735d39658482285850a00618d0582d6e4728d64c4402 SHA512 c97207867abf10d414abf34624268710f5b812c26c38f97e73afe00558b3f07917331fbc7fdb9e70b09813acf15a9a09bae2c432a3266ce10a791b9472f87a42

diff --git a/sci-libs/netcdf/files/netcdf-4.8.1-big-endian-build.patch b/sci-libs/netcdf/files/netcdf-4.8.1-big-endian-build.patch
new file mode 100644
index 000000000000..afeff7e3fbd0
--- /dev/null
+++ b/sci-libs/netcdf/files/netcdf-4.8.1-big-endian-build.patch
@@ -0,0 +1,24 @@
+Later version for 4.8.1 grabbed from Debian:
+https://sources.debian.org/patches/netcdf/1:4.8.1-1/byteswap.patch/
+
+Earlier version used:
+https://github.com/DennisHeimbigner/netcdf-c/commit/6f86660da86f279cad1f2804cf3242767de27630.patch
+https://github.com/Unidata/netcdf-c/issues/1687
+https://bugs.gentoo.org/772863
+
+Description: Add forward declarations for byteswap8 & byteswap4.
+Author: Dennis Heimbigner
+Bug: https://github.com/Unidata/netcdf-c/issues/1687
+
+--- a/libdispatch/dfilter.c
++++ b/libdispatch/dfilter.c
+@@ -20,6 +20,9 @@
+ #include "hdf5internal.h"
+ #endif
+ 
++static void byteswap8(unsigned char*);
++static void byteswap4(unsigned char*);
++
+ /*
+ Unified filter related code
+ */

diff --git a/sci-libs/netcdf/netcdf-4.8.1.ebuild b/sci-libs/netcdf/netcdf-4.8.1.ebuild
new file mode 100644
index 000000000000..9d62cbfcef3d
--- /dev/null
+++ b/sci-libs/netcdf/netcdf-4.8.1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake flag-o-matic
+
+DESCRIPTION="Scientific library and interface for array oriented data access"
+HOMEPAGE="https://www.unidata.ucar.edu/software/netcdf/"
+SRC_URI="https://github.com/Unidata/netcdf-c/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-c-${PV}"
+
+LICENSE="UCAR-Unidata"
+SLOT="0/18"
+KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 -riscv ~x86 ~amd64-linux ~x86-linux"
+IUSE="+dap doc examples hdf +hdf5 mpi szip test tools"
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-libs/libxml2
+	dap? ( net-misc/curl:0= )
+	hdf? (
+		sci-libs/hdf:0=
+		sci-libs/hdf5:0=
+		virtual/jpeg
+	)
+	hdf5? ( sci-libs/hdf5:0=[hl(+),mpi=,szip=,zlib] )"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig
+	doc? ( app-doc/doxygen[dot] )"
+
+REQUIRED_USE="
+	test? ( tools )
+	szip? ( hdf5 )
+	mpi? ( hdf5 )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-4.8.1-big-endian-build.patch"
+	"${FILESDIR}/${PN}-4.7.4-big-endian-test.patch"
+)
+
+src_prepare() {
+	# skip test that requires network
+	sed -i -e '/run_get_hdf4_files/d' hdf4_test/CMakeLists.txt || die
+
+	cmake_src_prepare
+}
+
+src_configure() {
+	use mpi && export CC=mpicc
+
+	# Temporary workaround for test breakage
+	# https://github.com/Unidata/netcdf-c/issues/1983
+	# bug #827042
+	append-flags -fno-strict-aliasing
+
+	local mycmakeargs=(
+		-DENABLE_DAP_REMOTE_TESTS=OFF
+		-DENABLE_LIBXML2=ON
+		-DBUILD_UTILITIES=$(usex tools)
+		-DENABLE_DAP=$(usex dap)
+		-DENABLE_DOXYGEN=$(usex doc)
+		-DENABLE_EXAMPLES=$(usex examples)
+		-DENABLE_HDF4=$(usex hdf)
+		-DENABLE_NETCDF_4=$(usex hdf5)
+		-DENABLE_TESTS=$(usex test)
+	)
+
+	cmake_src_configure
+}
+
+src_test() {
+	# fails parallel tests: bug #621486
+	cmake_src_test -j1
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-25  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-25  8:56 [gentoo-commits] repo/gentoo:master commit in: sci-libs/netcdf/, sci-libs/netcdf/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2021-11-25  1:45 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox