Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/netcdf/
Date: Wed, 08 Jun 2022 05:25:28
Message-Id: 1654665578.d80313248373f4ba7b2ff7ddb940cac16476129e.sam@gentoo
1 commit: d80313248373f4ba7b2ff7ddb940cac16476129e
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 8 05:18:39 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 8 05:19:38 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8031324
7
8 sci-libs/netcdf: avoid broken libdl hardcoding
9
10 Closes: https://bugs.gentoo.org/827188
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 sci-libs/netcdf/netcdf-4.8.1-r2.ebuild | 83 ++++++++++++++++++++++++++++++++++
14 1 file changed, 83 insertions(+)
15
16 diff --git a/sci-libs/netcdf/netcdf-4.8.1-r2.ebuild b/sci-libs/netcdf/netcdf-4.8.1-r2.ebuild
17 new file mode 100644
18 index 000000000000..02d4832a3f3b
19 --- /dev/null
20 +++ b/sci-libs/netcdf/netcdf-4.8.1-r2.ebuild
21 @@ -0,0 +1,83 @@
22 +# Copyright 1999-2022 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +inherit cmake flag-o-matic
28 +
29 +DESCRIPTION="Scientific library and interface for array oriented data access"
30 +HOMEPAGE="https://www.unidata.ucar.edu/software/netcdf/"
31 +SRC_URI="https://github.com/Unidata/netcdf-c/archive/v${PV}.tar.gz -> ${P}.tar.gz"
32 +S="${WORKDIR}/${PN}-c-${PV}"
33 +
34 +LICENSE="UCAR-Unidata"
35 +# SONAME of libnetcdf.so
36 +SLOT="0/19"
37 +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 -riscv ~x86 ~amd64-linux ~x86-linux"
38 +IUSE="+dap doc examples hdf +hdf5 mpi szip test tools"
39 +RESTRICT="!test? ( test )"
40 +
41 +RDEPEND="dev-libs/libxml2
42 + dap? ( net-misc/curl:0= )
43 + hdf? (
44 + media-libs/libjpeg-turbo:=
45 + sci-libs/hdf:0=
46 + sci-libs/hdf5:0=
47 + )
48 + hdf5? ( sci-libs/hdf5:0=[hl(+),mpi=,szip=,zlib] )"
49 +DEPEND="${RDEPEND}"
50 +BDEPEND="virtual/pkgconfig
51 + doc? ( app-doc/doxygen[dot] )"
52 +
53 +REQUIRED_USE="
54 + test? ( tools )
55 + szip? ( hdf5 )
56 + mpi? ( hdf5 )"
57 +
58 +PATCHES=(
59 + "${FILESDIR}/${PN}-4.8.1-big-endian-build.patch"
60 + "${FILESDIR}/${PN}-4.7.4-big-endian-test.patch"
61 +)
62 +
63 +src_prepare() {
64 + # skip test that requires network
65 + sed -i -e '/run_get_hdf4_files/d' hdf4_test/CMakeLists.txt || die
66 +
67 + cmake_src_prepare
68 +}
69 +
70 +src_configure() {
71 + use mpi && export CC=mpicc
72 +
73 + # Temporary workaround for test breakage
74 + # https://github.com/Unidata/netcdf-c/issues/1983
75 + # bug #827042
76 + append-flags -fno-strict-aliasing
77 +
78 + local mycmakeargs=(
79 + -DENABLE_DAP_REMOTE_TESTS=OFF
80 + # Enable for >4.8.1 (not yet in a release)
81 + #-DENABLE_LIBXML2=ON
82 + -DBUILD_UTILITIES=$(usex tools)
83 + -DENABLE_DAP=$(usex dap)
84 + -DENABLE_DOXYGEN=$(usex doc)
85 + -DENABLE_EXAMPLES=$(usex examples)
86 + -DENABLE_HDF4=$(usex hdf)
87 + -DENABLE_NETCDF_4=$(usex hdf5)
88 + -DENABLE_TESTS=$(usex test)
89 + )
90 +
91 + cmake_src_configure
92 +}
93 +
94 +src_test() {
95 + # fails parallel tests: bug #621486
96 + cmake_src_test -j1
97 +}
98 +
99 +src_install() {
100 + cmake_src_install
101 +
102 + # bug #827188
103 + sed -i -e "s:${EPREFIX}/usr/$(get_libdir)/libdl.so;:dl;:" "${ED}/usr/$(get_libdir)/cmake/netCDF/netCDFTargets.cmake" || die
104 +}