diff options
Diffstat (limited to 'sci-libs/coinor-cppad/coinor-cppad-20210000.5-r1.ebuild')
-rw-r--r-- | sci-libs/coinor-cppad/coinor-cppad-20210000.5-r1.ebuild | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/sci-libs/coinor-cppad/coinor-cppad-20210000.5-r1.ebuild b/sci-libs/coinor-cppad/coinor-cppad-20210000.5-r1.ebuild new file mode 100644 index 000000000000..1fcf5fe358b0 --- /dev/null +++ b/sci-libs/coinor-cppad/coinor-cppad-20210000.5-r1.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 +} |