summaryrefslogtreecommitdiff
blob: 428737d15aaaabcb48cb113c40ddcfd5d926caa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=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"
KEYWORDS="amd64 ~arm ~arm64 ~ia64 ppc ppc64 x86 ~amd64-linux ~x86-linux"
IUSE="+dap doc examples hdf +hdf5 mpi szip test tools"
RESTRICT="!test? ( test )"

RDEPEND="
	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="
	doc? ( app-doc/doxygen[dot] )
	virtual/pkgconfig"

REQUIRED_USE="
	test? ( tools )
	szip? ( hdf5 )
	mpi? ( hdf5 )"

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
	sed -i -e '/run_get_hdf4_files/d' hdf4_test/CMakeLists.txt || die

	cmake_src_prepare
}

src_configure() {
	use mpi && export CC=mpicc

	local mycmakeargs=(
		-DENABLE_DAP_REMOTE_TESTS=OFF
		-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
}