diff options
Diffstat (limited to 'sci-libs/cantera')
-rw-r--r-- | sci-libs/cantera/Manifest | 2 | ||||
-rw-r--r-- | sci-libs/cantera/cantera-2.4.0-r1.ebuild | 124 | ||||
-rw-r--r-- | sci-libs/cantera/files/cantera_2.4.0_env.patch | 73 |
3 files changed, 199 insertions, 0 deletions
diff --git a/sci-libs/cantera/Manifest b/sci-libs/cantera/Manifest index 8052ff490b9a..976ab9e4faeb 100644 --- a/sci-libs/cantera/Manifest +++ b/sci-libs/cantera/Manifest @@ -1,4 +1,6 @@ +AUX cantera_2.4.0_env.patch 3559 BLAKE2B 07af1b751b653b1c92288286b9c82ef230ea0df7d9ea4036d23ac24338a221cc45c8e74f137fcf741bb9bb7148e7f3339f54234e9a92ac939956ba7c0ca8e157 SHA512 f2574c3de42d1666a2b64914c66d97045a2a3598f63678b3b60a701d111d7bfc9bd71031dd665a64e6791c9f311fb9514b1a0462a5713763a1b5f87fcd72e528 AUX cantera_2.4.0_libdirname_variable.patch 1252 BLAKE2B 324ff20163a45f7a23fce17b291f36278c3f4a1afbefc09a62b9570230f030c023e77a70dbc034a8006579c6bd4664bda25ff7c9b963a9289bc8d01a03f6edb4 SHA512 19f4909cd5a9edeafbf5bc6f1af7192b30196d59c1e154d6c7dd80c69ee71d15dc8f799e97940c1c0f29905177bb60405be2e8640fc29a215957a4de8f097fdc DIST cantera-2.4.0.tar.gz 2321316 BLAKE2B 40750e3864afa3d35817e6f5777a6ac235261e9d134ef749966dbd738a2af5efec2882e6dcc719851f88656b41469e2159d3bff3df32f6abdf57db3b0a2afcae SHA512 8bb0fee34fa5bc9ec78e6f21a100eaa77bdd966bd0b7f0fa27d452e4f122c69e61648beef847178490f5c5d56267a96f6081cac9ccd03cea153c32814e0e84e9 +EBUILD cantera-2.4.0-r1.ebuild 2845 BLAKE2B b3761011ca55477721c6611d0f808bc4b9c95e62518c4c1cbe69f1bc27ec37ea03955a7995699634d0c6aae1fe35cc9781e7e694d255fde018e590c9519628e6 SHA512 92f3cc1d2e71d02474fec596f1787536c4246f8f4d2902e57c38f25f737efe3b3bc085c61869939148f7be2fa3321b92a30f742471c44b89b5b7fca9f9e824d3 EBUILD cantera-2.4.0.ebuild 3304 BLAKE2B d8d1ffaa3a7d70bb34e6c2982ad2640e9a1db9b94bb6e9a9eff3c2c3361398362858a4b700b33413c7b7ee8bd6d03410d0e9eaad0f73b5328f74ba7a1f140eaf SHA512 a81c574f2858a7999647d9bf340b13eb24436575016632526d8a132359f257654da084b9aaa5026adc627d2240dd5ced5294e6788a01e55229769becf55bf698 MISC metadata.xml 792 BLAKE2B 8f5617f3f6d8047a15e0fcd14a2e11647fc2a7442759434fb98ce2492b962edf38ba662570bfa627c7db10ef00cf945d73029ade83a5c34d8e21adadaae26454 SHA512 0bc11e72add5ab1e31e0ac5ec7b2c85be2757c0cc4d56d0df16e9a7afdea89f5ec6fd2f46a730d4caf25eeba66de0405631acf64fe271272f2348f3fdeaf7515 diff --git a/sci-libs/cantera/cantera-2.4.0-r1.ebuild b/sci-libs/cantera/cantera-2.4.0-r1.ebuild new file mode 100644 index 000000000000..15cb1776f092 --- /dev/null +++ b/sci-libs/cantera/cantera-2.4.0-r1.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{5,6,7} ) + +FORTRAN_NEEDED=fortran +FORTRAN_STANDARD=90 + +inherit desktop fortran-2 python-single-r1 scons-utils toolchain-funcs + +DESCRIPTION="Object-oriented tool suite for chemical kinetics, thermodynamics, and transport" +HOMEPAGE="http://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 pch +python test" + +REQUIRED_USE=" + python? ( cti ) + cti? ( ${PYTHON_REQUIRED_USE} ) + ${PYTHON_REQUIRED_USE} + " + +RDEPEND=" + python? ( + dev-python/numpy[${PYTHON_USEDEP}] + ) + <sci-libs/sundials-4.0.0:0= +" + +DEPEND=" + ${RDEPEND} + dev-cpp/eigen + dev-libs/boost + dev-libs/libfmt + python? ( + dev-python/cython[${PYTHON_USEDEP}] + ) + test? ( + >=dev-cpp/gtest-1.8.0 + ) +" + +PATCHES=( + "${FILESDIR}/${PN}_${PV}_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=( + CC="$(tc-getCC)" + CXX="$(tc-getCXX)" + cc_flags="${CXXFLAGS}" + cxx_flags="-std=c++11" + debug="no" + FORTRAN="$(tc-getFC)" + FORTRANFLAGS="${CXXFLAGS}" + optimize_flags="-Wno-inline" + renamed_shared_libraries="no" + use_pch=$(usex pch) +## In some cases other order can break the detection of right location of Boost: ## + system_fmt="y" + system_sundials="y" + system_eigen="y" + env_vars="all" + extra_inc_dirs="/usr/include/eigen3" + ) + use test || scons_vars+=( googletest="none" ) + + scons_targets=( + f90_interface=$(usex fortran y n) + python2_package="none" + ) + + if use cti ; then + local scons_python=$(usex python full minimal) + scons_targets+=( python3_package="${scons_python}" python3_cmd="${EPYTHON}" ) + else + scons_targets+=( python3_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 +} + +pkg_postinst() { + if use cti && ! use python ; then + elog "Cantera was build without 'python' use-flag therefore the CTI tool 'ck2cti'" + 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.4.0_env.patch b/sci-libs/cantera/files/cantera_2.4.0_env.patch new file mode 100644 index 000000000000..8b0926f7b916 --- /dev/null +++ b/sci-libs/cantera/files/cantera_2.4.0_env.patch @@ -0,0 +1,73 @@ +diff -Nur old/cantera-2.4.0/SConstruct new/cantera-2.4.0/SConstruct +--- old/SConstruct 2018-08-24 16:24:45.000000000 +0300 ++++ new/SConstruct 2019-07-17 15:50:06.000000000 +0300 +@@ -189,7 +189,7 @@ + toolchain = ['default'] + + env = Environment(tools=toolchain+['textfile', 'subst', 'recursiveInstall', 'wix', 'gch'], +- ENV={'PATH': os.environ['PATH']}, ++ ENV={'PATH': os.environ['PATH'], 'CCACHE_DIR': os.environ.get('CCACHE_DIR','')}, + toolchain=toolchain, + **extraEnvArgs) + +@@ -327,6 +327,14 @@ + 'prefix', + 'Set this to the directory where Cantera should be installed.', + defaults.prefix, PathVariable.PathAccept), ++ PathVariable( ++ 'libdirname', ++ """Set this to the directory where Cantera libraries should be installed. ++ Some distributions (e.g. Fedora/RHEL) use 'lib64' instead of 'lib' on 64-bit systems ++ or could use some other library directory name instead of 'lib' depends ++ on architecture and profile (e.g. Gentoo 'libx32' on x32 profile). ++ If user didn't set 'libdirname' configuration variable set it to default value 'lib'""", ++ 'lib', PathVariable.PathAccept), + EnumVariable( + 'python_package', + """If you plan to work in Python, then you need the ``full`` Cantera Python +@@ -723,10 +731,7 @@ + env['cantera_pure_version'] = '.'.join(str(x) for x in ctversion.version) + env['cantera_short_version'] = '.'.join(str(x) for x in ctversion.version[:2]) + +-try: +- env['git_commit'] = getCommandOutput('git', 'rev-parse', '--short', 'HEAD') +-except Exception: +- env['git_commit'] = 'unknown' ++env['git_commit'] = 'unknown' + + # Print values of all build options: + print("Configuration variables read from 'cantera.conf' and command line:") +@@ -1061,7 +1066,7 @@ + + # Ignore the minor version, e.g. 2.4.x -> 2.4 + env['sundials_version'] = '.'.join(sundials_version.split('.')[:2]) +- if env['sundials_version'] not in ('2.4','2.5','2.6','2.7','3.0','3.1'): ++ if env['sundials_version'] not in ('2.4','2.5','2.6','2.7','3.0','3.1','3.2'): + print("""ERROR: Sundials version %r is not supported.""" % env['sundials_version']) + sys.exit(1) + print("""INFO: Using system installation of Sundials version %s.""" % sundials_version) +@@ -1465,12 +1470,6 @@ + # *** Set additional configuration variables *** + # ********************************************** + +-# Some distributions (e.g. Fedora/RHEL) use 'lib64' instead of 'lib' on 64-bit systems +-if any(name.startswith('/usr/lib64/python') for name in sys.path): +- env['libdirname'] = 'lib64' +-else: +- env['libdirname'] = 'lib' +- + # On Debian-based systems, need to special-case installation to + # /usr/local because of dist-packages vs site-packages + env['debian'] = any(name.endswith('dist-packages') for name in sys.path) +diff -Nur old/cantera-2.4.0/test_problems/SConscript new/cantera-2.4.0/test_problems/SConscript +--- old/test_problems/SConscript 2018-08-24 16:24:45.000000000 +0300 ++++ new/test_problems/SConscript 2019-07-17 15:41:35.000000000 +0300 +@@ -282,7 +282,7 @@ + CompileAndTest('VPsilane_test', 'VPsilane_test', 'VPsilane_test', 'output_blessed.txt') + + CompileAndTest('clib', 'clib_test', 'clib_test', 'output_blessed.txt', +- extensions=['^clib_test.c'], libs=['cantera_shared']) ++ extensions=['^clib_test.c']) + + # Force explicitly-named tests to run even if SCons thinks they're up to date + for command in COMMAND_LINE_TARGETS: |