Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/hdf5/
Date: Thu, 18 Aug 2022 04:17:42
Message-Id: 1660796225.0bb35865c3e8124957bb6919e22abf792ebc9253.heroxbd@gentoo
1 commit: 0bb35865c3e8124957bb6919e22abf792ebc9253
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 18 04:16:23 2022 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 18 04:17:05 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bb35865
7
8 sci-libs/hdf5: reapply 1.12.2-r2 fix to autotools based ebuild.
9
10 Commit 8e16e7412dd38185db203d70732a06fd81b5fe95 introduced standard
11 hdf5 plugins directory for Gentoo. This commit reapplies it after
12 switching back from cmake to autotools.
13
14 Package-Manager: Portage-3.0.30, Repoman-3.0.3
15 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
16
17 sci-libs/hdf5/hdf5-1.12.2-r5.ebuild | 118 ++++++++++++++++++++++++++++++++++++
18 1 file changed, 118 insertions(+)
19
20 diff --git a/sci-libs/hdf5/hdf5-1.12.2-r5.ebuild b/sci-libs/hdf5/hdf5-1.12.2-r5.ebuild
21 new file mode 100644
22 index 000000000000..9e9c9c1af629
23 --- /dev/null
24 +++ b/sci-libs/hdf5/hdf5-1.12.2-r5.ebuild
25 @@ -0,0 +1,118 @@
26 +# Copyright 1999-2022 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=8
30 +
31 +FORTRAN_NEEDED=fortran
32 +
33 +# We've reverted *back* to autotools from CMake because of
34 +# https://github.com/HDFGroup/hdf5/issues/1814.
35 +inherit autotools fortran-2 flag-o-matic toolchain-funcs prefix
36 +
37 +MY_P=${PN}-${PV/_p/-patch}
38 +MAJOR_P=${PN}-$(ver_cut 1-2)
39 +
40 +DESCRIPTION="General purpose library and file format for storing scientific data"
41 +HOMEPAGE="https://www.hdfgroup.org/HDF5/"
42 +SRC_URI="https://www.hdfgroup.org/ftp/HDF5/releases/${MAJOR_P}/${MY_P}/src/${MY_P}.tar.bz2"
43 +S="${WORKDIR}/${MY_P}"
44 +
45 +LICENSE="NCSA-HDF"
46 +SLOT="0/${PV%%_p*}"
47 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
48 +IUSE="cxx debug examples fortran +hl mpi szip threads unsupported zlib"
49 +REQUIRED_USE="
50 + !unsupported? (
51 + cxx? ( !mpi ) mpi? ( !cxx )
52 + threads? ( !cxx !mpi !fortran !hl )
53 + )
54 +"
55 +
56 +RDEPEND="
57 + mpi? ( virtual/mpi[romio] )
58 + szip? ( virtual/szip )
59 + zlib? ( sys-libs/zlib:0= )"
60 +DEPEND="${RDEPEND}"
61 +
62 +PATCHES=(
63 + "${FILESDIR}"/${PN}-1.8.9-static_libgfortran.patch
64 + "${FILESDIR}"/${PN}-1.12.2-no-messing-ldpath.patch
65 + "${FILESDIR}"/${PN}-1.12.2-no-strip-symbols.patch
66 +)
67 +
68 +pkg_setup() {
69 + # Workaround for bug 285148
70 + tc-export CXX CC AR
71 +
72 + use fortran && fortran-2_pkg_setup
73 +
74 + if use mpi; then
75 + if has_version 'sci-libs/hdf5[-mpi]'; then
76 + ewarn "Installing hdf5 with mpi enabled with a previous hdf5 with mpi disabled may fail."
77 + ewarn "Try to uninstall the current hdf5 prior to enabling mpi support."
78 + fi
79 +
80 + export CC=mpicc
81 + use fortran && export FC=mpif90
82 + elif has_version 'sci-libs/hdf5[mpi]'; then
83 + ewarn "Installing hdf5 with mpi disabled while having hdf5 installed with mpi enabled may fail."
84 + ewarn "Try to uninstall the current hdf5 prior to disabling mpi support."
85 + fi
86 +}
87 +
88 +src_prepare() {
89 + default
90 +
91 + # Respect Gentoo examples directory
92 + sed \
93 + -e "s:hdf5_examples:doc/${PF}/examples:g" \
94 + -i $(find . -name Makefile.am) $(find . -name "run*.sh.in") || die
95 + sed \
96 + -e '/docdir/d' \
97 + -i config/commence.am || die
98 +
99 + if ! use examples; then
100 + # bug #409091
101 + sed -e '/^install:/ s/install-examples//' \
102 + -i Makefile.am || die
103 + fi
104 +
105 + # Enable shared libs by default for h5cc config utility
106 + sed -i -e "s/SHLIB:-no/SHLIB:-yes/g" bin/h5cc.in || die
107 + hprefixify m4/libtool.m4
108 +
109 + eautoreconf
110 +}
111 +
112 +src_configure() {
113 + # bug #686620
114 + use sparc && tc-is-gcc && append-flags -fno-tree-ccp
115 +
116 + econf \
117 + --disable-static \
118 + --enable-deprecated-symbols \
119 + --enable-build-mode=$(usex debug debug production) \
120 + --with-default-plugindir="${EPREFIX}/usr/$(get_libdir)/${PN}/plugin" \
121 + $(use_enable cxx) \
122 + $(use_enable debug codestack) \
123 + $(use_enable fortran) \
124 + $(use_enable hl) \
125 + $(use_enable mpi parallel) \
126 + $(use_enable threads threadsafe) \
127 + $(use_enable unsupported) \
128 + $(use_with szip szlib) \
129 + $(use_with threads pthread) \
130 + $(use_with zlib)
131 +}
132 +
133 +src_install() {
134 + emake DESTDIR="${D}" EPREFIX="${EPREFIX}" install
135 +
136 + # No static archives
137 + find "${ED}" -name '*.la' -delete || die
138 +
139 + # Remove "perf" executable due to file collisions with dev-util/perf.
140 + # Previously with the CMake build system we only installed h5perf, so
141 + # let's simply remove the file for now.
142 + use mpi && { rm "${ED}"/usr/bin/perf || die "rm failed" ; }
143 +}