commit:     7a72b8eabc3bb168f4c817c301c61d3b8ebb4197
Author:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
AuthorDate: Wed Apr 18 17:15:22 2018 +0000
Commit:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
CommitDate: Wed Apr 18 17:15:22 2018 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=7a72b8ea

sci-libs/tensorflow: try to determine site-packages path properly

This could support multiple python installations, improving further changes from
https://github.com/gentoo/sci/issues/862

However, still untested by me due to sandbox violations, sorry.

Package-Manager: Portage-2.3.28, Repoman-2.3.9

 sci-libs/tensorflow/tensorflow-1.7.0.ebuild | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sci-libs/tensorflow/tensorflow-1.7.0.ebuild 
b/sci-libs/tensorflow/tensorflow-1.7.0.ebuild
index 75f5d499d..758872b99 100644
--- a/sci-libs/tensorflow/tensorflow-1.7.0.ebuild
+++ b/sci-libs/tensorflow/tensorflow-1.7.0.ebuild
@@ -77,9 +77,9 @@ src_compile() {
                # huh, by default tensorflow links static libs? See BUILD file
                # set framework_shared_object=true somehow
                if use cuda; then
-                       opt="--config=cuda"
+                       local opt="--config=cuda"
                else
-                       opt=""
+                       local opt=""
                fi
                bazel build --config=opt ${opt} 
/tensorflow/tools/pip_package:build_pip_package || die
                bazel-bin/tensorflow/tools/pip_package/build_pip_package 
tensorflow_pkg || die
@@ -97,8 +97,14 @@ src_test() {
 
 src_install() {
        python_install() {
-               python_copy_sources tensorflow_pkg/${P}.data/purelib/tensorflow/
-               python_copy_sources tensorflow_pkg/${P}.dist-info
+               # steal site-package path determination from sci-mathematics/z3
+               local PYTHON_SITEDIR
+               python_export PYTHON_SITEDIR
+               cp -av tensorflow_pkg/"${P}".data/purelib/tensorflow/ 
"$PYTHON_SITEDIR" || die
+               cp -av tensorflow_pkg/"${P}".dist-info "$PYTHON_SITEDIR" || die
+               # mkdir -p "${D}/usr/$(get_libdir)/python3.6/site-packages" || 
die
+               # cp -av tensorflow_pkg/"${P}".data/purelib/tensorflow/ 
"${ED}/usr/$(get_libdir)/python3.6/site-packages/" || die
+               # cp -av tensorflow_pkg/"${P}".dist-info 
"${ED}/usr/$(get_libdir)/python3.6/site-packages/" || die
        }
        python_foreach_impl python_install
        einstalldocs

Reply via email to