1 |
commit: 3f34c4d94727a44935b381b06d00367a2755930a |
2 |
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 5 06:40:29 2022 +0000 |
4 |
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 5 06:40:29 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f34c4d9 |
7 |
|
8 |
sci-libs/caffe2: support glog-0.5.0 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/865681 |
11 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
12 |
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> |
13 |
|
14 |
sci-libs/caffe2/caffe2-1.12.0.ebuild | 3 ++- |
15 |
.../caffe2/files/caffe2-1.12.0-glog-0.6.0.patch | 29 ++++++++++++++++++++++ |
16 |
2 files changed, 31 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/sci-libs/caffe2/caffe2-1.12.0.ebuild b/sci-libs/caffe2/caffe2-1.12.0.ebuild |
19 |
index 08e81ce1c8ab..0a44b6824c3c 100644 |
20 |
--- a/sci-libs/caffe2/caffe2-1.12.0.ebuild |
21 |
+++ b/sci-libs/caffe2/caffe2-1.12.0.ebuild |
22 |
@@ -27,7 +27,7 @@ REQUIRED_USE=" |
23 |
RDEPEND=" |
24 |
${PYTHON_DEPS} |
25 |
dev-cpp/gflags:= |
26 |
- <dev-cpp/glog-0.5.0 |
27 |
+ >=dev-cpp/glog-0.5.0 |
28 |
dev-libs/cpuinfo |
29 |
dev-libs/libfmt |
30 |
dev-libs/protobuf |
31 |
@@ -66,6 +66,7 @@ S="${WORKDIR}"/${MYP} |
32 |
PATCHES=( |
33 |
"${FILESDIR}"/${PN}-1.11.0-gentoo.patch |
34 |
"${FILESDIR}"/${PN}-1.12.0-install-dirs.patch |
35 |
+ "${FILESDIR}"/${P}-glog-0.6.0.patch |
36 |
) |
37 |
|
38 |
src_prepare() { |
39 |
|
40 |
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 |
41 |
new file mode 100644 |
42 |
index 000000000000..a821ebedf7b7 |
43 |
--- /dev/null |
44 |
+++ b/sci-libs/caffe2/files/caffe2-1.12.0-glog-0.6.0.patch |
45 |
@@ -0,0 +1,29 @@ |
46 |
+https://github.com/pytorch/pytorch/issues/58054 |
47 |
+ |
48 |
+--- /c10/util/Logging.cpp |
49 |
++++ /c10/util/Logging.cpp |
50 |
+@@ -192,23 +192,13 @@ |
51 |
+ google::GLOG_WARNING, |
52 |
+ "The minimum log level that caffe2 will output."); |
53 |
+ |
54 |
+-// Google glog's api does not have an external function that allows one to check |
55 |
+-// if glog is initialized or not. It does have an internal function - so we are |
56 |
+-// declaring it here. This is a hack but has been used by a bunch of others too |
57 |
+-// (e.g. Torch). |
58 |
+-namespace google { |
59 |
+-namespace glog_internal_namespace_ { |
60 |
+-bool IsGoogleLoggingInitialized(); |
61 |
+-} // namespace glog_internal_namespace_ |
62 |
+-} // namespace google |
63 |
+- |
64 |
+ namespace c10 { |
65 |
+ namespace { |
66 |
+ |
67 |
+ void initGoogleLogging(char const* name) { |
68 |
+ #if !defined(_MSC_VER) |
69 |
+ // This trick can only be used on UNIX platforms |
70 |
+- if (!::google::glog_internal_namespace_::IsGoogleLoggingInitialized()) |
71 |
++ if (!::google::IsGoogleLoggingInitialized()) |
72 |
+ #endif |
73 |
+ { |
74 |
+ ::google::InitGoogleLogging(name); |