From d2fe2fc4df25ac7200748694607ebd53ed142f34 Mon Sep 17 00:00:00 2001 From: Miroslav Šulc Date: Fri, 1 Feb 2019 13:54:02 +0100 Subject: sci-libs/libmed-3.3.1: new ebuild MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Fabio Rossi Closes: https://bugs.gentoo.org/597768 Package-Manager: Portage-2.3.59, Repoman-2.3.12 Signed-off-by: Miroslav Šulc --- sci-libs/libmed/Manifest | 2 + sci-libs/libmed/libmed-3.3.1.ebuild | 100 ++++++++++++++++++++++++++++++++++++ sci-libs/libmed/metadata.xml | 8 +++ 3 files changed, 110 insertions(+) create mode 100644 sci-libs/libmed/Manifest create mode 100644 sci-libs/libmed/libmed-3.3.1.ebuild create mode 100644 sci-libs/libmed/metadata.xml (limited to 'sci-libs') diff --git a/sci-libs/libmed/Manifest b/sci-libs/libmed/Manifest new file mode 100644 index 000000000000..95289cddfb8b --- /dev/null +++ b/sci-libs/libmed/Manifest @@ -0,0 +1,2 @@ +DIST libmed-3.3.1-gentoo.tar.bz2 36111 BLAKE2B 2e09f73da8c0e07701abeb699e34c322bca591a2417e84c68deafb821c64caeaef4e356b7a9e6ead782da5059824e69ec4c47009532a716a00ac0a3a403ca4b4 SHA512 dfd2052a2e2201d6c0b55f24dbe22f6ffbd7bdf0cfe436e1a3f556eea23aeb4a8470bd330fa7caecf8bbb8fd491b0490f357cee063622b7aa1e39ce807e3b847 +DIST med-3.3.1.tar.gz 43379218 BLAKE2B 101033a766b3b8f184de8b18437a020129da3a11fd947742c30d8b9d274542e7445f1ee1d5827194a1ebc02c701ea6911105102f7b61c24d9d07bb15dbfe45f7 SHA512 f1eba3bc69520b862bdab89ce76694f91ed0e6be42c037df8ec655b6314e8ae776083d5ead61fb34097eb8440302969229d1859b6d8fcce51e7551b75d8ebf5f diff --git a/sci-libs/libmed/libmed-3.3.1.ebuild b/sci-libs/libmed/libmed-3.3.1.ebuild new file mode 100644 index 000000000000..c938f50de352 --- /dev/null +++ b/sci-libs/libmed/libmed-3.3.1.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# EAPI=7 uses ninja generator by default but it's incompatible with USE=fortran +# https://github.com/Kitware/ninja/tree/features-for-fortran#readme +CMAKE_MAKEFILE_GENERATOR=emake + +FORTRAN_NEEDED=fortran +# NOTE:The build for multiple python versions should be possible but complecated for the build system +PYTHON_COMPAT=( python2_7 python3_{3,4,5,6} ) + +inherit cmake-utils fortran-2 python-single-r1 + +MY_P="med-${PV}" + +DESCRIPTION="A library to store and exchange meshed data or computation results" +HOMEPAGE="https://www.salome-platform.org/" +SRC_URI="http://files.salome-platform.org/Salome/other/${MY_P}.tar.gz + https://dev.gentoo.org/~fordfrog/distfiles/${P}-gentoo.tar.bz2" + +LICENSE="GPL-3 LGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc fortran mpi python static-libs test" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +RDEPEND=" + sci-libs/hdf5[fortran=,mpi=] + mpi? ( virtual/mpi[fortran=] ) + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND} + python? ( >=dev-lang/swig-2.0.9:0 ) +" + +S="${WORKDIR}"/${MY_P}_SRC + +PATCHES=( + "${WORKDIR}/${P}-cmake-fortran.patch" + "${WORKDIR}/${P}-disable-python-compile.patch" # managed by function of python eclass + "${WORKDIR}/${P}-mpi.patch" + "${WORKDIR}/${P}-hdf5-1.10-support.patch" # taken from Debian + "${WORKDIR}/${P}-cmakelist.patch" + "${WORKDIR}/${P}-tests.patch" # disable a few tests not running + "${WORKDIR}/${P}-tests-python3.patch" + "${WORKDIR}/${P}-installdoc.patch" + "${WORKDIR}/${P}-python-imports.patch" +) + +DOCS=( AUTHORS COPYING COPYING.LESSER ChangeLog NEWS README TODO ) + +pkg_setup() { + use python && python-single-r1_pkg_setup + use fortran && fortran-2_pkg_setup +} + +src_prepare() { + # fixes for correct libdir name + sed -i -e "s@SET(_install_dir lib/python@SET(_install_dir $(get_libdir)/python@" \ + ./python/CMakeLists.txt || die "sed failed" + for cm in ./src/CMakeLists.txt ./tools/medimport/CMakeLists.txt + do + sed -i -e "s@INSTALL(TARGETS \(.*\) DESTINATION lib)@INSTALL(TARGETS \1 DESTINATION $(get_libdir))@" \ + "${cm}" || die "sed on ${cm} failed" + done + + cmake-utils_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DMEDFILE_BUILD_FORTRAN=$(usex fortran) + -DMEDFILE_BUILD_STATIC_LIBS=$(usex static-libs) + -DMEDFILE_BUILD_PYTHON=$(usex python) + -DMEDFILE_BUILD_TESTS=$(usex test) + -DMEDFILE_INSTALL_DOC=$(usex doc) + -DMEDFILE_USE_MPI=$(usex mpi) + -DMEDFILE_DOC_DIRECTORY="${EPREFIX}"/usr/share/doc/${PF}/html # custom var created by patches + ) + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + + # the optimization done in CMakeLists.txt has been disabled so + # we need to do it manually + use python && python_optimize + + # Prevent test executables being installed + use test && rm -rf "${D}"/usr/bin/{testc,testf,testpy} +} + +src_test() { + # override parallel mode only for tests + local myctestargs=( "-j 1" ) + cmake-utils_src_test +} diff --git a/sci-libs/libmed/metadata.xml b/sci-libs/libmed/metadata.xml new file mode 100644 index 000000000000..11287d1296cc --- /dev/null +++ b/sci-libs/libmed/metadata.xml @@ -0,0 +1,8 @@ + + + + + fordfrog@gentoo.org + Miroslav Šulc + + -- cgit v1.2.3-18-g5258