Gentoo Archives: gentoo-commits

From: "Jakov Smolić" <jsmolic@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/hdf5/
Date: Mon, 04 Oct 2021 10:09:45
Message-Id: 1633338861.13a327fb0ab75bc211f39035a1df518800115e99.jsmolic@gentoo
1 commit: 13a327fb0ab75bc211f39035a1df518800115e99
2 Author: Horea Christian <chr <AT> chymera <DOT> eu>
3 AuthorDate: Fri Oct 1 13:56:16 2021 +0000
4 Commit: Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 4 09:14:21 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13a327fb
7
8 sci-libs/hdf5: ROS3 support
9
10 Package-Manager: Portage-3.0.23, Repoman-3.0.3
11 Signed-off-by: Horea Christian <chr <AT> chymera.eu>
12 Closes: https://github.com/gentoo/gentoo/pull/22455
13 Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>
14
15 sci-libs/hdf5/hdf5-1.12.1-r1.ebuild | 123 ++++++++++++++++++++++++++++++++++++
16 sci-libs/hdf5/metadata.xml | 11 ++--
17 2 files changed, 129 insertions(+), 5 deletions(-)
18
19 diff --git a/sci-libs/hdf5/hdf5-1.12.1-r1.ebuild b/sci-libs/hdf5/hdf5-1.12.1-r1.ebuild
20 new file mode 100644
21 index 00000000000..9a0d092cd1f
22 --- /dev/null
23 +++ b/sci-libs/hdf5/hdf5-1.12.1-r1.ebuild
24 @@ -0,0 +1,123 @@
25 +# Copyright 1999-2021 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +FORTRAN_NEEDED="fortran"
31 +
32 +inherit cmake flag-o-matic fortran-2
33 +
34 +MY_P="${PN}-${PV/_p/-patch}"
35 +MAJOR_P="${PN}-$(ver_cut 1-2)"
36 +
37 +DESCRIPTION="General purpose library and file format for storing scientific data"
38 +HOMEPAGE="https://www.hdfgroup.org/HDF5/"
39 +SRC_URI="https://www.hdfgroup.org/ftp/HDF5/releases/${MAJOR_P}/${MY_P}/src/${MY_P}.tar.bz2"
40 +
41 +LICENSE="NCSA-HDF"
42 +SLOT="0/${PV%%_p*}"
43 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
44 +IUSE="cxx debug doc examples fortran +hl mpi ros3 szip test threads unsupported zlib"
45 +
46 +REQUIRED_USE="
47 + !unsupported? (
48 + mpi? ( !cxx !threads )
49 + threads? ( !cxx !fortran !hl )
50 + )"
51 +
52 +RESTRICT="!test? ( test )"
53 +
54 +RDEPEND="
55 + mpi? ( virtual/mpi[romio] )
56 + ros3? (
57 + net-misc/curl
58 + dev-libs/openssl:=
59 + )
60 + szip? ( virtual/szip )
61 + zlib? ( sys-libs/zlib:0= )
62 +"
63 +DEPEND="${RDEPEND}"
64 +BDEPEND="doc? (
65 + app-doc/doxygen
66 + virtual/latex-base
67 +)"
68 +
69 +PATCHES=(
70 + "${FILESDIR}"/${PN}-1.12.1-cmake_installdirs.patch
71 +)
72 +
73 +S="${WORKDIR}/${MY_P}"
74 +
75 +pkg_setup() {
76 + use fortran && fortran-2_pkg_setup
77 +
78 + if use mpi; then
79 + if has_version 'sci-libs/hdf5[-mpi]'; then
80 + ewarn "Installing hdf5 with mpi enabled with a previous hdf5 with mpi disabled may fail."
81 + ewarn "Try to uninstall the current hdf5 prior to enabling mpi support."
82 + fi
83 + export CC="mpicc"
84 + use fortran && export FC="mpif90"
85 + append-libs -lmpi
86 + elif has_version 'sci-libs/hdf5[mpi]'; then
87 + ewarn "Installing hdf5 with mpi disabled while having hdf5 installed with mpi enabled may fail."
88 + ewarn "Try to uninstall the current hdf5 prior to disabling mpi support."
89 + fi
90 +}
91 +
92 +src_configure() {
93 + local mycmakeargs=(
94 + -DBUILD_STATIC_LIBS=OFF
95 + -DFETCHCONTENT_FULLY_DISCONNECTED=ON
96 + -DHDF5_BUILD_EXAMPLES=OFF
97 + -DALLOW_UNSUPPORTED=$(usex unsupported)
98 + -DBUILD_TESTING=$(usex test)
99 + -DHDF5_BUILD_CPP_LIB=$(usex cxx)
100 + -DHDF5_BUILD_DOC=$(usex doc)
101 + -DHDF5_BUILD_FORTRAN=$(usex fortran)
102 + -DHDF5_BUILD_HL_LIB=$(usex hl)
103 + -DHDF5_ENABLE_CODESTACK=$(usex debug)
104 + -DHDF5_ENABLE_PARALLEL=$(usex mpi)
105 + -DHDF5_ENABLE_SZIP_ENCODING=$(usex szip)
106 + -DHDF5_ENABLE_SZIP_SUPPORT=$(usex szip)
107 + -DHDF5_ENABLE_THREADSAFE=$(usex threads)
108 + -DHDF5_ENABLE_Z_LIB_SUPPORT=$(usex zlib)
109 + -DHDF5_ENABLE_ROS3_VFD:BOOL=$(usex ros3)
110 + )
111 + cmake_src_configure
112 +}
113 +
114 +src_install() {
115 + cmake_src_install
116 +
117 + # TODO: generate functioning example runners from their respective
118 + # .in files - as of version 1.12.1 upstream only has it implemented
119 + # for autoconf.
120 + if use examples; then
121 + # These are all useless outside the source tree
122 + rm -f {examples,c++/examples,fortran/examples}/{Makefile*,CMake*}
123 + rm -f hl/{examples,c++/examples,fortran/examples}/{Makefile*,CMake*}
124 +
125 + dodoc -r examples
126 + if use cxx; then
127 + docinto c++
128 + dodoc -r c++/examples
129 + fi
130 + if use fortran; then
131 + docinto fortran
132 + dodoc -r fortran/examples
133 + fi
134 + if use hl; then
135 + docinto hl
136 + dodoc -r hl/examples
137 + if use cxx; then
138 + docinto hl/c++
139 + dodoc -r hl/c++/examples
140 + fi
141 + if use fortran; then
142 + docinto hl/fortran
143 + dodoc -r hl/fortran/examples
144 + fi
145 + fi
146 + fi
147 +}
148
149 diff --git a/sci-libs/hdf5/metadata.xml b/sci-libs/hdf5/metadata.xml
150 index ea5ba62b798..042059bcd49 100644
151 --- a/sci-libs/hdf5/metadata.xml
152 +++ b/sci-libs/hdf5/metadata.xml
153 @@ -6,13 +6,14 @@
154 <name>Gentoo Science Project</name>
155 </maintainer>
156 <longdescription>
157 - HDF5 is a file format and library for storing scientific data. HDF5
158 - was designed and implemented to address the deficiencies of HDF4.x. It
159 - has a more powerful and flexible data model, supports files larger
160 - than 2 GB, and supports parallel I/O.
161 -</longdescription>
162 + HDF5 is a file format and library for storing scientific data. HDF5
163 + was designed and implemented to address the deficiencies of HDF4.x. It
164 + has a more powerful and flexible data model, supports files larger
165 + than 2 GB, and supports parallel I/O.
166 + </longdescription>
167 <use>
168 <flag name="hl">Enable high level API (https://support.hdfgroup.org/HDF5/doc/HL/index.html)</flag>
169 + <flag name="ros3">Enable support for read-only S3 access (https://portal.hdfgroup.org/display/HDF5/Configuration+and+Setup+for+HDF5+Read+Only+S3+VFD)</flag>
170 <flag name="unsupported">Enable unsupported combinations of configuration options</flag>
171 </use>
172 </pkgmetadata>