diff options
author | Sam James <sam@gentoo.org> | 2022-05-05 00:55:28 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-05-05 01:11:09 +0100 |
commit | 3f0ed6797219492f58a2a4c3183087ad1c53337d (patch) | |
tree | 1194fd2ce506e33aba8df1a45e574376bb3a07ce /sci-libs/ceres-solver/ceres-solver-2.1.0.ebuild | |
parent | media-sound/guitarix: evading git protocol in the live ebuild (diff) | |
download | gentoo-3f0ed6797219492f58a2a4c3183087ad1c53337d.tar.gz gentoo-3f0ed6797219492f58a2a4c3183087ad1c53337d.tar.bz2 gentoo-3f0ed6797219492f58a2a4c3183087ad1c53337d.zip |
sci-libs/ceres-solver: add 2.1.0
Closes: https://bugs.gentoo.org/842636
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sci-libs/ceres-solver/ceres-solver-2.1.0.ebuild')
-rw-r--r-- | sci-libs/ceres-solver/ceres-solver-2.1.0.ebuild | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/sci-libs/ceres-solver/ceres-solver-2.1.0.ebuild b/sci-libs/ceres-solver/ceres-solver-2.1.0.ebuild new file mode 100644 index 000000000000..92fefb044a1a --- /dev/null +++ b/sci-libs/ceres-solver/ceres-solver-2.1.0.ebuild @@ -0,0 +1,106 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) +DOCS_BUILDER="sphinx" +DOCS_DEPEND="dev-python/sphinx_rtd_theme" +DOCS_DIR="docs/source" +inherit cmake-multilib python-any-r1 docs toolchain-funcs + +DESCRIPTION="Nonlinear least-squares minimizer" +HOMEPAGE="http://ceres-solver.org/" +SRC_URI="http://ceres-solver.org/${P}.tar.gz" + +LICENSE="sparse? ( BSD ) !sparse? ( LGPL-2.1 ) cxsparse? ( BSD )" +SLOT="0/1" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="cxsparse examples gflags lapack openmp +schur sparse test" + +REQUIRED_USE="test? ( gflags ) sparse? ( lapack ) abi_x86_32? ( !sparse !lapack )" +RESTRICT="!test? ( test )" + +BDEPEND="${PYTHON_DEPS} + >=dev-cpp/eigen-3.3.4:3 + lapack? ( virtual/pkgconfig ) + doc? ( dev-libs/mathjax ) +" +RDEPEND=" + dev-cpp/glog[gflags?,${MULTILIB_USEDEP}] + cxsparse? ( sci-libs/cxsparse ) + lapack? ( virtual/lapack ) + sparse? ( + sci-libs/amd + sci-libs/camd + sci-libs/ccolamd + sci-libs/cholmod[metis(+)] + sci-libs/colamd + sci-libs/spqr + ) +" +DEPEND="${RDEPEND}" + +DOCS=( README.md VERSION ) + +PATCHES=( + "${FILESDIR}/${PN}-2.0.0-system-mathjax.patch" +) + +pkg_pretend() { + if [[ ${MERGE_TYPE} != binary ]] && use openmp; then + if [[ $(tc-getCXX) == *g++* ]] && ! tc-has-openmp; then + ewarn "OpenMP is not available in your current selected gcc" + die "need openmp capable gcc" + fi + fi +} + +pkg_setup() { + use doc && python-any-r1_pkg_setup +} + +src_prepare() { + cmake_src_prepare + + # search paths work for prefix + sed -e "s:/usr:${EPREFIX}/usr:g" \ + -i cmake/*.cmake || die + + # remove Werror + sed -e 's/-Werror=(all|extra)//g' \ + -i CMakeLists.txt || die +} + +src_configure() { + # CUSTOM_BLAS=OFF EIGENSPARSE=OFF MINIGLOG=OFF CXX11=OFF + local mycmakeargs=( + -DBUILD_BENCHMARKS=OFF + -DBUILD_EXAMPLES=$(usex examples) + -DBUILD_TESTING=$(usex test) + -DBUILD_DOCUMENTATION=$(usex doc) + -DGFLAGS=$(usex gflags) + -DLAPACK=$(usex lapack) + -DSCHUR_SPECIALIZATIONS=$(usex schur) + -DCXSPARSE=$(usex cxsparse) + -DSUITESPARSE=$(usex sparse) + -DEigen3_DIR=/usr/$(get_libdir)/cmake/eigen3 + -DCERES_THREADING_MODEL=$(usex openmp OPENMP CXX_THREADS) + ) + + use doc && mycmakeargs+=( + -DCERES_DOCS_INSTALL_DIR="${EPREFIX}"/usr/share/doc/${PF} + ) + use sparse || use cxsparse || mycmakeargs+=( -DEIGENSPARSE=ON ) + + cmake-multilib_src_configure +} + +src_install() { + cmake-multilib_src_install + + if use examples; then + docompress -x /usr/share/doc/${PF}/examples + dodoc -r examples data + fi +} |