[packages/glog] - updated to 0.6.0 (new soname, now with cmake support) - removed gflags patch - updated avoid-inlin

qboosh qboosh at pld-linux.org
Wed Jun 29 19:13:46 CEST 2022


commit b8e8309ddcfaacb3821687f7bcb77fbe5a6d914f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Jun 29 19:15:22 2022 +0200

    - updated to 0.6.0 (new soname, now with cmake support)
    - removed gflags patch
    - updated avoid-inline-asm patch

 avoid-inline-asm.patch | 16 ++++++------
 glog-gflags.patch      | 30 ---------------------
 glog.spec              | 71 ++++++++++++++++++++++++++++----------------------
 3 files changed, 48 insertions(+), 69 deletions(-)
---
diff --git a/glog.spec b/glog.spec
index c8fed78..42a0dae 100644
--- a/glog.spec
+++ b/glog.spec
@@ -1,35 +1,34 @@
 #
 # Conditional build:
-%bcond_with	tests	# gtest/gmock based tests [signalhandler_unittest broken on x32 as of 0.4.0]
+%bcond_without	libunwind	# libunwind support
+%bcond_without	static_libs	# static library
+%bcond_without	tests		# gtest/gmock based tests [recheck: signalhandler_unittest broken on x32 as of 0.4.0]
 
+%ifarch %{ix86} %{x8664} x32 %{arm} hppa ia64 mips ppc ppc64 sh
+%undefine	with_libunwind
+%endif
 Summary:	A C++ application logging library
 Summary(pl.UTF-8):	Biblioteka do logowania dla aplikacji w C++
 Name:		glog
-Version:	0.4.0
+Version:	0.6.0
 Release:	1
 License:	BSD
 Group:		Libraries
 #Source0Download: https://github.com/google/glog/releases
 Source0:	https://github.com/google/glog/archive/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	0daea8785e6df922d7887755c3d100d0
-Patch0:		%{name}-gflags.patch
-Patch1:		avoid-inline-asm.patch
+# Source0-md5:	c98a6068bc9b8ad9cebaca625ca73aa2
+Patch0:		avoid-inline-asm.patch
 URL:		https://github.com/google/glog
-BuildRequires:	autoconf >= 2.57
-BuildRequires:	automake
-BuildRequires:	gflags-devel
+BuildRequires:	cmake >= 3.16
+BuildRequires:	gflags-devel >= 2.2.2
 BuildRequires:	libstdc++-devel
-BuildRequires:	libtool >= 2:1.5
+%if %{with libunwind}
+BuildRequires:	libunwind-devel
+%endif
 BuildRequires:	pkgconfig
 %if %{with tests}
 BuildRequires:	gmock-devel >= 1.10.0
 BuildRequires:	gtest-devel
-%else
-BuildConflicts:	gmock-devel
-BuildConflicts:	gtest-devel
-%endif
-%ifarch %{ix86} %{x8664} x32 %{arm} hppa ia64 mips ppc ppc64 sh
-BuildRequires:	libunwind-devel
 %endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -48,7 +47,7 @@ Summary:	Development files for glog library
 Summary(pl.UTF-8):	Pliki programistyczne biblioteki glog
 Group:		Development/Libraries
 Requires:	%{name} = %{version}-%{release}
-Requires:	gflags-devel
+Requires:	gflags-devel >= 2.2.2
 Requires:	libstdc++-devel
 
 %description devel
@@ -74,29 +73,37 @@ Statyczna biblioteka glog.
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
 
 %build
-%{__libtoolize}
-%{__aclocal} -I m4
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure
+%if %{with static_libs}
+%cmake -B build-static \
+	-DBUILD_SHARED_LIBS=OFF \
+	%{!?with_tests:-DWITH_GTEST=OFF} \
+	%{!?with_libunwind:-DWITH_UNWIND=OFF}
 
