Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/cantera/
Date: Sat, 15 Jan 2022 09:31:38
Message-Id: 1642239080.07d0669e537e00790a76d1e3fba56b361e457f1c.juippis@gentoo
1 commit: 07d0669e537e00790a76d1e3fba56b361e457f1c
2 Author: Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
3 AuthorDate: Sat Dec 18 22:38:43 2021 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 15 09:31:20 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07d0669e
7
8 sci-libs/cantera: add Python3.10, update to sci-libs/sundials-5.8
9
10 Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
11 Closes: https://github.com/gentoo/gentoo/pull/23413
12 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
13
14 sci-libs/cantera/cantera-2.5.1-r2.ebuild | 144 +++++++++++++++++++++++++++++++
15 1 file changed, 144 insertions(+)
16
17 diff --git a/sci-libs/cantera/cantera-2.5.1-r2.ebuild b/sci-libs/cantera/cantera-2.5.1-r2.ebuild
18 new file mode 100644
19 index 000000000000..f4fa50e5d5a0
20 --- /dev/null
21 +++ b/sci-libs/cantera/cantera-2.5.1-r2.ebuild
22 @@ -0,0 +1,144 @@
23 +# Copyright 1999-2022 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +PYTHON_COMPAT=( python3_{8..10} )
29 +
30 +FORTRAN_NEEDED=fortran
31 +FORTRAN_STANDARD="77 90"
32 +
33 +inherit desktop fortran-2 python-single-r1 scons-utils toolchain-funcs
34 +
35 +DESCRIPTION="Object-oriented tool suite for chemical kinetics, thermodynamics, and transport"
36 +HOMEPAGE="https://www.cantera.org"
37 +SRC_URI="https://github.com/Cantera/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
38 +
39 +LICENSE="BSD"
40 +SLOT="0"
41 +KEYWORDS="~amd64 ~x86"
42 +IUSE="+cti fortran lapack pch +python test"
43 +RESTRICT="!test? ( test )"
44 +
45 +REQUIRED_USE="
46 + python? ( cti )
47 + ${PYTHON_REQUIRED_USE}
48 +"
49 +
50 +RDEPEND="
51 + ${PYTHON_DEPS}
52 + lapack? ( virtual/lapack )
53 + cti? (
54 + $(python_gen_cond_dep '
55 + dev-python/ruamel-yaml[${PYTHON_USEDEP}]
56 + ')
57 + )
58 + python? (
59 + $(python_gen_cond_dep '
60 + dev-python/numpy[${PYTHON_USEDEP}]
61 + ')
62 + )
63 + dev-cpp/yaml-cpp
64 + <sci-libs/sundials-5.9.0:0=[lapack?]
65 +"
66 +
67 +DEPEND="
68 + ${RDEPEND}
69 + dev-cpp/eigen:3
70 + dev-libs/boost
71 + dev-libs/libfmt
72 + python? (
73 + $(python_gen_cond_dep '
74 + dev-python/cython[${PYTHON_USEDEP}]
75 + ')
76 + )
77 + test? (
78 + >=dev-cpp/gtest-1.8.0
79 + python? (
80 + $(python_gen_cond_dep '
81 + dev-python/h5py[${PYTHON_USEDEP}]
82 + dev-python/pandas[${PYTHON_USEDEP}]
83 + ')
84 + )
85 + )
86 +"
87 +
88 +PATCHES=( "${FILESDIR}/${P}_env.patch" )
89 +
90 +pkg_setup() {
91 + fortran-2_pkg_setup
92 + python-single-r1_pkg_setup
93 +}
94 +
95 +## Full list of configuration options of Cantera is presented here:
96 +## http://cantera.org/docs/sphinx/html/compiling/config-options.html
97 +src_configure() {
98 + scons_vars=(
99 + AR="$(tc-getAR)"
100 + CC="$(tc-getCC)"
101 + CXX="$(tc-getCXX)"
102 + cc_flags="${CXXFLAGS}"
103 + cxx_flags="-std=c++11"
104 + debug="no"
105 + FORTRAN="$(tc-getFC)"
106 + FORTRANFLAGS="${FCFLAGS}"
107 + optimize_flags="-Wno-inline"
108 + renamed_shared_libraries="no"
109 + use_pch=$(usex pch)
110 + ## In some cases other order can break the detection of right location of Boost: ##
111 + system_fmt="y"
112 + system_sundials="y"
113 + system_eigen="y"
114 + system_yamlcpp="y"
115 + env_vars="all"
116 + extra_inc_dirs="/usr/include/eigen3"
117 + )
118 + use lapack && scons_vars+=( blas_lapack_libs="lapack,blas" )
119 + use test || scons_vars+=( googletest="none" )
120 +
121 + scons_targets=(
122 + f90_interface=$(usex fortran y n)
123 + )
124 +
125 + if use cti ; then
126 + local scons_python=$(usex python full minimal)
127 + scons_targets+=( python_package="${scons_python}" python_cmd="${EPYTHON}" )
128 + else
129 + scons_targets+=( python_package="none" )
130 + fi
131 +}
132 +
133 +src_compile() {
134 + escons build "${scons_vars[@]}" "${scons_targets[@]}" prefix="/usr"
135 +}
136 +
137 +src_test() {
138 + escons test
139 +}
140 +
141 +src_install() {
142 + escons install stage_dir="${D}" libdirname="$(get_libdir)" python_prefix="$(python_get_sitedir)"
143 + if ! use cti ; then
144 + rm -r "${D}/usr/share/man" || die "Can't remove man files."
145 + else
146 + # Run the byte-compile of modules
147 + python_optimize "${D}/$(python_get_sitedir)/${PN}"
148 + fi
149 +
150 + # We install static libs unconditionally here
151 + # See https://github.com/gentoo/gentoo/pull/10017#discussion_r229210565
152 +}
153 +
154 +pkg_postinst() {
155 + if use cti && ! use python ; then
156 + elog "Cantera was build without 'python' use-flag therefore the CTI tools 'ck2cti' and 'ck2yaml"
157 + elog "will convert Chemkin files to Cantera format without verification of kinetic mechanism."
158 + fi
159 +
160 + local post_msg=$(usex fortran "and Fortran " "")
161 + elog "C++ ${post_msg}samples are installed to '/usr/share/${PN}/samples/' directory."
162 +
163 + if use python ; then
164 + elog "Python examples are installed to '$(python_get_sitedir)/${PN}/examples/' directories."
165 + fi
166 +}