Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/coinor-cppad/files/, sci-libs/coinor-cppad/
Date: Sat, 27 Feb 2021 03:08:25
Message-Id: 1614395202.39897f1a304088d98599fd6675b0580ccb698ac6.sam@gentoo
1 commit: 39897f1a304088d98599fd6675b0580ccb698ac6
2 Author: Ionen Wolkens <sudinave <AT> gmail <DOT> com>
3 AuthorDate: Fri Feb 26 19:13:36 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 27 03:06:42 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39897f1a
7
8 sci-libs/coinor-cppad: bump to 20210000.5, ported to EAPI 7 + cmake
9
10 Most old issues should be resolved or need re-test as this
11 is completely different now.
12
13 wrt bug #741428, tests currently pass using clang++ and default USE.
14
15 Closes: https://bugs.gentoo.org/603226
16 Closes: https://bugs.gentoo.org/725470
17 Closes: https://bugs.gentoo.org/741428
18 Package-Manager: Portage-3.0.15, Repoman-3.0.2
19 Signed-off-by: Ionen Wolkens <sudinave <AT> gmail.com>
20 Signed-off-by: Sam James <sam <AT> gentoo.org>
21
22 sci-libs/coinor-cppad/Manifest | 1 +
23 .../coinor-cppad/coinor-cppad-20210000.5.ebuild | 73 ++++++++++++++++++++++
24 .../files/coinor-cppad-20210000.5-pkgconfig.patch | 26 ++++++++
25 sci-libs/coinor-cppad/metadata.xml | 5 ++
26 4 files changed, 105 insertions(+)
27
28 diff --git a/sci-libs/coinor-cppad/Manifest b/sci-libs/coinor-cppad/Manifest
29 index 674756df526..16ecbbb85d3 100644
30 --- a/sci-libs/coinor-cppad/Manifest
31 +++ b/sci-libs/coinor-cppad/Manifest
32 @@ -1 +1,2 @@
33 +DIST coinor-cppad-20210000.5.tar.gz 1663397 BLAKE2B 3ce4f5733641fac16ac00b6e49cb74e2237502eac32f592190491ddd5dcb8a41f340c1eed8529dbdecb343f7a791d4fc5ddc1e21ce9f9706f28608ac3a5e965a SHA512 40cbe8dc32af9bb3b92cdd4c81e6f75424ece701df9251d4c63652998ca4cb8d50057e190a16e51333d168299f33ff2353074fa7f24f2cec29f68db53f6ae17c
34 DIST cppad-20140519.gpl.tgz 2208236 BLAKE2B 5d53891ef3b458c3914f5d59f6656290be2811fbc84ca3f9bd253ce4620b1a4b00397e1beed694cdc5284a1f74441b68520b861c90d158c4eee11d1f8927b362 SHA512 8f47e545bc76f66edccb9ea083ddebcb5852fa1807d727b6e1f445ca74731e74f7614a1d33b48c6eafbc5129b319e513594b415ee838bdc634f9c00a6d9a22af
35
36 diff --git a/sci-libs/coinor-cppad/coinor-cppad-20210000.5.ebuild b/sci-libs/coinor-cppad/coinor-cppad-20210000.5.ebuild
37 new file mode 100644
38 index 00000000000..b0f442dd2f2
39 --- /dev/null
40 +++ b/sci-libs/coinor-cppad/coinor-cppad-20210000.5.ebuild
41 @@ -0,0 +1,73 @@
42 +# Copyright 1999-2021 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=7
46 +
47 +CMAKE_MAKEFILE_GENERATOR="emake" # needed for tests
48 +inherit cmake
49 +
50 +DESCRIPTION="COIN-OR C++ Algorithmic Differentiation"
51 +HOMEPAGE="https://projects.coin-or.org/CppAD/"
52 +SRC_URI="https://github.com/coin-or/CppAD/archive/${PV}.tar.gz -> ${P}.tar.gz"
53 +S="${WORKDIR}/CppAD-${PV}"
54 +
55 +LICENSE="EPL-2.0"
56 +SLOT="0/${PV}" # soname is bumped every versions
57 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
58 +IUSE="adolc doc eigen ipopt"
59 +
60 +# adolc currently can't build tests and ipopt fails them.
61 +RESTRICT="adolc? ( test ) ipopt? ( test )"
62 +
63 +# No need for RDEPEND.
64 +DEPEND="
65 + dev-libs/boost[threads]
66 + adolc? ( sci-libs/adolc )
67 + eigen? ( dev-cpp/eigen )
68 + ipopt? ( sci-libs/ipopt )"
69 +BDEPEND="
70 + virtual/pkgconfig
71 + doc? (
72 + app-doc/doxygen[dot]
73 + virtual/latex-base
74 + )"
75 +
76 +PATCHES=( "${FILESDIR}"/${P}-pkgconfig.patch )
77 +
78 +src_prepare() {
79 + cmake_src_prepare
80 + # Gentoo uses coin/ rather than coin-or/ for includes.
81 + sed -i 's/<coin-or/<coin/' \
82 + cppad_ipopt/src/cppad_ipopt_nlp.hpp \
83 + include/cppad/ipopt/solve_callback.hpp || die
84 +}
85 +
86 +src_configure() {
87 + local mycmakeargs=(
88 + -Dcmake_install_libdirs=$(get_libdir)
89 + -Dinclude_adolc=$(usex adolc)
90 + -Dinclude_cppadcg=no
91 + -Dinclude_eigen=$(usex eigen)
92 + -Dinclude_ipopt=$(usex ipopt)
93 + )
94 + cmake_src_configure
95 +}
96 +
97 +src_compile() {
98 + cmake_src_compile
99 + if use doc; then
100 + bin/doxyfile.sh ${PV} dox.log doc && doxygen doxyfile || die
101 + fi
102 +}
103 +
104 +src_test() {
105 + cmake_build check
106 +}
107 +
108 +src_install() {
109 + cmake_src_install
110 + use doc && dodoc -r doc/html
111 +
112 + # Remove superfluous .pc file.
113 + rm -r "${ED}"/usr/share/pkgconfig || die
114 +}
115
116 diff --git a/sci-libs/coinor-cppad/files/coinor-cppad-20210000.5-pkgconfig.patch b/sci-libs/coinor-cppad/files/coinor-cppad-20210000.5-pkgconfig.patch
117 new file mode 100644
118 index 00000000000..0483eea52ec
119 --- /dev/null
120 +++ b/sci-libs/coinor-cppad/files/coinor-cppad-20210000.5-pkgconfig.patch
121 @@ -0,0 +1,26 @@
122 +Fix pkg-config file generation, backported from upstream commit:
123 +https://github.com/coin-or/CppAD/commit/6d10b8d
124 +with an additional fix to not have -l-lcppad_lib
125 +--- a/pkgconfig/CMakeLists.txt
126 ++++ b/pkgconfig/CMakeLists.txt
127 +@@ -124,3 +124,3 @@
128 + # cppad_includedir
129 +-LIST(GET cmake_install_libdirs 0 cppad_includedir)
130 ++LIST(GET cmake_install_includedirs 0 cppad_includedir)
131 + #
132 +@@ -161,2 +161,3 @@
133 + ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc
134 ++ @ONLY
135 + )
136 +--- a/pkgconfig/cppad.pc.in
137 ++++ b/pkgconfig/cppad.pc.in
138 +@@ -17,3 +17,3 @@
139 + prefix=@cppad_prefix@
140 +-exec_prefix=$(prefix)
141 ++exec_prefix=${prefix}
142 + includedir=${prefix}/@cppad_includedir@
143 +@@ -30,3 +30,3 @@
144 + Cflags: -I${includedir}
145 +-Libs: -L{libdir} -l@cppad_lib_list@
146 ++Libs: -L${libdir} @cppad_lib_list@
147 + Requires:
148
149 diff --git a/sci-libs/coinor-cppad/metadata.xml b/sci-libs/coinor-cppad/metadata.xml
150 index ca530df1478..be6da625a6d 100644
151 --- a/sci-libs/coinor-cppad/metadata.xml
152 +++ b/sci-libs/coinor-cppad/metadata.xml
153 @@ -14,6 +14,11 @@
154 corresponding derivative values (of arbitrary order using either
155 forward or reverse mode).
156 </longdescription>
157 + <use>
158 + <flag name="adolc">Add support for ADOL-C (<pkg>sci-libs/adolc</pkg>)</flag>
159 + <flag name="eigen">Add support for Eigen (<pkg>dev-cpp/eigen</pkg>)</flag>
160 + <flag name="ipopt">Add support for IPOPT (<pkg>sci-libs/ipopt</pkg>)</flag>
161 + </use>
162 <upstream>
163 <remote-id type="github">coin-or/CppAD</remote-id>
164 </upstream>