1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 inherit autotools eutils fortran-2 flag-o-matic toolchain-funcs multilib prefix
10 MY_P=${PN}-${PV/_p/-patch}
11 MAJOR_P=${PN}-$(ver_cut 1-2)
13 DESCRIPTION="General purpose library and file format for storing scientific data"
14 HOMEPAGE="http://www.hdfgroup.org/HDF5/"
15 SRC_URI="http://www.hdfgroup.org/ftp/HDF5/releases/${MAJOR_P}/${MY_P}/src/${MY_P}.tar.bz2"
19 KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
20 IUSE="cxx debug examples fortran +hl mpi szip threads zlib"
23 cxx? ( !mpi ) mpi? ( !cxx )
24 threads? ( !cxx !mpi !fortran !hl )"
27 mpi? ( virtual/mpi[romio] )
28 szip? ( virtual/szip )
29 zlib? ( sys-libs/zlib:0= )"
33 >=sys-devel/autoconf-2.69"
35 S="${WORKDIR}/${MY_P}"
38 "${FILESDIR}"/${PN}-1.8.9-static_libgfortran.patch
39 "${FILESDIR}"/${PN}-1.8.9-mpicxx.patch
40 "${FILESDIR}"/${PN}-1.8.13-no-messing-ldpath.patch
44 tc-export CXX CC AR # workaround for bug 285148
45 use fortran && fortran-2_pkg_setup
48 if has_version 'sci-libs/hdf5[-mpi]'; then
49 ewarn "Installing hdf5 with mpi enabled with a previous hdf5 with mpi disabled may fail."
50 ewarn "Try to uninstall the current hdf5 prior to enabling mpi support."
53 use fortran && export FC=mpif90
54 elif has_version 'sci-libs/hdf5[mpi]'; then
55 ewarn "Installing hdf5 with mpi disabled while having hdf5 installed with mpi enabled may fail."
56 ewarn "Try to uninstall the current hdf5 prior to disabling mpi support."
61 # respect gentoo examples directory
63 -e "s:hdf5_examples:doc/${PF}/examples:g" \
64 -i $(find . -name Makefile.am) $(find . -name "run*.sh.in") || die
67 -i config/commence.am || die
68 if ! use examples; then
69 sed -e '/^install:/ s/install-examples//' \
70 -i Makefile.am || die #409091
72 # enable shared libs by default for h5cc config utility
73 sed -i -e "s/SHLIB:-no/SHLIB:-yes/g" tools/src/misc/h5cc.in || die
74 hprefixify m4/libtool.m4
83 --enable-deprecated-symbols \
84 --enable-build-mode=$(usex debug debug production) \
86 $(use_enable debug codestack) \
87 $(use_enable fortran) \
89 $(use_enable mpi parallel) \
90 $(use_enable threads threadsafe) \
91 $(use_with szip szlib) \
92 $(use_with threads pthread) \
100 find "${D}" -name '*.la' -delete || die