aboutsummaryrefslogtreecommitdiffstats
path: root/community/netcdf/APKBUILD
blob: 4c7bec947d895dd6f9eeb4ad856b5ecbe97e13de (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
70
71
# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=netcdf
pkgver=4.8.1
pkgrel=2
pkgdesc="Libraries for the Unidata network Common Data Format"
url="https://www.unidata.ucar.edu/software/netcdf/"
# disabled on s390x because of https://github.com/Unidata/netcdf-c/issues/1987
arch="all !s390x"
license="BSD-3-Clause"
options="net"  # tests need network access
makedepends="
	bash
	cmake
	curl-dev
	hdf5-dev
	libexecinfo-dev
	m4
	"
subpackages="
	$pkgname-doc
	$pkgname-dev
	$pkgname-utils:utils
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/Unidata/netcdf-c/archive/v$pkgver.tar.gz
	fix-test-on-big-endian.patch
	manyurls.patch::https://github.com/Unidata/netcdf-c/commit/f235dcfdb23072195b09543e3224d3ef3610fea8.patch
	"
builddir="$srcdir/$pkgname-c-$pkgver"

build() {
	local _enable_cdf5=ON
	case "$CARCH" in
		x86|armhf|armv7) _enable_cdf5=OFF ;;
	esac
	cmake . \
		-DCFLAGS="$CFLAGS" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DENABLE_CDF5=$_enable_cdf5 \
		-DENABLE_DAP_LONG_TESTS=ON \
		-DENABLE_EXAMPLE_TESTS=ON \
		-DENABLE_EXTRA_TESTS=ON \
		-DENABLE_FAILING_TESTS=ON \
		-DENABLE_FILTER_TESTING=ON \
		-DENABLE_LARGE_FILE_TESTS=ON
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

utils() {
	install -d "$subpkgdir/usr/bin"
	mv "$pkgdir/usr/bin" "$subpkgdir/usr/"
}

check() {
	# One test failure in nc_test as reported in https://github.com/Unidata/netcdf-c/issues/808
	# Server test.opendap.org:8080 seems to be down for dap4_test_test_hyrax test
	# Tests have to be executed in the correct order
	ctest -j 1 -E 'nc_test|dap4_test_test_hyrax|ncdump_test_rcmerge'
}

sha512sums="
c97207867abf10d414abf34624268710f5b812c26c38f97e73afe00558b3f07917331fbc7fdb9e70b09813acf15a9a09bae2c432a3266ce10a791b9472f87a42  netcdf-4.8.1.tar.gz
29dda7a0e28333afb91f948c1f5527606634ab8014c6f123e73b092e550d9514c45391f11b33c59cbfbb1fd1ff581848305a47d3768f9b4d1a2be63609009d82  fix-test-on-big-endian.patch
c69e53c16a22c102f45a478091b28309fa584658c5d9a8ca4d8b47c03861caf4311b19b82425935cc3402c3e1c1c91a53ce4b78066faf5405fe744f040629078  manyurls.patch
"