summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Tupone <tupone@gentoo.org>2022-09-05 08:40:29 +0200
committerAlfredo Tupone <tupone@gentoo.org>2022-09-05 08:40:29 +0200
commit3f34c4d94727a44935b381b06d00367a2755930a (patch)
tree5a0e97528386f987dcea1fa5cca6a712436bc263 /sci-libs/caffe2
parentxfce-base/xfce4-panel: Remove old (diff)
downloadgentoo-3f34c4d94727a44935b381b06d00367a2755930a.tar.gz
gentoo-3f34c4d94727a44935b381b06d00367a2755930a.tar.bz2
gentoo-3f34c4d94727a44935b381b06d00367a2755930a.zip
sci-libs/caffe2: support glog-0.5.0
Closes: https://bugs.gentoo.org/865681 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
Diffstat (limited to 'sci-libs/caffe2')
-rw-r--r--sci-libs/caffe2/caffe2-1.12.0.ebuild3
-rw-r--r--sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch29
2 files changed, 31 insertions, 1 deletions
diff --git a/sci-libs/caffe2/caffe2-1.12.0.ebuild b/sci-libs/caffe2/caffe2-1.12.0.ebuild
index 08e81ce1c8ab..0a44b6824c3c 100644
--- a/sci-libs/caffe2/caffe2-1.12.0.ebuild
+++ b/sci-libs/caffe2/caffe2-1.12.0.ebuild
@@ -27,7 +27,7 @@ REQUIRED_USE="
RDEPEND="
${PYTHON_DEPS}
dev-cpp/gflags:=
- <dev-cpp/glog-0.5.0
+ >=dev-cpp/glog-0.5.0
dev-libs/cpuinfo
dev-libs/libfmt
dev-libs/protobuf
@@ -66,6 +66,7 @@ S="${WORKDIR}"/${MYP}
PATCHES=(
"${FILESDIR}"/${PN}-1.11.0-gentoo.patch
"${FILESDIR}"/${PN}-1.12.0-install-dirs.patch
+ "${FILESDIR}"/${P}-glog-0.6.0.patch
)
src_prepare() {
diff --git a/sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch b/sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch
new file mode 100644
index 000000000000..a821ebedf7b7
--- /dev/null
+++ b/sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch
@@ -0,0 +1,29 @@
+https://github.com/pytorch/pytorch/issues/58054
+
+--- /c10/util/Logging.cpp
++++ /c10/util/Logging.cpp
+@@ -192,23 +192,13 @@
+ google::GLOG_WARNING,
+ "The minimum log level that caffe2 will output.");
+
+-// Google glog's api does not have an external function that allows one to check
+-// if glog is initialized or not. It does have an internal function - so we are
+-// declaring it here. This is a hack but has been used by a bunch of others too
+-// (e.g. Torch).
+-namespace google {
+-namespace glog_internal_namespace_ {
+-bool IsGoogleLoggingInitialized();
+-} // namespace glog_internal_namespace_
+-} // namespace google
+-
+ namespace c10 {
+ namespace {
+
+ void initGoogleLogging(char const* name) {
+ #if !defined(_MSC_VER)
+ // This trick can only be used on UNIX platforms
+- if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized())
++ if (!::google::IsGoogleLoggingInitialized())
+ #endif
+ {
+ ::google::InitGoogleLogging(name);