commit:     bfc20ea17c60b59183334f78da824b39077ebcae
Author:     Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Tue Dec 27 21:32:46 2022 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Jan 30 09:59:56 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bfc20ea1

sci-libs/cantera: 2.6.0-r2 revision bump

1. EAPI8 bump
2. Add Python 3.11 compat, rm deprecated open U option (upstream patch)
3. Rectrict USE=lapack with >=sci-libs/sundials-6.5.0[lapack?]
4. Set std=c++14 to avoid build fail with upcoming dev-libs/boost-1.82
and sci-libs/sundials-6.5.0 detection (the last is strange).

Bug: https://bugs.gentoo.org/888667
Closes: https://bugs.gentoo.org/888527
Closes: https://bugs.gentoo.org/890427

Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 sci-libs/cantera/cantera-2.6.0-r2.ebuild           | 151 +++++++++++++++++++++
 ...ntera-2.6.0_drop_deprecated_open_U_option.patch |  49 +++++++
 2 files changed, 200 insertions(+)

diff --git a/sci-libs/cantera/cantera-2.6.0-r2.ebuild 
b/sci-libs/cantera/cantera-2.6.0-r2.ebuild
new file mode 100644
index 000000000000..31d393df1c40
--- /dev/null
+++ b/sci-libs/cantera/cantera-2.6.0-r2.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..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="+cti fortran lapack +python test"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+       python? ( cti )
+       ${PYTHON_REQUIRED_USE}
+"
+
+RDEPEND="
+       ${PYTHON_DEPS}
+       lapack? ( virtual/lapack )
+       cti? (
+               $(python_gen_cond_dep '
+                       dev-python/ruamel-yaml[${PYTHON_USEDEP}]
+               ')
+       )
+       python? (
+               $(python_gen_cond_dep '
+                       dev-python/numpy[${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}]
+                       ')
+               )
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}/${P}_env.patch"
+       "${FILESDIR}/${P}_drop_deprecated_open_U_option.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++14"
+               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"
+               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 cti ; then
+               local scons_python=$(usex python full minimal)
+               scons_targets+=( python_package="${scons_python}" 
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 cti ; 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() {
+       if use cti && ! use python ; then
+               elog "Cantera was build without 'python' use-flag therefore the 
CTI tools 'ck2cti' and 'ck2yaml"
+               elog "will convert Chemkin files to Cantera format without 
verification of kinetic mechanism."
+       fi
+
+       local post_msg=$(usex fortran "and Fortran " "")
+       elog "C++ ${post_msg}samples are installed to 
'/usr/share/${PN}/samples/' directory."
+
+       if use python ; then
+               elog "Python examples are installed to 
'$(python_get_sitedir)/${PN}/examples/' directories."
+       fi
+}

diff --git 
a/sci-libs/cantera/files/cantera-2.6.0_drop_deprecated_open_U_option.patch 
b/sci-libs/cantera/files/cantera-2.6.0_drop_deprecated_open_U_option.patch
new file mode 100644
index 000000000000..41243da82f68
--- /dev/null
+++ b/sci-libs/cantera/files/cantera-2.6.0_drop_deprecated_open_U_option.patch
@@ -0,0 +1,49 @@
+From 0b407e11fe0bae4707286ab3cbf6a7a72a906817 Mon Sep 17 00:00:00 2001
+From: "Mark E. Fuller" <[email protected]>
+Date: Thu, 23 Jun 2022 00:04:22 +0300
+Subject: [PATCH] drop deprecated 'U' open option
+
+---
+ site_scons/site_tools/subst.py | 15 +++------------
+ 1 file changed, 3 insertions(+), 12 deletions(-)
+
+diff --git a/site_scons/site_tools/subst.py b/site_scons/site_tools/subst.py
+index 3a1c4f6fb8..05d520491b 100644
+--- a/site_scons/site_tools/subst.py
++++ b/site_scons/site_tools/subst.py
+@@ -12,7 +12,7 @@
+ 
+ from SCons.Script import *
+ import SCons.Errors
+-
++from pathlib import Path
+ 
+ # Helper/core functions
+ ##############################################################################
+@@ -20,12 +20,7 @@
+ # Do the substitution
+ def _subst_file(target, source, env, pattern, replace):
+     # Read file
+-    #print 'CALLING SUBST_FILE'
+-    f = open(source, "rU")
+-    try:
+-        contents = f.read()
+-    finally:
+-        f.close()
++    contents = Path(source).read_text()
+ 
+     # Substitute, make sure result is a string
+     def subfn(mo):
+@@ -46,11 +41,7 @@ def subfn(mo):
+ # Determine which keys are used
+ def _subst_keys(source, pattern):
+     # Read file
+-    f = open(source, "rU")
+-    try:
+-        contents = f.read()
+-    finally:
+-        f.close()
++    contents = Path(source).read_text()
+ 
+     # Determine keys
+     keys = []

Reply via email to