From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1218043-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 0231B138359
	for <garchives@archives.gentoo.org>; Wed, 28 Oct 2020 01:42:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 3B368E0863;
	Wed, 28 Oct 2020 01:42:03 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 1E1BBE0863
	for <gentoo-commits@lists.gentoo.org>; Wed, 28 Oct 2020 01:42:03 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id A3751340D9E
	for <gentoo-commits@lists.gentoo.org>; Wed, 28 Oct 2020 01:42:01 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 144642DF
	for <gentoo-commits@lists.gentoo.org>; Wed, 28 Oct 2020 01:42:00 +0000 (UTC)
From: "Georgy Yakovlev" <gyakovlev@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" <gyakovlev@gentoo.org>
Message-ID: <1603849181.b4fb6fc0f73b4b4145236b56355c35070c3b529a.gyakovlev@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/files/, dev-lang/rust/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch dev-lang/rust/rust-1.47.0-r1.ebuild
X-VCS-Directories: dev-lang/rust/files/ dev-lang/rust/
X-VCS-Committer: gyakovlev
X-VCS-Committer-Name: Georgy Yakovlev
X-VCS-Revision: b4fb6fc0f73b4b4145236b56355c35070c3b529a
X-VCS-Branch: master
Date: Wed, 28 Oct 2020 01:42:00 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: f1c9cf08-e81a-445f-a942-fc1f8ea571ae
X-Archives-Hash: fb7a26a0a9e1e5ccbab5bafd01fb16bf

commit:     b4fb6fc0f73b4b4145236b56355c35070c3b529a
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 28 01:39:19 2020 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Wed Oct 28 01:39:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4fb6fc0

dev-lang/rust: fix build with tensorflow installed

Closes: https://bugs.gentoo.org/750875
Package-Manager: Portage-3.0.8, Repoman-3.0.2
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 .../rust/files/1.47.0-llvm-tensorflow-fix.patch    | 55 ++++++++++++++++++++++
 dev-lang/rust/rust-1.47.0-r1.ebuild                |  1 +
 2 files changed, 56 insertions(+)

diff --git a/dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch b/dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch
new file mode 100644
index 00000000000..5b12c15ff40
--- /dev/null
+++ b/dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch
@@ -0,0 +1,55 @@
+From 8dcb88f7705fb3927938dd9bd103efcabafcefb0 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+Date: Tue, 27 Oct 2020 18:20:56 -0700
+Subject: [PATCH] backport D88371, guard `find_library(tensorflow_c_api ...)`
+
+Differential Revision: https://reviews.llvm.org/D88371
+Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
+---
+ src/llvm-project/llvm/CMakeLists.txt | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/src/llvm-project/llvm/CMakeLists.txt b/src/llvm-project/llvm/CMakeLists.txt
+index 1f137f0..4112def 100644
+--- a/src/llvm-project/llvm/CMakeLists.txt
++++ b/src/llvm-project/llvm/CMakeLists.txt
+@@ -832,6 +832,11 @@ configure_file(
+   ${LLVM_INCLUDE_DIR}/llvm/Config/Targets.def
+   )
+ 
++# They are not referenced. See set_output_directory().
++set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
++set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
++set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
++
+ # For up-to-date instructions for installing the Tensorflow dependency, refer to
+ # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
+ # In this case, the latest C API library is available for download from
+@@ -840,9 +845,9 @@ configure_file(
+ # LLVM_HAVE_TF_API, through llvm-config.h, so that a user of the LLVM library may
+ # also leverage the dependency.
+ set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
+-find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib)
+ 
+-if (tensorflow_c_api)
++if (TENSORFLOW_C_LIB_PATH)
++  find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
+   set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
+   include_directories(${TENSORFLOW_C_LIB_PATH}/include)
+ endif()
+@@ -877,12 +882,6 @@ add_custom_target(srpm
+   COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR}' ${LLVM_SRPM_BINARY_SPECFILE})
+ set_target_properties(srpm PROPERTIES FOLDER "Misc")
+ 
+-
+-# They are not referenced. See set_output_directory().
+-set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
+-set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
+-set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
+-
+ if(APPLE AND DARWIN_LTO_LIBRARY)
+   set(CMAKE_EXE_LINKER_FLAGS
+     "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
+-- 
+2.26.2
+

diff --git a/dev-lang/rust/rust-1.47.0-r1.ebuild b/dev-lang/rust/rust-1.47.0-r1.ebuild
index cd258a9cb85..371a9cd72b5 100644
--- a/dev-lang/rust/rust-1.47.0-r1.ebuild
+++ b/dev-lang/rust/rust-1.47.0-r1.ebuild
@@ -122,6 +122,7 @@ PATCHES=(
 	"${FILESDIR}"/1.47.0-libressl.patch
 	"${FILESDIR}"/1.46.0-don-t-create-prefix-at-time-of-check.patch
 	"${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch
+	"${FILESDIR}"/1.47.0-llvm-tensorflow-fix.patch
 	"${FILESDIR}"/gentoo-musl-target-specs.patch
 )