# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{9..12} ) DISTUTILS_SINGLE_IMPL=1 inherit cmake distutils-r1 DESCRIPTION="Google's Operations Research tools" HOMEPAGE="https://developers.google.com/optimization/" if [[ ${PV} == 9999 ]]; then EGIT_REPO_URI="https://github.com/google/${PN}.git" inherit git-r3 else SRC_URI="https://github.com/google/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~arm64 ~x86" fi # BSD for bundled pybind LICENSE="Apache-2.0" SLOT="0" IUSE="+python" REQUIRED_USE="${PYTHON_REQUIRED_USE}" DEPEND="sci-libs/coinor-cbc sci-libs/scipoptsuite $(python_gen_cond_dep ' >=dev-python/absl-py-0.13[${PYTHON_USEDEP}] >=dev-python/contourpy-1.0.1[${PYTHON_USEDEP}] >=dev-python/cycler-0.10[${PYTHON_USEDEP}] >=dev-python/fonttools-4.22.0[${PYTHON_USEDEP}] >=dev-python/kiwisolver-1.0.1[${PYTHON_USEDEP}] dev-python/matplotlib[${PYTHON_USEDEP}] dev-python/mypy-protobuf[${PYTHON_USEDEP}] >=dev-python/numpy-1.21.0[${PYTHON_USEDEP}] >=dev-python/packaging-20.0[${PYTHON_USEDEP}] dev-python/pandas[${PYTHON_USEDEP}] >=dev-python/pillow-6.2.0[${PYTHON_USEDEP}] >=dev-python/protobuf-python-3.19.4[${PYTHON_USEDEP}] dev-python/pybind11[${PYTHON_USEDEP}] >=dev-python/pyparsing-2.2.1[${PYTHON_USEDEP}] >=dev-python/python-dateutil-2.8.1[${PYTHON_USEDEP}] >=dev-python/pytz-2020.1[${PYTHON_USEDEP}] >=dev-python/six-1.5[${PYTHON_USEDEP}] ') ${PYTHON_DEPS}" RDEPEND="" BDEPEND="" src_unpack() { if [[ ${PV} == 9999 ]]; then git-r3_src_unpack else default_src_unpack fi } src_prepare() { cmake_src_prepare sed -i -e 's@ABSL_MUST_USE_RESULT @@' \ "${S}"/ortools/linear_solver/linear_solver.h \ "${S}"/ortools/constraint_solver/constraint_solver.h \ || die "sed failed" } src_configure() { local mycmakeargs=( -DBUILD_DEPS=OFF -DCMAKE_SKIP_RPATH="ON" ) use python && mycmakeargs+=( -DBUILD_PYTHON=ON -DBUILD_pybind11=OFF -DPython3_EXECUTABLE="${PYTHON}" -DFETCH_PYTHON_DEPS=OFF -DBUILD_VENV=OFF ) cmake_src_configure } src_compile() { cmake_src_compile } src_install() { cmake_src_install python_optimize }