commit:     1c845e66f1f35f54b72789fa8e787c59ccbed19f
Author:     Mark Wright <gienah <AT> gentoo <DOT> org>
AuthorDate: Wed May  2 04:55:44 2018 +0000
Commit:     Mark Wright <gienah <AT> gentoo <DOT> org>
CommitDate: Wed May  2 04:55:44 2018 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=1c845e66

sci-libs/tensorflow: Use CPPFLAGS, CXXFLAGS, LDFLAGS.

Setting CPPFLAGS should help #861 sci-libs/tensorflow: respect EPREFIX.

Require [${PYTHON_USEDEP}] on Python deps, which should help the
dev-python/wheel not working in #849 sci-libs/tensorflow: new package,
ebuilds with IUSE="cuda mpi" need improvements.

Package-Manager: Portage-2.3.31, Repoman-2.3.9

 sci-libs/tensorflow/tensorflow-1.8.0.ebuild | 40 ++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 7 deletions(-)

diff --git a/sci-libs/tensorflow/tensorflow-1.8.0.ebuild 
b/sci-libs/tensorflow/tensorflow-1.8.0.ebuild
index 15e09b50b..cfef9ea2a 100644
--- a/sci-libs/tensorflow/tensorflow-1.8.0.ebuild
+++ b/sci-libs/tensorflow/tensorflow-1.8.0.ebuild
@@ -37,13 +37,13 @@ IUSE="cuda cxx mpi"
 #      dev-python/gast
 DEPEND="
        cxx? ( dev-libs/protobuf )
-       dev-python/absl-py
-       dev-python/astor
-       dev-python/numpy
-       dev-python/protobuf-python
-       dev-python/six
-       dev-python/termcolor
-       dev-python/wheel
+       dev-python/absl-py[${PYTHON_USEDEP}]
+       dev-python/astor[${PYTHON_USEDEP}]
+       dev-python/numpy[${PYTHON_USEDEP}]
+       dev-python/protobuf-python[${PYTHON_USEDEP}]
+       dev-python/six[${PYTHON_USEDEP}]
+       dev-python/termcolor[${PYTHON_USEDEP}]
+       dev-python/wheel[${PYTHON_USEDEP}]
        dev-libs/jemalloc
        dev-libs/protobuf-c
        dev-util/bazel
@@ -109,17 +109,43 @@ src_compile() {
        addpredict /proc
 
        local opt=$(usex cuda "--config=cuda" "")
+       local fs=""
+       for i in ${CXXFLAGS}; do
+               [[ -n "${fs}" ]] && fs+=" "
+               fs+="--cxxopt=${i}"
+       done
+       for i in ${CPPFLAGS}; do
+               [[ -n "${fs}" ]] && fs+=" "
+               fs+="--copt=${i}"
+               fs+="--cxxopt=${i}"
+       done
+       for i in ${LDFLAGS}; do
+               [[ -n "${fs}" ]] && fs+=" "
+               fs+="--linkopt=${i}"
+       done
        einfo ">>> Compiling ${PN} C"$(usex cxx " and C++" "")
+       einfo " bazel build \\"
+       einfo "   --config=opt ${opt} \\"
+       einfo "   ${fs} \\"
+       einfo "   //tensorflow:libtensorflow.so \\"
+       einfo "   //tensorflow:libtensorflow_framework.so \\"
+       einfo "   "$(usex cxx "//tensorflow:libtensorflow_cc.so" "")
        bazel build \
                  --config=opt ${opt} \
+                 ${fs} \
                  //tensorflow:libtensorflow.so \
                  //tensorflow:libtensorflow_framework.so \
                  $(usex cxx "//tensorflow:libtensorflow_cc.so" "") || die
 
        python_compile() {
                einfo ">>> Compiling ${PN} ${MULTIBUILD_VARIANT}"
+               einfo " bazel build \\"
+               einfo "   --config=opt ${opt} \\"
+               einfo "   ${fs} \\"
+               einfo "   //tensorflow/tools/pip_package:build_pip_package"
                bazel build \
                          --config=opt ${opt} \
+                         ${fs} \
                          //tensorflow/tools/pip_package:build_pip_package || 
die
                bazel-bin/tensorflow/tools/pip_package/build_pip_package 
tensorflow_pkg || die
                unzip -o -d ${PN}_pkg_${MULTIBUILD_VARIANT} 
${PN}_pkg/${P}-*.whl || die

Reply via email to