1 |
commit: 95eccece0ac1413544a5f45bd40b50271d5cb65e |
2 |
Author: Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru> |
3 |
AuthorDate: Fri May 6 21:36:41 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 13 20:03:53 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95eccece |
7 |
|
8 |
sci-libs/cantera: 2.6.0 version bump |
9 |
|
10 |
dev-python/pip is used to install python bindings and |
11 |
dev-python/pytest is used for python tests since this release |
12 |
|
13 |
Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru> |
14 |
Closes: https://github.com/gentoo/gentoo/pull/25357 |
15 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
16 |
|
17 |
sci-libs/cantera/Manifest | 1 + |
18 |
sci-libs/cantera/cantera-2.6.0.ebuild | 147 +++++++++++++++++++++++++ |
19 |
sci-libs/cantera/files/cantera-2.6.0_env.patch | 57 ++++++++++ |
20 |
3 files changed, 205 insertions(+) |
21 |
|
22 |
diff --git a/sci-libs/cantera/Manifest b/sci-libs/cantera/Manifest |
23 |
index 67533340104e..beccad729392 100644 |
24 |
--- a/sci-libs/cantera/Manifest |
25 |
+++ b/sci-libs/cantera/Manifest |
26 |
@@ -1 +1,2 @@ |
27 |
DIST cantera-2.5.1.tar.gz 2492422 BLAKE2B b48c5d12fc2b69d309759afd20b55dc2533c23ccba840109cf7a85c4ebb8306eb48d9f007914184a9d409f7bf296814fe09e6e62a29cf8384edd954fdff2af4e SHA512 8cd65f6b86b3009f22ec243cb7cb833e26919c4925fd15fba8fb98aad2180d8c0fe7550e13efeb7cce55abab06d9400230d59c9c43b4d3be6b0575b1164a56bc |
28 |
+DIST cantera-2.6.0.tar.gz 2586243 BLAKE2B 3562dc3641c70cdbd5e07062ecee56c0658b098c20bb477c3e741731db01e38fccf624e6769377420b01dd4bac72a0608cf226cce40ac12f13e71081090e06bc SHA512 74e12c89af38236bcc064034f74edcc690895151a9e453e728d130b83f5f527e675750c68a3fe36eea3c6aec6969685aa8828ae740a2e27b5df72a8ccc4d2856 |
29 |
|
30 |
diff --git a/sci-libs/cantera/cantera-2.6.0.ebuild b/sci-libs/cantera/cantera-2.6.0.ebuild |
31 |
new file mode 100644 |
32 |
index 000000000000..35884d896367 |
33 |
--- /dev/null |
34 |
+++ b/sci-libs/cantera/cantera-2.6.0.ebuild |
35 |
@@ -0,0 +1,147 @@ |
36 |
+# Copyright 1999-2022 Gentoo Authors |
37 |
+# Distributed under the terms of the GNU General Public License v2 |
38 |
+ |
39 |
+EAPI=7 |
40 |
+ |
41 |
+PYTHON_COMPAT=( python3_{8..10} ) |
42 |
+ |
43 |
+FORTRAN_NEEDED=fortran |
44 |
+FORTRAN_STANDARD="77 90" |
45 |
+ |
46 |
+inherit fortran-2 python-single-r1 scons-utils toolchain-funcs |
47 |
+ |
48 |
+DESCRIPTION="Object-oriented tool suite for chemical kinetics, thermodynamics, and transport" |
49 |
+HOMEPAGE="https://www.cantera.org" |
50 |
+SRC_URI="https://github.com/Cantera/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
51 |
+ |
52 |
+LICENSE="BSD" |
53 |
+SLOT="0" |
54 |
+KEYWORDS="~amd64 ~x86" |
55 |
+IUSE="+cti fortran lapack +python test" |
56 |
+RESTRICT="!test? ( test )" |
57 |
+ |
58 |
+REQUIRED_USE=" |
59 |
+ python? ( cti ) |
60 |
+ ${PYTHON_REQUIRED_USE} |
61 |
+" |
62 |
+ |
63 |
+RDEPEND=" |
64 |
+ ${PYTHON_DEPS} |
65 |
+ lapack? ( virtual/lapack ) |
66 |
+ cti? ( |
67 |
+ $(python_gen_cond_dep ' |
68 |
+ dev-python/ruamel-yaml[${PYTHON_USEDEP}] |
69 |
+ ') |
70 |
+ ) |
71 |
+ python? ( |
72 |
+ $(python_gen_cond_dep ' |
73 |
+ dev-python/numpy[${PYTHON_USEDEP}] |
74 |
+ ') |
75 |
+ ) |
76 |
+ dev-cpp/yaml-cpp |
77 |
+ <sci-libs/sundials-5.9.0:0=[lapack?] |
78 |
+" |
79 |
+ |
80 |
+DEPEND=" |
81 |
+ ${RDEPEND} |
82 |
+ dev-cpp/eigen:3 |
83 |
+ dev-libs/boost |
84 |
+ dev-libs/libfmt |
85 |
+ python? ( |
86 |
+ $(python_gen_cond_dep ' |
87 |
+ dev-python/cython[${PYTHON_USEDEP}] |
88 |
+ dev-python/pip[${PYTHON_USEDEP}] |
89 |
+ ') |
90 |
+ ) |
91 |
+ test? ( |
92 |
+ >=dev-cpp/gtest-1.11.0 |
93 |
+ python? ( |
94 |
+ $(python_gen_cond_dep ' |
95 |
+ dev-python/h5py[${PYTHON_USEDEP}] |
96 |
+ dev-python/pandas[${PYTHON_USEDEP}] |
97 |
+ dev-python/pytest[${PYTHON_USEDEP}] |
98 |
+ dev-python/scipy[${PYTHON_USEDEP}] |
99 |
+ ') |
100 |
+ ) |
101 |
+ ) |
102 |
+" |
103 |
+ |
104 |
+PATCHES=( "${FILESDIR}/${P}_env.patch" ) |
105 |
+ |
106 |
+pkg_setup() { |
107 |
+ fortran-2_pkg_setup |
108 |
+ python-single-r1_pkg_setup |
109 |
+} |
110 |
+ |
111 |
+## Full list of configuration options of Cantera is presented here: |
112 |
+## http://cantera.org/docs/sphinx/html/compiling/config-options.html |
113 |
+src_configure() { |
114 |
+ scons_vars=( |
115 |
+ AR="$(tc-getAR)" |
116 |
+ CC="$(tc-getCC)" |
117 |
+ CXX="$(tc-getCXX)" |
118 |
+ cc_flags="${CXXFLAGS}" |
119 |
+ cxx_flags="-std=c++11" |
120 |
+ debug="no" |
121 |
+ FORTRAN="$(tc-getFC)" |
122 |
+ FORTRANFLAGS="${FCFLAGS}" |
123 |
+ optimize_flags="-Wno-inline" |
124 |
+ renamed_shared_libraries="no" |
125 |
+ use_pch="no" |
126 |
+ ## In some cases other order can break the detection of right location of Boost: ## |
127 |
+ system_fmt="y" |
128 |
+ system_sundials="y" |
129 |
+ system_eigen="y" |
130 |
+ system_yamlcpp="y" |
131 |
+ env_vars="all" |
132 |
+ extra_inc_dirs="/usr/include/eigen3" |
133 |
+ ) |
134 |
+ use lapack && scons_vars+=( blas_lapack_libs="lapack,blas" ) |
135 |
+ use test || scons_vars+=( googletest="none" ) |
136 |
+ |
137 |
+ scons_targets=( |
138 |
+ f90_interface=$(usex fortran y n) |
139 |
+ ) |
140 |
+ |
141 |
+ if use cti ; then |
142 |
+ local scons_python=$(usex python full minimal) |
143 |
+ scons_targets+=( python_package="${scons_python}" python_cmd="${EPYTHON}" ) |
144 |
+ else |
145 |
+ scons_targets+=( python_package="none" ) |
146 |
+ fi |
147 |
+} |
148 |
+ |
149 |
+src_compile() { |
150 |
+ escons build "${scons_vars[@]}" "${scons_targets[@]}" prefix="/usr" |
151 |
+} |
152 |
+ |
153 |
+src_test() { |
154 |
+ escons test |
155 |
+} |
156 |
+ |
157 |
+src_install() { |
158 |
+ escons install stage_dir="${D}" libdirname="$(get_libdir)" |
159 |
+ if ! use cti ; then |
160 |
+ rm -r "${D}/usr/share/man" || die "Can't remove man files." |
161 |
+ else |
162 |
+ # Run the byte-compile of modules |
163 |
+ python_optimize "${D}$(python_get_sitedir)/${PN}" |
164 |
+ fi |
165 |
+ |
166 |
+ # User could remove this line if require static libs for development purpose |
167 |
+ find "${ED}" -name '*.a' -delete || die |
168 |
+} |
169 |
+ |
170 |
+pkg_postinst() { |
171 |
+ if use cti && ! use python ; then |
172 |
+ elog "Cantera was build without 'python' use-flag therefore the CTI tools 'ck2cti' and 'ck2yaml" |
173 |
+ elog "will convert Chemkin files to Cantera format without verification of kinetic mechanism." |
174 |
+ fi |
175 |
+ |
176 |
+ local post_msg=$(usex fortran "and Fortran " "") |
177 |
+ elog "C++ ${post_msg}samples are installed to '/usr/share/${PN}/samples/' directory." |
178 |
+ |
179 |
+ if use python ; then |
180 |
+ elog "Python examples are installed to '$(python_get_sitedir)/${PN}/examples/' directories." |
181 |
+ fi |
182 |
+} |
183 |
|
184 |
diff --git a/sci-libs/cantera/files/cantera-2.6.0_env.patch b/sci-libs/cantera/files/cantera-2.6.0_env.patch |
185 |
new file mode 100644 |
186 |
index 000000000000..e49fb4679dd7 |
187 |
--- /dev/null |
188 |
+++ b/sci-libs/cantera/files/cantera-2.6.0_env.patch |
189 |
@@ -0,0 +1,57 @@ |
190 |
+diff -Naur old/SConstruct new/SConstruct |
191 |
+--- old/SConstruct |
192 |
++++ new/SConstruct |
193 |
+@@ -178,6 +178,10 @@ |
194 |
+ |
195 |
+ config_options = [ |
196 |
+ Option( |
197 |
++ "AR", |
198 |
++ "The archiver to use.", |
199 |
++ "${AR}"), |
200 |
++ Option( |
201 |
+ "CXX", |
202 |
+ "The C++ compiler to use.", |
203 |
+ "${CXX}"), |
204 |
+@@ -740,7 +744,7 @@ |
205 |
+ toolchain = ["default"] |
206 |
+ |
207 |
+ env = Environment(tools=toolchain+["textfile", "subst", "recursiveInstall", "wix", "gch"], |
208 |
+- ENV={"PATH": os.environ["PATH"]}, |
209 |
++ ENV={'PATH': os.environ['PATH'], 'CCACHE_DIR': os.environ.get('CCACHE_DIR','')}, |
210 |
+ toolchain=toolchain, |
211 |
+ **extraEnvArgs) |
212 |
+ |
213 |
+@@ -775,7 +779,7 @@ |
214 |
+ |
215 |
+ add_RegressionTest(env) |
216 |
+ |
217 |
+-opts.AddVariables(*config.to_scons(["CC", "CXX"], env=env)) |
218 |
++opts.AddVariables(*config.to_scons(["AR", "CC", "CXX"], env=env)) |
219 |
+ opts.Update(env) |
220 |
+ |
221 |
+ # Check if this is actually Apple's clang on macOS |
222 |
+@@ -861,11 +865,7 @@ |
223 |
+ env['cantera_pure_version'] = re.match(r'(\d+\.\d+\.\d+)', env['cantera_version']).group(0) |
224 |
+ env['cantera_short_version'] = re.match(r'(\d+\.\d+)', env['cantera_version']).group(0) |
225 |
+ |
226 |
+-try: |
227 |
+- env["git_commit"] = get_command_output("git", "rev-parse", "--short", "HEAD") |
228 |
+- logger.info(f"Building Cantera from git commit '{env['git_commit']}'") |
229 |
+-except (subprocess.CalledProcessError, FileNotFoundError): |
230 |
+- env["git_commit"] = "unknown" |
231 |
++env["git_commit"] = "unknown" |
232 |
+ |
233 |
+ # Print values of all build options: |
234 |
+ # the (updated) "cantera.conf" combines all options that were specified by the user |
235 |
+diff -Naur old/test_problems/SConscript new/test_problems/SConscript |
236 |
+--- old/test_problems/SConscript |
237 |
++++ new/test_problems/SConscript |
238 |
+@@ -233,7 +233,7 @@ |
239 |
+ artifacts=['vcs_equilibrate_res.csv']) |
240 |
+ |
241 |
+ CompileAndTest('clib', 'clib_test', 'clib_test', |
242 |
+- extensions=['^clib_test.c'], libs=localenv['cantera_shared_libs']) |
243 |
++ extensions=['^clib_test.c']) |
244 |
+ |
245 |
+ # C++ Samples |
246 |
+ Test('cxx-bvp', 'cxx_samples', '#build/samples/cxx/bvp/blasius', None, |