1 |
commit: c0a49bf0854adc1729059f952a3f051008080a7e |
2 |
Author: band-a-prend <torokhov-s-a <AT> yandex <DOT> ru> |
3 |
AuthorDate: Fri Jun 21 21:58:53 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 19 16:44:51 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0a49bf0 |
7 |
|
8 |
sci-libs/cantera: 2.4.0-r1. Disable default optimization flag "-O3" |
9 |
|
10 |
By default the optimization flag "-O3" was used with warning "-Wno-inline". |
11 |
The addition of expicit build option optimize_flags="-Wno-inline" |
12 |
now disables default "-O3" optimization flag in favor of options |
13 |
taken from "make.conf". |
14 |
|
15 |
Signed-off-by: Sergey Torokhov <torokhov_s_a <AT> mail.ru> |
16 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
17 |
|
18 |
sci-libs/cantera/cantera-2.4.0-r1.ebuild | 130 +++++++++++++++++++++++++++++++ |
19 |
1 file changed, 130 insertions(+) |
20 |
|
21 |
diff --git a/sci-libs/cantera/cantera-2.4.0-r1.ebuild b/sci-libs/cantera/cantera-2.4.0-r1.ebuild |
22 |
new file mode 100644 |
23 |
index 00000000000..9d31e347b02 |
24 |
--- /dev/null |
25 |
+++ b/sci-libs/cantera/cantera-2.4.0-r1.ebuild |
26 |
@@ -0,0 +1,130 @@ |
27 |
+# Copyright 1999-2019 Gentoo Authors |
28 |
+# Distributed under the terms of the GNU General Public License v2 |
29 |
+ |
30 |
+EAPI=6 |
31 |
+ |
32 |
+PYTHON_COMPAT=( python3_{5,6} ) |
33 |
+ |
34 |
+FORTRAN_NEEDED=fortran |
35 |
+FORTRAN_STANDARD=90 |
36 |
+ |
37 |
+inherit desktop fortran-2 python-single-r1 scons-utils toolchain-funcs |
38 |
+ |
39 |
+DESCRIPTION="Object-oriented tool suite for chemical kinetics, thermodynamics, and transport" |
40 |
+HOMEPAGE="http://www.cantera.org" |
41 |
+SRC_URI="https://github.com/Cantera/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
42 |
+ |
43 |
+LICENSE="BSD" |
44 |
+SLOT="0" |
45 |
+KEYWORDS="~amd64 ~x86" |
46 |
+IUSE="+cti fortran pch +python test" |
47 |
+ |
48 |
+REQUIRED_USE=" |
49 |
+ cti? ( ${PYTHON_REQUIRED_USE} ) |
50 |
+ python? ( cti ) |
51 |
+ ${PYTHON_REQUIRED_USE} |
52 |
+ " |
53 |
+ |
54 |
+RDEPEND=" |
55 |
+ python? ( |
56 |
+ dev-python/numpy[${PYTHON_USEDEP}] |
57 |
+ ) |
58 |
+ sci-libs/sundials:0= |
59 |
+" |
60 |
+ |
61 |
+DEPEND=" |
62 |
+ ${RDEPEND} |
63 |
+ dev-cpp/eigen |
64 |
+ dev-libs/boost |
65 |
+ dev-libs/libfmt |
66 |
+ python? ( |
67 |
+ dev-python/cython[${PYTHON_USEDEP}] |
68 |
+ ) |
69 |
+ test? ( |
70 |
+ >=dev-cpp/gtest-1.8.0 |
71 |
+ ) |
72 |
+" |
73 |
+ |
74 |
+PATCHES=( "${FILESDIR}/${PN}_${PV}_libdirname_variable.patch" ) |
75 |
+ |
76 |
+pkg_setup() { |
77 |
+ fortran-2_pkg_setup |
78 |
+ python-single-r1_pkg_setup |
79 |
+} |
80 |
+ |
81 |
+src_prepare() { |
82 |
+ default |
83 |
+ # patch to work 'scons test' properly in case of set up 'renamed_shared_libraries="no"' option |
84 |
+ sed -i "s/, libs=\['cantera_shared'\]//" "${S}"/test_problems/SConscript || die "failed to modify 'test_problems/SConscript'" |
85 |
+ # patch env to pass CCACHE_DIR variable |
86 |
+ sed -i "s/ENV={'PATH': os.environ\['PATH'\]}/ENV={'PATH': os.environ\['PATH'\], 'CCACHE_DIR': os.environ.get('CCACHE_DIR','')}/" "${S}"/SConstruct || die "failed to modify 'SConstruct'" |
87 |
+} |
88 |
+ |
89 |
+## Full list of configuration options of Cantera is presented here: |
90 |
+## http://cantera.org/docs/sphinx/html/compiling/config-options.html |
91 |
+ |
92 |
+src_configure() { |
93 |
+ scons_vars=( |
94 |
+ CC="$(tc-getCC)" |
95 |
+ CXX="$(tc-getCXX)" |
96 |
+ cc_flags="${CXXFLAGS}" |
97 |
+ cxx_flags="-std=c++11" |
98 |
+ debug="no" |
99 |
+ FORTRAN="$(tc-getFC)" |
100 |
+ FORTRANFLAGS="${CXXFLAGS}" |
101 |
+ optimize_flags="-Wno-inline" |
102 |
+ renamed_shared_libraries="no" |
103 |
+ use_pch=$(usex pch) |
104 |
+## In some cases other order can break the detection of right location of Boost: ## |
105 |
+ system_fmt="y" |
106 |
+ system_sundials="y" |
107 |
+ system_eigen="y" |
108 |
+ env_vars="all" |
109 |
+ extra_inc_dirs="/usr/include/eigen3" |
110 |
+ ) |
111 |
+ use test || scons_vars+=( googletest="none" ) |
112 |
+ |
113 |
+ scons_targets=( |
114 |
+ f90_interface=$(usex fortran y n) |
115 |
+ python2_package="none" |
116 |
+ ) |
117 |
+ |
118 |
+ if use cti ; then |
119 |
+ local scons_python=$(usex python full minimal) |
120 |
+ scons_targets+=( python3_package="${scons_python}" python3_cmd="${EPYTHON}" ) |
121 |
+ else |
122 |
+ scons_targets+=( python3_package="none" ) |
123 |
+ fi |
124 |
+} |
125 |
+ |
126 |
+src_compile() { |
127 |
+ escons build "${scons_vars[@]}" "${scons_targets[@]}" prefix="/usr" |
128 |
+} |
129 |
+ |
130 |
+src_test() { |
131 |
+ escons test |
132 |
+} |
133 |
+ |
134 |
+src_install() { |
135 |
+ escons install stage_dir="${D%/}" libdirname="$(get_libdir)" |
136 |
+ if ! use cti ; then |
137 |
+ rm -r "${D%/}/usr/share/man" || die "Can't remove man files." |
138 |
+ else |
139 |
+ # Run the byte-compile of modules |
140 |
+ python_optimize "${D%/}/$(python_get_sitedir)/${PN}" |
141 |
+ fi |
142 |
+} |
143 |
+ |
144 |
+pkg_postinst() { |
145 |
+ if use cti && ! use python ; then |
146 |
+ elog "Cantera was build without 'python' use-flag therefore the CTI tool 'ck2cti'" |
147 |
+ elog "will convert Chemkin files to Cantera format without verification of kinetic mechanism." |
148 |
+ fi |
149 |
+ |
150 |
+ local post_msg=$(usex fortran "and Fortran " "") |
151 |
+ elog "C++ ${post_msg}samples are installed to '/usr/share/${PN}/samples/' directory." |
152 |
+ |
153 |
+ if use python ; then |
154 |
+ elog "Python examples are installed to '$(python_get_sitedir)/${PN}/examples/' directories." |
155 |
+ fi |
156 |
+} |