Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/libmed/
Date: Fri, 01 Feb 2019 13:46:56
Message-Id: 1549028772.d2fe2fc4df25ac7200748694607ebd53ed142f34.fordfrog@gentoo
1 commit: d2fe2fc4df25ac7200748694607ebd53ed142f34
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 1 12:54:02 2019 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 1 13:46:12 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2fe2fc4
7
8 sci-libs/libmed-3.3.1: new ebuild
9
10 Author: Fabio Rossi <rossi.f <AT> inwind.it>
11 Closes: https://bugs.gentoo.org/597768
12 Package-Manager: Portage-2.3.59, Repoman-2.3.12
13 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
14
15 sci-libs/libmed/Manifest | 2 +
16 sci-libs/libmed/libmed-3.3.1.ebuild | 100 ++++++++++++++++++++++++++++++++++++
17 sci-libs/libmed/metadata.xml | 8 +++
18 3 files changed, 110 insertions(+)
19
20 diff --git a/sci-libs/libmed/Manifest b/sci-libs/libmed/Manifest
21 new file mode 100644
22 index 00000000000..95289cddfb8
23 --- /dev/null
24 +++ b/sci-libs/libmed/Manifest
25 @@ -0,0 +1,2 @@
26 +DIST libmed-3.3.1-gentoo.tar.bz2 36111 BLAKE2B 2e09f73da8c0e07701abeb699e34c322bca591a2417e84c68deafb821c64caeaef4e356b7a9e6ead782da5059824e69ec4c47009532a716a00ac0a3a403ca4b4 SHA512 dfd2052a2e2201d6c0b55f24dbe22f6ffbd7bdf0cfe436e1a3f556eea23aeb4a8470bd330fa7caecf8bbb8fd491b0490f357cee063622b7aa1e39ce807e3b847
27 +DIST med-3.3.1.tar.gz 43379218 BLAKE2B 101033a766b3b8f184de8b18437a020129da3a11fd947742c30d8b9d274542e7445f1ee1d5827194a1ebc02c701ea6911105102f7b61c24d9d07bb15dbfe45f7 SHA512 f1eba3bc69520b862bdab89ce76694f91ed0e6be42c037df8ec655b6314e8ae776083d5ead61fb34097eb8440302969229d1859b6d8fcce51e7551b75d8ebf5f
28
29 diff --git a/sci-libs/libmed/libmed-3.3.1.ebuild b/sci-libs/libmed/libmed-3.3.1.ebuild
30 new file mode 100644
31 index 00000000000..c938f50de35
32 --- /dev/null
33 +++ b/sci-libs/libmed/libmed-3.3.1.ebuild
34 @@ -0,0 +1,100 @@
35 +# Copyright 1999-2019 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +# EAPI=7 uses ninja generator by default but it's incompatible with USE=fortran
41 +# https://github.com/Kitware/ninja/tree/features-for-fortran#readme
42 +CMAKE_MAKEFILE_GENERATOR=emake
43 +
44 +FORTRAN_NEEDED=fortran
45 +# NOTE:The build for multiple python versions should be possible but complecated for the build system
46 +PYTHON_COMPAT=( python2_7 python3_{3,4,5,6} )
47 +
48 +inherit cmake-utils fortran-2 python-single-r1
49 +
50 +MY_P="med-${PV}"
51 +
52 +DESCRIPTION="A library to store and exchange meshed data or computation results"
53 +HOMEPAGE="https://www.salome-platform.org/"
54 +SRC_URI="http://files.salome-platform.org/Salome/other/${MY_P}.tar.gz
55 + https://dev.gentoo.org/~fordfrog/distfiles/${P}-gentoo.tar.bz2"
56 +
57 +LICENSE="GPL-3 LGPL-3"
58 +SLOT="0"
59 +KEYWORDS="~amd64 ~x86"
60 +IUSE="doc fortran mpi python static-libs test"
61 +
62 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
63 +RDEPEND="
64 + sci-libs/hdf5[fortran=,mpi=]
65 + mpi? ( virtual/mpi[fortran=] )
66 + python? ( ${PYTHON_DEPS} )
67 +"
68 +DEPEND="${RDEPEND}
69 + python? ( >=dev-lang/swig-2.0.9:0 )
70 +"
71 +
72 +S="${WORKDIR}"/${MY_P}_SRC
73 +
74 +PATCHES=(
75 + "${WORKDIR}/${P}-cmake-fortran.patch"
76 + "${WORKDIR}/${P}-disable-python-compile.patch" # managed by function of python eclass
77 + "${WORKDIR}/${P}-mpi.patch"
78 + "${WORKDIR}/${P}-hdf5-1.10-support.patch" # taken from Debian
79 + "${WORKDIR}/${P}-cmakelist.patch"
80 + "${WORKDIR}/${P}-tests.patch" # disable a few tests not running
81 + "${WORKDIR}/${P}-tests-python3.patch"
82 + "${WORKDIR}/${P}-installdoc.patch"
83 + "${WORKDIR}/${P}-python-imports.patch"
84 +)
85 +
86 +DOCS=( AUTHORS COPYING COPYING.LESSER ChangeLog NEWS README TODO )
87 +
88 +pkg_setup() {
89 + use python && python-single-r1_pkg_setup
90 + use fortran && fortran-2_pkg_setup
91 +}
92 +
93 +src_prepare() {
94 + # fixes for correct libdir name
95 + sed -i -e "s@SET(_install_dir lib/python@SET(_install_dir $(get_libdir)/python@" \
96 + ./python/CMakeLists.txt || die "sed failed"
97 + for cm in ./src/CMakeLists.txt ./tools/medimport/CMakeLists.txt
98 + do
99 + sed -i -e "s@INSTALL(TARGETS \(.*\) DESTINATION lib)@INSTALL(TARGETS \1 DESTINATION $(get_libdir))@" \
100 + "${cm}" || die "sed on ${cm} failed"
101 + done
102 +
103 + cmake-utils_src_prepare
104 +}
105 +
106 +src_configure() {
107 + local mycmakeargs=(
108 + -DMEDFILE_BUILD_FORTRAN=$(usex fortran)
109 + -DMEDFILE_BUILD_STATIC_LIBS=$(usex static-libs)
110 + -DMEDFILE_BUILD_PYTHON=$(usex python)
111 + -DMEDFILE_BUILD_TESTS=$(usex test)
112 + -DMEDFILE_INSTALL_DOC=$(usex doc)
113 + -DMEDFILE_USE_MPI=$(usex mpi)
114 + -DMEDFILE_DOC_DIRECTORY="${EPREFIX}"/usr/share/doc/${PF}/html # custom var created by patches
115 + )
116 + cmake-utils_src_configure
117 +}
118 +
119 +src_install() {
120 + cmake-utils_src_install
121 +
122 + # the optimization done in CMakeLists.txt has been disabled so
123 + # we need to do it manually
124 + use python && python_optimize
125 +
126 + # Prevent test executables being installed
127 + use test && rm -rf "${D}"/usr/bin/{testc,testf,testpy}
128 +}
129 +
130 +src_test() {
131 + # override parallel mode only for tests
132 + local myctestargs=( "-j 1" )
133 + cmake-utils_src_test
134 +}
135
136 diff --git a/sci-libs/libmed/metadata.xml b/sci-libs/libmed/metadata.xml
137 new file mode 100644
138 index 00000000000..11287d1296c
139 --- /dev/null
140 +++ b/sci-libs/libmed/metadata.xml
141 @@ -0,0 +1,8 @@
142 +<?xml version="1.0" encoding="UTF-8"?>
143 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
144 +<pkgmetadata>
145 + <maintainer type="person">
146 + <email>fordfrog@g.o</email>
147 + <name>Miroslav Šulc</name>
148 + </maintainer>
149 +</pkgmetadata>