commit:     0841eddc7d6269a43b22d0fa963659c19dab030b
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 10 18:00:25 2024 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Tue Dec 10 18:01:01 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0841eddc

sci-libs/caffe2: fix when PORTAGE_TMPDIR is not the default value

Closes: https://bugs.gentoo.org/946201
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 sci-libs/caffe2/caffe2-2.5.1-r5.ebuild                            | 4 +---
 sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch | 8 ++++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/sci-libs/caffe2/caffe2-2.5.1-r5.ebuild 
b/sci-libs/caffe2/caffe2-2.5.1-r5.ebuild
index a6ed84f182da..8f23871b42b1 100644
--- a/sci-libs/caffe2/caffe2-2.5.1-r5.ebuild
+++ b/sci-libs/caffe2/caffe2-2.5.1-r5.ebuild
@@ -119,6 +119,7 @@ PATCHES=(
        "${FILESDIR}"/${P}-gentoo.patch
        "${FILESDIR}"/${PN}-2.4.0-cpp-httplib.patch
        "${FILESDIR}"/${P}-glog-0.6.0.patch
+       "${FILESDIR}"/${P}-newfix-functorch-install.patch
 )
 
 src_prepare() {
@@ -295,9 +296,6 @@ src_install() {
        # Used by pytorch ebuild
        insinto "/var/lib/${PN}"
        doins "${BUILD_DIR}"/CMakeCache.txt
-       mv "${D}${S}"/functorch/functorch.so \
-               "${D}"/var/lib/${PN}/functorch.so || die
-       rm -r "${D}"/var/tmp || die
        dostrip -x /var/lib/${PN}/functorch.so
 
        rm -rf python

diff --git a/sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch 
b/sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch
new file mode 100644
index 000000000000..499a3c74c87f
--- /dev/null
+++ b/sci-libs/caffe2/files/caffe2-2.5.1-newfix-functorch-install.patch
@@ -0,0 +1,8 @@
+--- a/functorch/CMakeLists.txt 2024-11-10 11:18:29.151992840 +0100
++++ b/functorch/CMakeLists.txt 2024-11-10 11:20:19.642389982 +0100
+@@ -42,4 +42,4 @@
+ if(NOT ${TORCH_PYTHON_LINK_FLAGS} STREQUAL "")
+   set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS 
${TORCH_PYTHON_LINK_FLAGS})
+ endif()
+-install(TARGETS ${PROJECT_NAME} DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
++install(TARGETS ${PROJECT_NAME} DESTINATION "/var/lib/caffe2/")

Reply via email to