commit:     406802a99084b8c9bf57e9b5f7bad816e86ad821
Author:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Sun Sep  3 20:43:37 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 27 02:30:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=406802a9

sci-libs/cantera: 3.0.0 version bump

New release is compatible with cython-3.

The USE="cti" is dropped due to supplied converters have restricted
functionality or doesn't work (yaml2ck) without full python support.

Python examples aren't provided within tarball since this release.

USE="lapack" support is still restricted using >=sundials-6.5.0.

Closes: https://bugs.gentoo.org/913141
Bug: https://bugs.gentoo.org/888667

Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/cantera/Manifest                      |   1 +
 sci-libs/cantera/cantera-3.0.0.ebuild          | 139 +++++++++++++++++++++++++
 sci-libs/cantera/files/cantera-3.0.0_env.patch |  25 +++++
 sci-libs/cantera/metadata.xml                  |   3 +-
 4 files changed, 167 insertions(+), 1 deletion(-)

diff --git a/sci-libs/cantera/Manifest b/sci-libs/cantera/Manifest
index 6b5da97bd886..782522d16b9c 100644
--- a/sci-libs/cantera/Manifest
+++ b/sci-libs/cantera/Manifest
@@ -1 +1,2 @@
 DIST cantera-2.6.0.tar.gz 2586243 BLAKE2B 
3562dc3641c70cdbd5e07062ecee56c0658b098c20bb477c3e741731db01e38fccf624e6769377420b01dd4bac72a0608cf226cce40ac12f13e71081090e06bc
 SHA512 
74e12c89af38236bcc064034f74edcc690895151a9e453e728d130b83f5f527e675750c68a3fe36eea3c6aec6969685aa8828ae740a2e27b5df72a8ccc4d2856
+DIST cantera-3.0.0.tar.gz 2451103 BLAKE2B 
094d7a4f0b8fd0f1a45d9f8c13e1390cf7fc62110e424e1287030e97382c1cdc016a5119adc4d5c7bbc222420a3b447db93fee8350643cb3a0907a838fbc1ddf
 SHA512 
dffd696628210ae5c7b08e394e9a97262cfa6aa07ac2e6faa48591ecfee5bb11e7c2b6928563007fd581a1fd9cae999f7c1414ab5d5a312a823e155573df7aca