-%{__make}
+%{__make} -C build-static
+%endif
+
+%cmake -B build \
+	%{!?with_tests:-DWITH_GTEST=OFF} \
+	%{!?with_libunwind:-DWITH_UNWIND=OFF}
+
+%{__make} -C build
 
 %if %{with tests}
-%{__make} check
+%{__make} -C build test
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+
+%if %{with static_libs}
+%{__make} -C build-static install \
 	DESTDIR=$RPM_BUILD_ROOT
+%endif
 
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libglog.la
-%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -106,17 +113,19 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog README.md
+%doc AUTHORS COPYING ChangeLog README.rst
 %attr(755,root,root) %{_libdir}/libglog.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libglog.so.0
+%attr(755,root,root) %ghost %{_libdir}/libglog.so.1
 
 %files devel
 %defattr(644,root,root,755)
-%doc doc/designstyle.css doc/glog.html
 %attr(755,root,root) %{_libdir}/libglog.so
 %{_includedir}/glog
 %{_pkgconfigdir}/libglog.pc
+%{_libdir}/cmake/glog
 
+%if %{with static_libs}
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libglog.a
+%endif
diff --git a/avoid-inline-asm.patch b/avoid-inline-asm.patch
index 7387466..a442051 100644
--- a/avoid-inline-asm.patch
+++ b/avoid-inline-asm.patch
@@ -2,9 +2,9 @@ http://code.google.com/p/google-glog/issues/detail?id=130
 
 make the code work with all gcc targets
 
---- glog-0.4.0/src/symbolize_unittest.cc.orig	2019-03-22 03:51:46.000000000 +0100
-+++ glog-0.4.0/src/symbolize_unittest.cc	2019-03-28 20:39:09.755256776 +0100
-@@ -77,9 +77,7 @@
+--- glog-0.6.0/src/symbolize_unittest.cc.orig	2019-03-22 03:51:46.000000000 +0100
++++ glog-0.6.0/src/symbolize_unittest.cc	2019-03-28 20:39:09.755256776 +0100
+@@ -78,9 +78,7 @@ static const char *TrySymbolize(void *pc
  #    endif  // __i386__
  #  else
  #  endif  // __GNUC__ >= 4
@@ -15,7 +15,7 @@ make the code work with all gcc targets
  #endif
  
  // Make them C linkage to avoid mangled names.
-@@ -312,8 +310,9 @@
+@@ -320,8 +318,9 @@ TEST(Symbolize, SymbolizeWithDemanglingS
  extern "C" {
  inline void* always_inline inline_func() {
    void *pc = NULL;
@@ -27,7 +27,7 @@ make the code work with all gcc targets
  #endif
    return pc;
  }
-@@ -321,14 +320,15 @@
+@@ -329,14 +328,15 @@ inline void* always_inline inline_func()
  void* ATTRIBUTE_NOINLINE non_inline_func();
  void* ATTRIBUTE_NOINLINE non_inline_func() {
    void *pc = NULL;
@@ -45,8 +45,8 @@ make the code work with all gcc targets
 +#if defined(TEST_WITH_LABEL_ADDRESSES) && defined(HAVE_ATTRIBUTE_NOINLINE)
    void *pc = non_inline_func();
    const char *symbol = TrySymbolize(pc);
-   CHECK(symbol != NULL);
-@@ -338,7 +338,7 @@
+ 
+@@ -349,7 +349,7 @@ static void ATTRIBUTE_NOINLINE TestWithP
  }
  
  static void ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() {
@@ -54,4 +54,4 @@ make the code work with all gcc targets
 +#if defined(TEST_WITH_LABEL_ADDRESSES) && defined(HAVE_ALWAYS_INLINE)
    void *pc = inline_func();  // Must be inlined.
    const char *symbol = TrySymbolize(pc);
-   CHECK(symbol != NULL);
+ 
diff --git a/glog-gflags.patch b/glog-gflags.patch
deleted file mode 100644
index 2fad3ce..0000000
--- a/glog-gflags.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- 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/b8e8309ddcfaacb3821687f7bcb77fbe5a6d914f



More information about the pld-cvs-commit mailing list