summaryrefslogtreecommitdiff
path: root/sci-libs/caffe2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-09 15:43:36 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-09 15:43:36 +0100
commit2719f73b6813d11d13a9650cdd2ab8ec6e69385d (patch)
tree8c816148bcbd22757d892089c989ae614eae4f5a /sci-libs/caffe2
parent0f558761aa2dee1017b4751e4017205e015a9560 (diff)
gentoo resync : 09.07.2022
Diffstat (limited to 'sci-libs/caffe2')
-rw-r--r--sci-libs/caffe2/Manifest9
-rw-r--r--sci-libs/caffe2/caffe2-1.11.0-r2.ebuild160
-rw-r--r--sci-libs/caffe2/caffe2-1.11.0.ebuild99
-rw-r--r--sci-libs/caffe2/caffe2-1.12.0.ebuild159
-rw-r--r--sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch61
-rw-r--r--sci-libs/caffe2/files/caffe2-1.12.0-install-dirs.patch147
-rw-r--r--sci-libs/caffe2/metadata.xml15
7 files changed, 537 insertions, 113 deletions
diff --git a/sci-libs/caffe2/Manifest b/sci-libs/caffe2/Manifest
index 1953d56b4a0c..93edbe90c1e1 100644
--- a/sci-libs/caffe2/Manifest
+++ b/sci-libs/caffe2/Manifest
@@ -1,4 +1,7 @@
-AUX caffe2-1.11.0-gentoo.patch 3659 BLAKE2B 3f65ac30ed6ebb4f45ec4abbf0368e5033e2b6bf1ff3bf5a13dfec5d28c803c52053913cfbf1f3576f6b4ac8ff324d79852eb13a2c53ca5ea40915f79edeff2b SHA512 79e82b2dbc4113bc734d6c317e8668d551e8815b0cac41ac1181bcc3e7d285e575539de9ceafaa400c72160a7b1205f3a6975c61ac801e09e4b6dc29a5a1d6ce
+AUX caffe2-1.11.0-gentoo.patch 4842 BLAKE2B aab88c5abb64aad74d5c6119dbf6a1e72c3221d9b05e6b8e164f816c2798590f001b6cb3155b5e3bccc03a6a68c4ec9be0dd235de08127959b9adbbc7590a1b5 SHA512 b9498623aead8d5a3096e42adf896f0533903544cde4a1bb9fbb41c83a7921ff25c6c7ef458a280a506bc1555c0519b530a844cd4e537dcf778a2fe50bff50e6
+AUX caffe2-1.12.0-install-dirs.patch 7214 BLAKE2B 16571277e481d71ed63e71793b0aa3179de1ab9fe86483f5af3f6b13cb1eef188925b92579a84989429315edffc9189b25603fb478e505b76bf2923f7aa00566 SHA512 3c247897d0c2471d7c79b0ba05a8786807ff466f3e9c3388175df29c49b5498b0a0e6f3aefea68a8dd36b3fdec3e561799f5d664f8125b6846d00e5f05ced16d
DIST pytorch-1.11.0.tar.gz 20719323 BLAKE2B 24e7aaa2c26821d36f8092542de9d8d5ac85a619fb9fffb5131987958842afb1cad395780662d15f3411a7cc6ff83a445871960eca1e469fcbf0b9895d83d6e0 SHA512 2342eb7a1a241f5855a7cf12e11f62bc4baaa78d1d0864e53bfc946e783eb4addd05ca154a814d2376cd602098b5547e61c158d6eddb7cad5a9f3b0c1357adca
-EBUILD caffe2-1.11.0.ebuild 1988 BLAKE2B f671b7eb952e7f890370f810396afba225e08e358cfde43c728f1ee348eb9b8dbbc35f8be7bd2281307ad9fd31e5f914b72b9410340e5c286f2349ba2c5ae0fa SHA512 6adaf278512440ea17e6f31eec7b9f368168ef5f277a4c17c429d5cf790a859ef7fe79bd9b6ec4895158b88014b3450a278edd46e6c9c641cad67b51a33e3c92
-MISC metadata.xml 328 BLAKE2B f49c6d62ac88dfffe497ed05b1f727941a94acb87a809611dda8aedbd87508fdfdf94ec0e025cac2a649b0881b600236289943b4be0f6ca44fc105b6d8fbe97c SHA512 16c29d2c1177a89026235191ea3e33870c2e6b63f029b7febd4dbd2e99f598fab4b4fd2fa7a801ffd88393663a00752300e6e2cc847a83690b715bcc481d9dc2
+DIST pytorch-1.12.0.tar.gz 106286765 BLAKE2B ff9bafedb35f859f7dccb9b606299cf9c345bdaa0deb87ecfe0c0c30c3c828414d989e1d9a243d9b7cd3f376d56a2f81c241ca2e3c9a8a2b30cddcdeddd3a5c7 SHA512 c9c748a2e0047daaaf199a1ba3198d2d1aee47f664170a9b34ccacd3deeb95f2070e4035eeb900012ef48dc62cf6fb6806f1a1dfe22de8c94892963076e593b7
+EBUILD caffe2-1.11.0-r2.ebuild 4129 BLAKE2B c6c24a81a6ac13e4d0b3601bcdb15656ca4f522fedb9f2c04d2e00fc0639043dc84c7a60a336bf3929e75fb2844e0a6fe632e67d70507ac622b32381b3b3a5dc SHA512 3fa1271831a3d8207e2bb2c1bea79bd16a5590981c0e9d81cee4ce8cb09dbe7bbdf21cc3b88030a04df3025a7de5b6413af81043b888c8b2511d396b0f484e7d
+EBUILD caffe2-1.12.0.ebuild 4101 BLAKE2B 0d27cdfc39d70d1fca4a9d0be4c1e06ba3dda7380d68cd1a7bdde264c374f649b6d912644d24f4b4fa0ca8f587ebb204aadcfa3e4b2dac5e3c6999327121f784 SHA512 76c001f31203f927dcb2282134baa29ddcd51e583a8e2ddc892023fb781c7ad509088d737c99eacfc6837f1484e602b9703b29f4f3a6b5391ec0b969330b268f
+MISC metadata.xml 961 BLAKE2B 7e0924bce6c952cf8b5e997a50e11aad18d572060087ab877d9600399712a6e46f7bee9938aef6b7af142de21046c1cbe541302a68a20072d1040e7b084b202c SHA512 9ff387a4d11eb83799665e38690f0c668ea6147ab92cc8fd68d4fb60590e51863d4530b885f71bd660429c6d38e573a2a7d8fca5e0139b82111ab05cb61b67d9
diff --git a/sci-libs/caffe2/caffe2-1.11.0-r2.ebuild b/sci-libs/caffe2/caffe2-1.11.0-r2.ebuild
new file mode 100644
index 000000000000..6ae8a8dc9187
--- /dev/null
+++ b/sci-libs/caffe2/caffe2-1.11.0-r2.ebuild
@@ -0,0 +1,160 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit python-r1 cmake
+
+MYPN=pytorch
+MYP=${MYPN}-${PV}
+
+DESCRIPTION="A deep learning framework"
+HOMEPAGE="https://pytorch.org/"
+SRC_URI="https://github.com/pytorch/${MYPN}/archive/refs/tags/v${PV}.tar.gz
+ -> ${MYP}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="cuda ffmpeg nnpack +numpy opencl opencv openmp qnnpack xnnpack"
+RESTRICT="test"
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+ ffmpeg? ( opencv )
+" # ?? ( cuda rocm )
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-cpp/gflags:=
+ <dev-cpp/glog-0.5.0
+ dev-libs/cpuinfo
+ dev-libs/libfmt
+ dev-libs/protobuf
+ dev-libs/pthreadpool
+ dev-libs/sleef
+ sci-libs/lapack
+ sci-libs/onnx
+ sci-libs/foxi
+ cuda? (
+ =dev-libs/cudnn-8*
+ dev-libs/cudnn-frontend:0/8
+ dev-util/nvidia-cuda-toolkit:=[profiler]
+ )
+ ffmpeg? ( media-video/ffmpeg:= )
+ nnpack? ( sci-libs/NNPACK )
+ numpy? ( dev-python/numpy[${PYTHON_USEDEP}] )
+ opencl? ( virtual/opencl )
+ opencv? ( media-libs/opencv:= )
+ qnnpack? ( sci-libs/QNNPACK )
+ xnnpack? ( sci-libs/XNNPACK )
+"
+DEPEND="
+ ${RDEPEND}
+ dev-cpp/eigen
+ dev-libs/psimd
+ dev-libs/FP16
+ dev-libs/FXdiv
+ dev-libs/pocketfft
+ dev-libs/flatbuffers
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/pybind11[${PYTHON_USEDEP}]
+"
+
+S="${WORKDIR}"/${MYP}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.11.0-gentoo.patch
+ "${FILESDIR}"/${PN}-1.12.0-install-dirs.patch
+)
+
+src_prepare() {
+ cmake_src_prepare
+ pushd torch/csrc/jit/serialization || die
+ flatc --cpp --gen-mutable --scoped-enums mobile_bytecode.fbs || die
+ popd
+}
+
+src_configure() {
+ if use cuda && [[ -z ${TORCH_CUDA_ARCH_LIST} ]]; then
+ ewarn "WARNING: caffe2 is being built with its default CUDA compute capabilities: 3.5 and 7.0."
+ ewarn "These may not be optimal for your GPU."
+ ewarn ""
+ ewarn "To configure caffe2 with the CUDA compute capability that is optimal for your GPU,"
+ ewarn "set TORCH_CUDA_ARCH_LIST in your make.conf, and re-emerge caffe2."
+ ewarn "For example, to use CUDA capability 7.5 & 3.5, add: TORCH_CUDA_ARCH_LIST=7.5,3.5"
+ ewarn "For a Maxwell model GPU, an example value would be: TORCH_CUDA_ARCH_LIST=Maxwell"
+ ewarn ""
+ ewarn "You can look up your GPU's CUDA compute capability at https://developer.nvidia.com/cuda-gpus"
+ ewarn "or by running /opt/cuda/extras/demo_suite/deviceQuery | grep 'CUDA Capability'"
+ fi
+
+ python_setup
+ local mycmakeargs=(
+ -DBUILD_CUSTOM_PROTOBUF=OFF
+ -DBUILD_SHARED_LIBS=ON
+
+ -DUSE_CCACHE=OFF
+ -DUSE_CUDA=$(usex cuda)
+ -DUSE_CUDNN=$(usex cuda)
+ -DUSE_FAST_NVCC=$(usex cuda)
+ -DTORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST:-3.5 7.0}"
+ -DUSE_DISTRIBUTED=OFF
+ -DUSE_FAKELOWP=OFF
+ -DUSE_FBGEMM=OFF # TODO
+ -DUSE_FFMPEG=$(usex ffmpeg)
+ -DUSE_GFLAGS=ON
+ -DUSE_GLOG=ON
+ -DUSE_GLOO=OFF
+ -DUSE_KINETO=OFF # TODO
+ -DUSE_LEVELDB=OFF
+ -DUSE_MAGMA=OFF # TODO: In GURU as sci-libs/magma
+ -DUSE_MKLDNN=OFF
+ -DUSE_NCCL=OFF # TODO: NVIDIA Collective Communication Library
+ -DUSE_NNPACK=$(usex nnpack)
+ -DUSE_QNNPACK=$(usex qnnpack)
+ -DUSE_XNNPACK=$(usex xnnpack)
+ -DUSE_SYSTEM_XNNPACK=$(usex xnnpack)
+ -DUSE_PYTORCH_QNNPACK=OFF
+ -DUSE_NUMPY=$(usex numpy)
+ -DUSE_OPENCL=$(usex opencl)
+ -DUSE_OPENCV=$(usex opencv)
+ -DUSE_OPENMP=$(usex openmp)
+ -DUSE_ROCM=OFF # TODO
+ -DUSE_SYSTEM_CPUINFO=ON
+ -DUSE_BREAKPAD=OFF # TODO
+ -DUSE_SYSTEM_BIND11=ON
+ -DPYBIND11_PYTHON_VERSION="${EPYTHON#python}"
+ -DPYTHON_EXECUTABLE="${PYTHON}"
+ -DUSE_SYSTEM_EIGEN_INSTALL=ON
+ -DUSE_SYSTEM_PTHREADPOOL=ON
+ -DUSE_SYSTEM_FXDIV=ON
+ -DUSE_SYSTEM_FP16=ON
+ -DUSE_SYSTEM_ONNX=ON
+ -DUSE_SYSTEM_SLEEF=ON
+ -DUSE_TENSORPIPE=OFF
+
+ -Wno-dev
+ -DTORCH_INSTALL_LIB_DIR=/usr/$(get_libdir)
+ -DLIBSHM_INSTALL_LIB_SUBDIR=/usr/$(get_libdir)
+ )
+ cmake_src_configure
+}
+
+python_install() {
+ python_domodule python/caffe2
+ python_domodule python/torch
+}
+
+src_install() {
+ cmake_src_install
+
+ insinto "/var/lib/${PN}"
+ doins "${BUILD_DIR}"/CMakeCache.txt
+
+ rm -rf python
+ mkdir -p python/torch || die
+ mv "${D}"/usr/lib/python*/site-packages/caffe2 python/ || die
+ cp torch/version.py python/torch/ || die
+ python_foreach_impl python_install
+}
diff --git a/sci-libs/caffe2/caffe2-1.11.0.ebuild b/sci-libs/caffe2/caffe2-1.11.0.ebuild
deleted file mode 100644
index e0f6d0d772f2..000000000000
--- a/sci-libs/caffe2/caffe2-1.11.0.ebuild
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright 2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit python-r1 cmake
-
-MYPN=pytorch
-MYP=${MYPN}-${PV}
-
-DESCRIPTION="A deep learning framework"
-HOMEPAGE="https://pytorch.org/"
-SRC_URI="https://github.com/pytorch/${MYPN}/archive/refs/tags/v${PV}.tar.gz
- -> ${MYP}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64"
-RESTRICT="test"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="
- ${PYTHON_DEPS}
- dev-libs/cpuinfo
- dev-libs/libfmt
- dev-libs/protobuf
- dev-libs/sleef
- sci-libs/lapack
- sci-libs/onnx
- sci-libs/foxi
-"
-DEPEND="${RDEPEND}
- dev-libs/FP16
- dev-libs/pocketfft
- dev-libs/flatbuffers
- dev-python/pyyaml[${PYTHON_USEDEP}]
- dev-python/pybind11[${PYTHON_USEDEP}]
-"
-
-S="${WORKDIR}"/${MYP}
-
-PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
-
-src_prepare() {
- cmake_src_prepare
- pushd torch/csrc/jit/serialization || die
- flatc --cpp --gen-mutable --scoped-enums mobile_bytecode.fbs || die
- popd
-}
-
-src_configure() {
- python_setup
- local mycmakeargs=(
- -DUSE_KINETO=OFF
- -DUSE_XNNPACK=OFF
- -DUSE_SYSTEM_SLEEF=ON
- -DUSE_BREAKPAD=OFF
- -DUSE_SYSTEM_ONNX=ON
- -DUSE_TENSORPIPE=OFF
- -DUSE_GLOO=OFF
- -DUSE_SYSTEM_FP16=ON
- -DUSE_FBGEMM=OFF
- -DUSE_NNPACK=OFF
- -DUSE_PYTORCH_QNNPACK=OFF
- -DUSE_QNNPACK=OFF
- -DUSE_SYSTEM_CPUINFO=ON
- -DBUILD_CUSTOM_PROTOBUF=OFF
- -DUSE_MKLDNN=OFF
- -DUSE_NUMPY=OFF
- -DUSE_OPENMP=OFF
- -DUSE_DISTRIBUTED=OFF
- -DUSE_CUDA=OFF
- -DUSE_NCCL=OFF
- -Wno-dev
- -DTORCH_INSTALL_LIB_DIR=/usr/$(get_libdir)
- -DLIBSHM_INSTALL_LIB_SUBDIR=/usr/$(get_libdir)
- -DUSE_CCACHE=OFF
- )
- cmake_src_configure
-}
-
-python_install() {
- python_domodule python/caffe2
- python_domodule python/torch
-}
-
-src_install() {
- cmake_src_install
-
- insinto "/var/lib/${PN}"
- doins "${BUILD_DIR}"/CMakeCache.txt
-
- rm -rf python
- mkdir -p python/torch || die
- mv "${D}"/usr/lib/python*/site-packages/caffe2 python/ || die
- cp torch/version.py python/torch/ || die
- python_foreach_impl python_install
-}
diff --git a/sci-libs/caffe2/caffe2-1.12.0.ebuild b/sci-libs/caffe2/caffe2-1.12.0.ebuild
new file mode 100644
index 000000000000..a7bc65b359da
--- /dev/null
+++ b/sci-libs/caffe2/caffe2-1.12.0.ebuild
@@ -0,0 +1,159 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit python-r1 cmake
+
+MYPN=pytorch
+MYP=${MYPN}-${PV}
+
+DESCRIPTION="A deep learning framework"
+HOMEPAGE="https://pytorch.org/"
+SRC_URI="https://github.com/pytorch/${MYPN}/archive/refs/tags/v${PV}.tar.gz
+ -> ${MYP}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="cuda ffmpeg nnpack +numpy opencl opencv openmp qnnpack xnnpack"
+RESTRICT="test"
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+ ffmpeg? ( opencv )
+" # ?? ( cuda rocm )
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-cpp/gflags:=
+ <dev-cpp/glog-0.5.0
+ dev-libs/cpuinfo
+ dev-libs/libfmt
+ dev-libs/protobuf
+ dev-libs/pthreadpool
+ dev-libs/sleef
+ sci-libs/lapack
+ sci-libs/onnx
+ sci-libs/foxi
+ cuda? (
+ =dev-libs/cudnn-8*
+ dev-libs/cudnn-frontend:0/8
+ dev-util/nvidia-cuda-toolkit:=[profiler]
+ )
+ ffmpeg? ( media-video/ffmpeg:= )
+ nnpack? ( sci-libs/NNPACK )
+ numpy? ( dev-python/numpy[${PYTHON_USEDEP}] )
+ opencl? ( virtual/opencl )
+ opencv? ( media-libs/opencv:= )
+ qnnpack? ( sci-libs/QNNPACK )
+ xnnpack? ( sci-libs/XNNPACK )
+"
+DEPEND="
+ ${RDEPEND}
+ dev-cpp/eigen
+ dev-libs/psimd
+ dev-libs/FP16
+ dev-libs/FXdiv
+ dev-libs/pocketfft
+ dev-libs/flatbuffers
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/pybind11[${PYTHON_USEDEP}]
+"
+
+S="${WORKDIR}"/${MYP}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.11.0-gentoo.patch
+ "${FILESDIR}"/${PN}-1.12.0-install-dirs.patch
+)
+
+src_prepare() {
+ cmake_src_prepare
+ pushd torch/csrc/jit/serialization || die
+ flatc --cpp --gen-mutable --scoped-enums mobile_bytecode.fbs || die
+ popd
+}
+
+src_configure() {
+ if use cuda && [[ -z ${TORCH_CUDA_ARCH_LIST} ]]; then
+ ewarn "WARNING: caffe2 is being built with its default CUDA compute capabilities: 3.5 and 7.0."
+ ewarn "These may not be optimal for your GPU."
+ ewarn ""
+ ewarn "To configure caffe2 with the CUDA compute capability that is optimal for your GPU,"
+ ewarn "set TORCH_CUDA_ARCH_LIST in your make.conf, and re-emerge caffe2."
+ ewarn "For example, to use CUDA capability 7.5 & 3.5, add: TORCH_CUDA_ARCH_LIST=7.5,3.5"
+ ewarn "For a Maxwell model GPU, an example value would be: TORCH_CUDA_ARCH_LIST=Maxwell"
+ ewarn ""
+ ewarn "You can look up your GPU's CUDA compute capability at https://developer.nvidia.com/cuda-gpus"
+ ewarn "or by running /opt/cuda/extras/demo_suite/deviceQuery | grep 'CUDA Capability'"
+ fi
+
+ python_setup
+ local mycmakeargs=(
+ -DBUILD_CUSTOM_PROTOBUF=OFF
+ -DBUILD_SHARED_LIBS=ON
+
+ -DUSE_CCACHE=OFF
+ -DUSE_CUDA=$(usex cuda)
+ -DUSE_CUDNN=$(usex cuda)
+ -DUSE_FAST_NVCC=$(usex cuda)
+ -DTORCH_CUDA_ARCH_LIST="${TORCH_CUDA_ARCH_LIST:-3.5 7.0}"
+ -DUSE_DISTRIBUTED=OFF
+ -DUSE_FAKELOWP=OFF
+ -DUSE_FBGEMM=OFF # TODO
+ -DUSE_FFMPEG=$(usex ffmpeg)
+ -DUSE_GFLAGS=ON
+ -DUSE_GLOG=ON
+ -DUSE_GLOO=OFF
+ -DUSE_KINETO=OFF # TODO
+ -DUSE_LEVELDB=OFF
+ -DUSE_MAGMA=OFF # TODO: In GURU as sci-libs/magma
+ -DUSE_MKLDNN=OFF
+ -DUSE_NCCL=OFF # TODO: NVIDIA Collective Communication Library
+ -DUSE_NNPACK=$(usex nnpack)
+ -DUSE_QNNPACK=$(usex qnnpack)
+ -DUSE_XNNPACK=$(usex xnnpack)
+ -DUSE_SYSTEM_XNNPACK=$(usex xnnpack)
+ -DUSE_PYTORCH_QNNPACK=OFF
+ -DUSE_NUMPY=$(usex numpy)
+ -DUSE_OPENCL=$(usex opencl)
+ -DUSE_OPENCV=$(usex opencv)
+ -DUSE_OPENMP=$(usex openmp)
+ -DUSE_ROCM=OFF # TODO
+ -DUSE_SYSTEM_CPUINFO=ON
+ -DUSE_SYSTEM_BIND11=ON
+ -DPYBIND11_PYTHON_VERSION="${EPYTHON#python}"
+ -DPYTHON_EXECUTABLE="${PYTHON}"
+ -DUSE_SYSTEM_EIGEN_INSTALL=ON
+ -DUSE_SYSTEM_PTHREADPOOL=ON
+ -DUSE_SYSTEM_FXDIV=ON
+ -DUSE_SYSTEM_FP16=ON
+ -DUSE_SYSTEM_ONNX=ON
+ -DUSE_SYSTEM_SLEEF=ON
+ -DUSE_TENSORPIPE=OFF
+
+ -Wno-dev
+ -DTORCH_INSTALL_LIB_DIR=/usr/$(get_libdir)
+ -DLIBSHM_INSTALL_LIB_SUBDIR=/usr/$(get_libdir)
+ )
+ cmake_src_configure
+}
+
+python_install() {
+ python_domodule python/caffe2
+ python_domodule python/torch
+}
+
+src_install() {
+ cmake_src_install
+
+ insinto "/var/lib/${PN}"
+ doins "${BUILD_DIR}"/CMakeCache.txt
+
+ rm -rf python
+ mkdir -p python/torch || die
+ mv "${D}"/usr/lib/python*/site-packages/caffe2 python/ || die
+ cp torch/version.py python/torch/ || die
+ python_foreach_impl python_install
+}
diff --git a/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch b/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
index ac74edadab35..505af5e6695c 100644
--- a/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
+++ b/sci-libs/caffe2/files/caffe2-1.11.0-gentoo.patch
@@ -80,14 +80,53 @@
if("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
set(OPT_FLAG " ")
endif()
---- a/c10/CMakeLists.txt 2022-06-19 09:57:16.776536871 +0200
-+++ b/c10/CMakeLists.txt 2022-06-19 09:58:51.663356075 +0200
-@@ -107,7 +107,7 @@
- # Note: for now, we will put all export path into one single Caffe2Targets group
- # to deal with the cmake deployment need. Inside the Caffe2Targets set, the
- # individual libraries like libc10.so and libcaffe2.so are still self-contained.
--install(TARGETS c10 EXPORT Caffe2Targets DESTINATION lib)
-+install(TARGETS c10 EXPORT Caffe2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
- DESTINATION include
- FILES_MATCHING PATTERN "*.h")
+--- a/caffe2/CMakeLists.txt 2022-07-01 21:56:49.643490049 +0200
++++ b/caffe2/CMakeLists.txt 2022-07-01 21:57:17.091489479 +0200
+@@ -109,7 +109,7 @@
+ # Note: the folders that are being commented out have not been properly
+ # addressed yet.
+
+-if(NOT MSVC AND USE_XNNPACK)
++if(FALSE)
+ if(NOT TARGET fxdiv)
+ set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+ set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+@@ -967,7 +967,6 @@
+ endif()
+
+ if(NOT MSVC AND USE_XNNPACK)
+- TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+
+ # ==========================================================
+--- a/cmake/External/nnpack.cmake 2022-07-02 21:56:54.905696921 +0200
++++ b/cmake/External/nnpack.cmake 2022-07-02 21:57:03.665696739 +0200
+@@ -58,7 +58,7 @@
+ set(PTHREADPOOL_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/pthreadpool" CACHE STRING "pthreadpool source directory")
+ set(GOOGLETEST_SOURCE_DIR "${CAFFE2_THIRD_PARTY_ROOT}/googletest" CACHE STRING "Google Test source directory")
+
+- if(NOT TARGET nnpack)
++ if(FALSE)
+ if(NOT USE_SYSTEM_PTHREADPOOL AND USE_INTERNAL_PTHREADPOOL_IMPL)
+ set(NNPACK_CUSTOM_THREADPOOL ON CACHE BOOL "")
+ endif()
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -481,7 +481,7 @@ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS cpuinfo)
+
+ # ---[ QNNPACK
+-if(USE_QNNPACK)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+
+ if(NOT DEFINED QNNPACK_SOURCE_DIR)
+@@ -537,7 +537,7 @@ if(USE_QNNPACK)
+ endif()
+
+ # ---[ Caffe2 Int8 operators (enabled by USE_QNNPACK) depend on gemmlowp and neon2sse headers
+-if(USE_QNNPACK)
++if(FALSE)
+ set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party")
+ include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/gemmlowp")
+ include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}/neon2sse")
diff --git a/sci-libs/caffe2/files/caffe2-1.12.0-install-dirs.patch b/sci-libs/caffe2/files/caffe2-1.12.0-install-dirs.patch
new file mode 100644
index 000000000000..d9c403d5882e
--- /dev/null
+++ b/sci-libs/caffe2/files/caffe2-1.12.0-install-dirs.patch
@@ -0,0 +1,147 @@
+--- a/c10/CMakeLists.txt 2022-06-19 09:57:16.776536871 +0200
++++ b/c10/CMakeLists.txt 2022-06-19 09:58:51.663356075 +0200
+@@ -107,7 +107,7 @@
+ # Note: for now, we will put all export path into one single Caffe2Targets group
+ # to deal with the cmake deployment need. Inside the Caffe2Targets set, the
+ # individual libraries like libc10.so and libcaffe2.so are still self-contained.
+-install(TARGETS c10 EXPORT Caffe2Targets DESTINATION lib)
++install(TARGETS c10 EXPORT Caffe2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ DESTINATION include
+ FILES_MATCHING PATTERN "*.h")
+diff --git a/c10/cuda/CMakeLists.txt b/c10/cuda/CMakeLists.txt
+index a95bd278e2..4a33b4e4ed 100644
+--- a/c10/cuda/CMakeLists.txt
++++ b/c10/cuda/CMakeLists.txt
+@@ -63,7 +63,7 @@ add_subdirectory(test)
+ # Note: for now, we will put all export path into one single Caffe2Targets group
+ # to deal with the cmake deployment need. Inside the Caffe2Targets set, the
+ # individual libraries like libc10.so and libcaffe2.so are still self-contained.
+-install(TARGETS c10_cuda EXPORT Caffe2Targets DESTINATION lib)
++install(TARGETS c10_cuda EXPORT Caffe2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ foreach(file ${C10_CUDA_HEADERS})
+ get_filename_component( dir ${file} DIRECTORY )
+ install( FILES ${file} DESTINATION include/c10/cuda/${dir} )
+diff --git a/c10/hip/CMakeLists.txt b/c10/hip/CMakeLists.txt
+index 6a0e0e41a1..7582c73919 100644
+--- a/c10/hip/CMakeLists.txt
++++ b/c10/hip/CMakeLists.txt
+@@ -55,7 +55,7 @@ target_include_directories(
+ add_subdirectory(test)
+
+ # ---[ Installation
+-install(TARGETS c10_hip EXPORT Caffe2Targets DESTINATION lib)
++install(TARGETS c10_hip EXPORT Caffe2Targets DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ DESTINATION include
+ FILES_MATCHING PATTERN "*.h")
+diff --git a/modules/detectron/CMakeLists.txt b/modules/detectron/CMakeLists.txt
+index bffc074e39..e1697e65f2 100644
+--- a/modules/detectron/CMakeLists.txt
++++ b/modules/detectron/CMakeLists.txt
+@@ -17,7 +17,7 @@ if(BUILD_CAFFE2_OPS)
+
+ torch_set_target_props(caffe2_detectron_ops_gpu)
+ target_link_libraries(caffe2_detectron_ops_gpu torch ${OpenMP_link})
+- install(TARGETS caffe2_detectron_ops_gpu DESTINATION lib)
++ install(TARGETS caffe2_detectron_ops_gpu DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ if(MSVC)
+ install(FILES $<TARGET_PDB_FILE:caffe2_detectron_ops_gpu> DESTINATION lib OPTIONAL)
+ endif()
+@@ -31,7 +31,7 @@ if(BUILD_CAFFE2_OPS)
+ torch_set_target_props(caffe2_detectron_ops_hip)
+ target_compile_options(caffe2_detectron_ops_hip PRIVATE ${HIP_CXX_FLAGS})
+ target_link_libraries(caffe2_detectron_ops_hip torch)
+- install(TARGETS caffe2_detectron_ops_hip DESTINATION lib)
++ install(TARGETS caffe2_detectron_ops_hip DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ elseif(NOT IOS_PLATFORM)
+ add_library(caffe2_detectron_ops SHARED ${Detectron_CPU_SRCS})
+ if(HAVE_SOVERSION)
+@@ -40,7 +40,7 @@ if(BUILD_CAFFE2_OPS)
+ endif()
+ torch_set_target_props(caffe2_detectron_ops)
+ target_link_libraries(caffe2_detectron_ops torch ${OpenMP_link})
+- install(TARGETS caffe2_detectron_ops DESTINATION lib)
++ install(TARGETS caffe2_detectron_ops DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ if(MSVC)
+ install(FILES $<TARGET_PDB_FILE:caffe2_detectron_ops> DESTINATION lib OPTIONAL)
+ endif()
+diff --git a/modules/module_test/CMakeLists.txt b/modules/module_test/CMakeLists.txt
+index f72120d535..c293ce025d 100644
+--- a/modules/module_test/CMakeLists.txt
++++ b/modules/module_test/CMakeLists.txt
+@@ -16,7 +16,7 @@ if(BUILD_TEST AND NOT BUILD_LITE_INTERPRETER)
+ VERSION ${TORCH_VERSION} SOVERSION ${TORCH_SOVERSION})
+ endif()
+ target_link_libraries(caffe2_module_test_dynamic torch_library)
+- install(TARGETS caffe2_module_test_dynamic DESTINATION lib)
++ install(TARGETS caffe2_module_test_dynamic DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ if(MSVC AND BUILD_SHARED_LIBS)
+ install(FILES $<TARGET_PDB_FILE:caffe2_module_test_dynamic> DESTINATION lib OPTIONAL)
+ endif()
+diff --git a/modules/observers/CMakeLists.txt b/modules/observers/CMakeLists.txt
+index 050b8a1461..0309a273b7 100644
+--- a/modules/observers/CMakeLists.txt
++++ b/modules/observers/CMakeLists.txt
+@@ -21,7 +21,7 @@ endif()
+ target_link_libraries(caffe2_observers PUBLIC torch_library)
+ target_include_directories(caffe2_observers PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
+ target_compile_options(caffe2_observers PRIVATE "-DCAFFE2_BUILD_OBSERVER_LIB")
+-install(TARGETS caffe2_observers DESTINATION lib)
++install(TARGETS caffe2_observers DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ caffe2_interface_library(caffe2_observers caffe2_observers_library)
+ if(MSVC AND BUILD_SHARED_LIBS)
+ install(FILES $<TARGET_PDB_FILE:caffe2_observers> DESTINATION lib OPTIONAL)
+diff --git a/modules/rocksdb/CMakeLists.txt b/modules/rocksdb/CMakeLists.txt
+index 78651989aa..52bfd149a2 100644
+--- a/modules/rocksdb/CMakeLists.txt
++++ b/modules/rocksdb/CMakeLists.txt
+@@ -59,7 +59,7 @@ add_library(caffe2_rocksdb ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb.cc)
+ target_link_libraries(caffe2_rocksdb PUBLIC torch_library)
+ target_link_libraries(caffe2_rocksdb PRIVATE ${RocksDB_LIBRARIES})
+ target_include_directories(caffe2_rocksdb PRIVATE ${RocksDB_INCLUDE_DIR})
+-install(TARGETS caffe2_rocksdb DESTINATION lib)
++install(TARGETS caffe2_rocksdb DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ # ---[ Last, Append the library to Caffe2_MODULES, if we are building with
+ # the main repo.
+diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
+index bf91460c4b..ebbd476fa9 100644
+--- a/test/cpp/c10d/CMakeLists.txt
++++ b/test/cpp/c10d/CMakeLists.txt
+@@ -51,7 +51,7 @@ if(USE_CUDA)
+ if(INSTALL_TEST)
+ install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+ install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+- install(TARGETS c10d_cuda_test DESTINATION lib)
++ install(TARGETS c10d_cuda_test DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+ endif()
+ else()
+diff --git a/test/cpp/jit/CMakeLists.txt b/test/cpp/jit/CMakeLists.txt
+index 60b43b81fc..9cf34a1620 100644
+--- a/test/cpp/jit/CMakeLists.txt
++++ b/test/cpp/jit/CMakeLists.txt
+@@ -32,9 +32,9 @@ endif()
+ target_link_libraries(backend_with_compiler torch)
+
+ if(INSTALL_TEST)
+- install(TARGETS torchbind_test DESTINATION lib)
+- install(TARGETS jitbackend_test DESTINATION lib)
+- install(TARGETS backend_with_compiler DESTINATION lib)
++ install(TARGETS torchbind_test DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS jitbackend_test DESTINATION ${CMAKE_INSTALL_LIBDIR})
++ install(TARGETS backend_with_compiler DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+
+ # Build the cpp gtest binary containing the cpp-only tests.
+diff --git a/torch/csrc/deploy/CMakeLists.txt b/torch/csrc/deploy/CMakeLists.txt
+index 61fe8c1bb8..28575979dd 100644
+--- a/torch/csrc/deploy/CMakeLists.txt
++++ b/torch/csrc/deploy/CMakeLists.txt
+@@ -80,4 +80,4 @@ if(INSTALL_TEST)
+ install(TARGETS test_deploy_gpu DESTINATION bin)
+ endif()
+
+-install(TARGETS torch_deploy DESTINATION lib)
++install(TARGETS torch_deploy DESTINATION ${CMAKE_INSTALL_LIBDIR})
diff --git a/sci-libs/caffe2/metadata.xml b/sci-libs/caffe2/metadata.xml
index d12749aa5c21..25a171ff1680 100644
--- a/sci-libs/caffe2/metadata.xml
+++ b/sci-libs/caffe2/metadata.xml
@@ -5,6 +5,21 @@
<email>tupone@gentoo.org</email>
<name>Tupone Alfredo</name>
</maintainer>
+ <maintainer type="person" proxied="yes">
+ <email>telans@posteo.de</email>
+ <name>James Beddek</name>
+ </maintainer>
+ <use>
+ <flag name="cuda">Add support for CUDA processing</flag>
+ <flag name="ffmpeg">Add support for video processing operators</flag>
+ <flag name="nnpack">Use NNPACK</flag>
+ <flag name="numpy">Add support for math operations through numpy</flag>
+ <flag name="opencl">Use OpenCL</flag>
+ <flag name="opencv">Add support for image processing operators</flag>
+ <flag name="openmp">Use OpenMP for parallel code</flag>
+ <flag name="qnnpack">Use QNNPACK</flag>
+ <flag name="xnnpack">Use XNNPACK</flag>
+ </use>
<upstream>
<remote-id type="github">pytorch/pytorch</remote-id>
</upstream>