[packages/glog] - added gflags patch (fixes build with gflags in gflags:: namespace instead of google::) - fixed bui

qboosh qboosh at pld-linux.org
Sun Feb 8 21:55:49 CET 2015


commit 7c1add517cd1c656d9b73fd47429db443c81586b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Feb 8 21:58:20 2015 +0100

    - added gflags patch (fixes build with gflags in gflags:: namespace instead of google::)
    - fixed build with gtest/gmock
    - release 2

 glog-gflags.patch | 30 ++++++++++++++++++++++++++++++
 glog.spec         | 25 ++++++++++++++++++++++++-
 2 files changed, 54 insertions(+), 1 deletion(-)
---
diff --git a/glog.spec b/glog.spec
index e04db2b..369efc0 100644
--- a/glog.spec
+++ b/glog.spec
@@ -1,17 +1,26 @@
+#
+# Conditional build:
+%bcond_without	tests	# gtest/gmock based tests
+#
 Summary:	A C++ application logging library
 Summary(pl.UTF-8):	Biblioteka do logowania dla aplikacji w C++
 Name:		glog
 Version:	0.3.3
-Release:	1
+Release:	2
 License:	BSD
 Group:		Libraries
 #Source0Download: http://code.google.com/p/google-glog/downloads/list
 Source0:	http://google-glog.googlecode.com/files/%{name}-%{version}.tar.gz
 # Source0-md5:	a6fd2c22f8996846e34c763422717c18
+Patch0:		%{name}-gflags.patch
 URL:		http://code.google.com/p/google-glog
 BuildRequires:	autoconf >= 2.57
 BuildRequires:	automake
 BuildRequires:	gflags-devel
+%if %{with tests}
+BuildRequires:	gmock-devel
+BuildRequires:	gtest-devel
+%endif
 BuildRequires:	libstdc++-devel
 BuildRequires:	libtool >= 2:1.5
 BuildRequires:	libunwind-devel
@@ -58,8 +67,18 @@ Statyczna biblioteka glog.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
+%if %{with tests}
+install -d gmock
+cd gmock
+%cmake $(pkg-config --variable=srcdir gmock) \
+	-DBUILD_SHARED_LIBS=OFF
+%{__make}
+cd ..
+LDFLAGS="%{rpmldflags} -L$(pwd)/gmock"
+%endif
 %{__libtoolize}
 %{__aclocal} -I m4
 %{__autoconf}
@@ -69,6 +88,10 @@ Statyczna biblioteka glog.
 
 %{__make}
 
+%if %{with tests}
+%{__make} check
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 %{__make} install \
diff --git a/glog-gflags.patch b/glog-gflags.patch
new file mode 100644
index 0000000..2fad3ce
--- /dev/null
+++ b/glog-gflags.patch
@@ -0,0 +1,30 @@
+--- glog-0.3.3/src/demangle_unittest.cc.orig	2012-01-11 10:14:17.000000000 +0100
++++ glog-0.3.3/src/demangle_unittest.cc	2015-02-08 21:29:01.660388457 +0100
+@@ -46,6 +46,7 @@ GLOG_DEFINE_bool(demangle_filter, false,
+ 
+ using namespace std;
+ using namespace GOOGLE_NAMESPACE;
++using namespace gflags;
+ 
+ // A wrapper function for Demangle() to make the unit test simple.
+ static const char *DemangleIt(const char * const mangled) {
+--- glog-0.3.3/src/logging_unittest.cc.orig	2013-01-31 05:39:40.000000000 +0100
++++ glog-0.3.3/src/logging_unittest.cc	2015-02-08 21:24:53.070398888 +0100
+@@ -79,6 +79,7 @@ using GOOGLE_NAMESPACE::glog_testing::Sc
+ 
+ using namespace std;
+ using namespace GOOGLE_NAMESPACE;
++using namespace gflags;
+ 
+ // Some non-advertised functions that we want to test or use.
+ _START_GOOGLE_NAMESPACE_
+--- glog-0.3.3/src/signalhandler_unittest.cc.orig	2012-01-11 10:14:17.000000000 +0100
++++ glog-0.3.3/src/signalhandler_unittest.cc	2015-02-08 21:30:07.120385709 +0100
+@@ -42,6 +42,7 @@
+ #include "glog/logging.h"
+ 
+ using namespace GOOGLE_NAMESPACE;
++using namespace gflags;
+ 
+ void* DieInThread(void*) {
+   // We assume pthread_t is an integral number or a pointer, rather
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/glog.git/commitdiff/7c1add517cd1c656d9b73fd47429db443c81586b



More information about the pld-cvs-commit mailing list