diff options
author | Ionen Wolkens <sudinave@gmail.com> | 2021-02-26 14:13:36 -0500 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-02-27 03:06:42 +0000 |
commit | 39897f1a304088d98599fd6675b0580ccb698ac6 (patch) | |
tree | 65ed857eb842193bade3fb9d83038ac811cfaca2 /sci-libs/coinor-cppad | |
parent | sci-libs/coinor-cppad: add github remote-id (diff) | |
download | gentoo-39897f1a304088d98599fd6675b0580ccb698ac6.tar.gz gentoo-39897f1a304088d98599fd6675b0580ccb698ac6.tar.bz2 gentoo-39897f1a304088d98599fd6675b0580ccb698ac6.zip |
sci-libs/coinor-cppad: bump to 20210000.5, ported to EAPI 7 + cmake
Most old issues should be resolved or need re-test as this
is completely different now.
wrt bug #741428, tests currently pass using clang++ and default USE.
Closes: https://bugs.gentoo.org/603226
Closes: https://bugs.gentoo.org/725470
Closes: https://bugs.gentoo.org/741428
Package-Manager: Portage-3.0.15, Repoman-3.0.2
Signed-off-by: Ionen Wolkens <sudinave@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-libs/coinor-cppad')
-rw-r--r-- | sci-libs/coinor-cppad/Manifest | 1 | ||||
-rw-r--r-- | sci-libs/coinor-cppad/coinor-cppad-20210000.5.ebuild | 73 | ||||
-rw-r--r-- | sci-libs/coinor-cppad/files/coinor-cppad-20210000.5-pkgconfig.patch | 26 | ||||
-rw-r--r-- | sci-libs/coinor-cppad/metadata.xml | 5 |
4 files changed, 105 insertions, 0 deletions
diff --git a/sci-libs/coinor-cppad/Manifest b/sci-libs/coinor-cppad/Manifest index 674756df5262..16ecbbb85d38 100644 --- a/sci-libs/coinor-cppad/Manifest +++ b/sci-libs/coinor-cppad/Manifest @@ -1 +1,2 @@ +DIST coinor-cppad-20210000.5.tar.gz 1663397 BLAKE2B 3ce4f5733641fac16ac00b6e49cb74e2237502eac32f592190491ddd5dcb8a41f340c1eed8529dbdecb343f7a791d4fc5ddc1e21ce9f9706f28608ac3a5e965a SHA512 40cbe8dc32af9bb3b92cdd4c81e6f75424ece701df9251d4c63652998ca4cb8d50057e190a16e51333d168299f33ff2353074fa7f24f2cec29f68db53f6ae17c DIST cppad-20140519.gpl.tgz 2208236 BLAKE2B 5d53891ef3b458c3914f5d59f6656290be2811fbc84ca3f9bd253ce4620b1a4b00397e1beed694cdc5284a1f74441b68520b861c90d158c4eee11d1f8927b362 SHA512 8f47e545bc76f66edccb9ea083ddebcb5852fa1807d727b6e1f445ca74731e74f7614a1d33b48c6eafbc5129b319e513594b415ee838bdc634f9c00a6d9a22af diff --git a/sci-libs/coinor-cppad/coinor-cppad-20210000.5.ebuild b/sci-libs/coinor-cppad/coinor-cppad-20210000.5.ebuild new file mode 100644 index 000000000000..b0f442dd2f2c --- /dev/null +++ b/sci-libs/coinor-cppad/coinor-cppad-20210000.5.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +CMAKE_MAKEFILE_GENERATOR="emake" # needed for tests +inherit cmake + +DESCRIPTION="COIN-OR C++ Algorithmic Differentiation" +HOMEPAGE="https://projects.coin-or.org/CppAD/" +SRC_URI="https://github.com/coin-or/CppAD/archive/${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/CppAD-${PV}" + +LICENSE="EPL-2.0" +SLOT="0/${PV}" # soname is bumped every versions +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="adolc doc eigen ipopt" + +# adolc currently can't build tests and ipopt fails them. +RESTRICT="adolc? ( test ) ipopt? ( test )" + +# No need for RDEPEND. +DEPEND=" + dev-libs/boost[threads] + adolc? ( sci-libs/adolc ) + eigen? ( dev-cpp/eigen ) + ipopt? ( sci-libs/ipopt )" +BDEPEND=" + virtual/pkgconfig + doc? ( + app-doc/doxygen[dot] + virtual/latex-base + )" + +PATCHES=( "${FILESDIR}"/${P}-pkgconfig.patch ) + +src_prepare() { + cmake_src_prepare + # Gentoo uses coin/ rather than coin-or/ for includes. + sed -i 's/<coin-or/<coin/' \ + cppad_ipopt/src/cppad_ipopt_nlp.hpp \ + include/cppad/ipopt/solve_callback.hpp || die +} + +src_configure() { + local mycmakeargs=( + -Dcmake_install_libdirs=$(get_libdir) + -Dinclude_adolc=$(usex adolc) + -Dinclude_cppadcg=no + -Dinclude_eigen=$(usex eigen) + -Dinclude_ipopt=$(usex ipopt) + ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile + if use doc; then + bin/doxyfile.sh ${PV} dox.log doc && doxygen doxyfile || die + fi +} + +src_test() { + cmake_build check +} + +src_install() { + cmake_src_install + use doc && dodoc -r doc/html + + # Remove superfluous .pc file. + rm -r "${ED}"/usr/share/pkgconfig || die +} 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 new file mode 100644 index 000000000000..0483eea52ec4 --- /dev/null +++ b/sci-libs/coinor-cppad/files/coinor-cppad-20210000.5-pkgconfig.patch @@ -0,0 +1,26 @@ +Fix pkg-config file generation, backported from upstream commit: +https://github.com/coin-or/CppAD/commit/6d10b8d +with an additional fix to not have -l-lcppad_lib +--- a/pkgconfig/CMakeLists.txt ++++ b/pkgconfig/CMakeLists.txt +@@ -124,3 +124,3 @@ + # cppad_includedir +-LIST(GET cmake_install_libdirs 0 cppad_includedir) ++LIST(GET cmake_install_includedirs 0 cppad_includedir) + # +@@ -161,2 +161,3 @@ + ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc ++ @ONLY + ) +--- a/pkgconfig/cppad.pc.in ++++ b/pkgconfig/cppad.pc.in +@@ -17,3 +17,3 @@ + prefix=@cppad_prefix@ +-exec_prefix=$(prefix) ++exec_prefix=${prefix} + includedir=${prefix}/@cppad_includedir@ +@@ -30,3 +30,3 @@ + Cflags: -I${includedir} +-Libs: -L{libdir} -l@cppad_lib_list@ ++Libs: -L${libdir} @cppad_lib_list@ + Requires: diff --git a/sci-libs/coinor-cppad/metadata.xml b/sci-libs/coinor-cppad/metadata.xml index ca530df14784..be6da625a6d1 100644 --- a/sci-libs/coinor-cppad/metadata.xml +++ b/sci-libs/coinor-cppad/metadata.xml @@ -14,6 +14,11 @@ corresponding derivative values (of arbitrary order using either forward or reverse mode). </longdescription> + <use> + <flag name="adolc">Add support for ADOL-C (<pkg>sci-libs/adolc</pkg>)</flag> + <flag name="eigen">Add support for Eigen (<pkg>dev-cpp/eigen</pkg>)</flag> + <flag name="ipopt">Add support for IPOPT (<pkg>sci-libs/ipopt</pkg>)</flag> + </use> <upstream> <remote-id type="github">coin-or/CppAD</remote-id> </upstream> |