diff --git a/sci-libs/cantera/cantera-3.0.0.ebuild 
b/sci-libs/cantera/cantera-3.0.0.ebuild
new file mode 100644
index 000000000000..da1bd0e4e645
--- /dev/null
+++ b/sci-libs/cantera/cantera-3.0.0.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+FORTRAN_NEEDED=fortran
+FORTRAN_STANDARD="77 90"
+
+inherit fortran-2 python-single-r1 scons-utils toolchain-funcs
+
+DESCRIPTION="Object-oriented tool suite for chemical kinetics, thermodynamics, 
and transport"
+HOMEPAGE="https://www.cantera.org";
+SRC_URI="https://github.com/Cantera/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="fortran lapack +python test"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+       ${PYTHON_REQUIRED_USE}
+"
+
+RDEPEND="
+       ${PYTHON_DEPS}
+       lapack? ( virtual/lapack )
+       python? (
+               $(python_gen_cond_dep '
+                       dev-python/numpy[${PYTHON_USEDEP}]
+                       dev-python/ruamel-yaml[${PYTHON_USEDEP}]
+               ')
+       )
+       dev-cpp/yaml-cpp
+       !lapack? ( sci-libs/sundials:0= )
+       lapack? ( >=sci-libs/sundials-6.5.0:0=[lapack?] )
+"
+
+DEPEND="
+       ${RDEPEND}
+       dev-cpp/eigen:3
+       dev-libs/boost:=
+       dev-libs/libfmt
+       python? (
+               $(python_gen_cond_dep '
+                       dev-python/cython[${PYTHON_USEDEP}]
+                       dev-python/pip[${PYTHON_USEDEP}]
+               ')
+       )
+       test? (
+               >=dev-cpp/gtest-1.11.0
+               python? (
+                       $(python_gen_cond_dep '
+                               dev-python/h5py[${PYTHON_USEDEP}]
+                               dev-python/pandas[${PYTHON_USEDEP}]
+                               dev-python/pytest[${PYTHON_USEDEP}]
+                               dev-python/scipy[${PYTHON_USEDEP}]
+                       ')
+               )
+       )
+"
+
+QA_SONAME="usr/lib.*/libcantera_python3.*.so" # intended for dlopen()
+
+PATCHES=(
+       "${FILESDIR}/${P}_env.patch"
+)
+
+pkg_setup() {
+       fortran-2_pkg_setup
+       python-single-r1_pkg_setup
+}
+
+## Full list of configuration options of Cantera is presented here:
+## http://cantera.org/docs/sphinx/html/compiling/config-options.html
+src_configure() {
+       scons_vars=(
+               AR="$(tc-getAR)"
+               CC="$(tc-getCC)"
+               CXX="$(tc-getCXX)"
+               cc_flags="${CXXFLAGS}"
+               cxx_flags="-std=c++17"
+               debug="no"
+               FORTRAN="$(tc-getFC)"
+               FORTRANFLAGS="${FCFLAGS}"
+               optimize_flags="-Wno-inline"
+               renamed_shared_libraries="no"
+               use_pch="no"
+               ## In some cases other order can break the detection of right 
location of Boost: ##
+               system_fmt="y"
+               system_sundials="y"
+               system_eigen="y"
+               system_yamlcpp="y"
+               hdf_support="n"
+               system_blas_lapack=$(usex lapack y n)
+               env_vars="all"
+               extra_inc_dirs="/usr/include/eigen3"
+       )
+       use lapack && scons_vars+=( blas_lapack_libs="lapack,blas" )
+       use test || scons_vars+=( googletest="none" )
+
+       scons_targets=(
+               f90_interface=$(usex fortran y n)
+       )
+
+       if use python ; then
+               scons_targets+=( python_package="full" python_cmd="${EPYTHON}" )
+       else
+               scons_targets+=( python_package="none" )
+       fi
+}
+
+src_compile() {
+       escons build "${scons_vars[@]}" "${scons_targets[@]}" prefix="/usr"
+}
+
+src_test() {
+       escons test
+}
+
+src_install() {
+       escons install stage_dir="${D}" libdirname="$(get_libdir)"
+       if ! use python ; then
+               rm -r "${D}/usr/share/man" || die "Can't remove man files."
+       else
+               # Run the byte-compile of modules
+               python_optimize "${D}$(python_get_sitedir)/${PN}"
+       fi
+
+       # User could remove this line if require static libs for development 
purpose
+       find "${ED}" -name '*.a' -delete || die
+}
+
+pkg_postinst() {
+       local post_msg=$(usex fortran "and Fortran " "")
+       elog "C++ ${post_msg}samples are installed to 
'/usr/share/${PN}/samples/' directory."
+}

diff --git a/sci-libs/cantera/files/cantera-3.0.0_env.patch 
b/sci-libs/cantera/files/cantera-3.0.0_env.patch
new file mode 100644
index 000000000000..786df7140632
--- /dev/null
+++ b/sci-libs/cantera/files/cantera-3.0.0_env.patch
@@ -0,0 +1,25 @@
+diff -Naur a/SConstruct b/SConstruct
+--- a/SConstruct
++++ b/SConstruct
+@@ -819,7 +819,7 @@
+     toolchain = ["default"]
+ 
+ env = Environment(tools=toolchain+["textfile", "subst", "recursiveInstall", 
"UnitsInterfaceBuilder", "wix", "gch"],
+-                  ENV={"PATH": os.environ["PATH"]},
++                  ENV={'PATH': os.environ['PATH'], 'CCACHE_DIR': 
os.environ.get('CCACHE_DIR','')},
+                   toolchain=toolchain,
+                   **extraEnvArgs)
+ 
+@@ -970,11 +974,7 @@
+ env["CPU"] = get_processor_name()
+ logger.info(f"Compiling on {env['CPU']!r}")
+ 
+-try:
+-    env["git_commit"] = get_command_output("git", "rev-parse", "--short", 
"HEAD")
+-    logger.info(f"Building Cantera from git commit {env['git_commit']!r}")
+-except (subprocess.CalledProcessError, FileNotFoundError):
+-    env["git_commit"] = "unknown"
++env["git_commit"] = "unknown"
+ 
+ # Print values of all build options:
+ # the (updated) "cantera.conf" combines all options that were specified by 
the user

diff --git a/sci-libs/cantera/metadata.xml b/sci-libs/cantera/metadata.xml
index 919e8bf0ad40..81f17579d02a 100644
--- a/sci-libs/cantera/metadata.xml
+++ b/sci-libs/cantera/metadata.xml
@@ -14,7 +14,8 @@
     for problems involving chemical kinetics, thermodynamics, and/or transport 
processes.
   </longdescription>
   <use>
-    <flag name="cti">Install CTI tools (ck2cti, ck2yaml, ctml_writer) for 
conversion of Chemkin files to Cantera format</flag>
+    <flag name="cti">Install conversion tools (ck2cti, ck2yaml, ctml_writer) 
from Chemkin to Cantera format</flag>
+    <flag name="python">Install Python bindings and conversion tools from 
Chemkin to Cantera format</flag>
   </use>
   <upstream>
     <remote-id type="github">cantera/cantera</remote-id>

Reply via email to