1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7} )
8 inherit autotools flag-o-matic fortran-2 python-single-r1
10 #DESCRIPTION="A library to store and exchange meshed data or computation results"
11 DESCRIPTION="Modeling and Exchange of Data library"
12 HOMEPAGE="https://www.salome-platform.org/user-section/about/med"
13 SRC_URI="https://files.salome-platform.org/Salome/other/${P}.tar.gz"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="doc fortran hdf5-16-api python test"
20 # fails to run parallel tests
23 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
24 # dev-lang/tk is needed for wish-based xmdump utility
28 >=sci-libs/hdf5-1.10.2:=[fortran=,mpi(+)]
30 python? ( ${PYTHON_DEPS} )
33 BDEPEND="python? ( >=dev-lang/swig-3.0.8 )"
36 "${FILESDIR}/${P}-0001-doc-html.doc-Makefile.am-install-into-htmldir.patch"
39 DOCS=( AUTHORS ChangeLog README )
42 use python && python-single-r1_pkg_setup
43 use fortran && fortran-2_pkg_setup
47 if use hdf5-16-api; then
48 append-cppflags -DH5_USE_16_API
51 # add flag to produce python 3 code
52 sed -e 's|SWIG_PYTHON_OPT += -c++|SWIG_PYTHON_OPT += -c++ -relativeimport -py3|' \
53 -i ./python/Makefile.am || die "failed to change swig options"
55 # don't use version information when linking python libraries
56 sed -e 's|= -module|= -avoid-version -module|' \
57 -i ./python/Makefile.am || die "failed to change python link flags"
68 --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
69 --with-hdf5="${EPREFIX}"/usr
70 --with-hdf5-lib="${EPREFIX}"/usr/$(get_libdir)
75 if ! use fortran; then
83 --with-swig="${EPREFIX}/usr"
98 use python && python_optimize
102 find "${ED}/usr/$(get_libdir)" -type f -name '*.la' -delete || die "failed to delete *.la files"
104 # remove unnecessary doc subdirs
105 rm -r "${ED}"/usr/share/doc/${PF}/{gif,jpg,odt,png} || die "failed to remove unneeded doc subdirs"
107 rm -r "${ED}"/usr/share/doc/${PF}/html || die "failed to remove html documentation"
110 # Prevent test executables being installed
112 rm -r "${ED}"/usr/bin/{testc,testf,testpy} || die "failed to delete test executables"
115 # we don't need old 2.3.6 include files
116 rm -r "${ED}"/usr/include/2.3.6 || die "failed to delete obsolete include dir"
118 rm "${ED}"/usr/$(get_libdir)/libmed3.settings || die "failed to remove libmed3.settings"