diff options
author | Sam James <sam@gentoo.org> | 2021-02-25 08:55:47 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-02-25 08:55:47 +0000 |
commit | 9cc8bb601465002ad5fb20b232faeee75f440b94 (patch) | |
tree | acd70322621b3a63aac613eb232db530ff99cf64 /sci-libs/netcdf | |
parent | sci-libs/netcdf: Stabilize 4.7.4 amd64, #770649 (diff) | |
download | gentoo-9cc8bb601465002ad5fb20b232faeee75f440b94.tar.gz gentoo-9cc8bb601465002ad5fb20b232faeee75f440b94.tar.bz2 gentoo-9cc8bb601465002ad5fb20b232faeee75f440b94.zip |
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@gentoo.org>
Diffstat (limited to 'sci-libs/netcdf')
-rw-r--r-- | sci-libs/netcdf/files/netcdf-4.7.4-big-endian-build.patch | 63 | ||||
-rw-r--r-- | sci-libs/netcdf/files/netcdf-4.7.4-big-endian-test.patch | 16 | ||||
-rw-r--r-- | sci-libs/netcdf/netcdf-4.7.4.ebuild | 6 |
3 files changed, 84 insertions, 1 deletions
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 000000000000..edad05a21e64 --- /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 000000000000..cdc39a6a7729 --- /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 0e3c2b88868a..c45ee223982e 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 |