]> git.pld-linux.org Git - packages/protobuf.git/blob - system-gtest.patch
- updated to 3.1.0 (note: new sonames)
[packages/protobuf.git] / system-gtest.patch
1 --- protobuf-3.1.0/autogen.sh.orig      2016-12-29 21:02:59.643624708 +0100
2 +++ protobuf-3.1.0/autogen.sh   2016-12-29 21:03:02.716958006 +0100
3 @@ -27,21 +27,6 @@
4    exit 1
5  fi
6  
7 -# Check that gmock is present.  Usually it is already there since the
8 -# directory is set up as an SVN external.
9 -if test ! -e gmock; then
10 -  echo "Google Mock not present.  Fetching gmock-1.7.0 from the web..."
11 -  curl $curlopts -L -O https://github.com/google/googlemock/archive/release-1.7.0.zip
12 -  unzip -q release-1.7.0.zip
13 -  rm release-1.7.0.zip
14 -  mv googlemock-release-1.7.0 gmock
15 -
16 -  curl $curlopts -L -O https://github.com/google/googletest/archive/release-1.7.0.zip
17 -  unzip -q release-1.7.0.zip
18 -  rm release-1.7.0.zip
19 -  mv googletest-release-1.7.0 gmock/gtest
20 -fi
21 -
22  set -ex
23  
24  # TODO(kenton):  Remove the ",no-obsolete" part and fix the resulting warnings.
25 --- protobuf-3.1.0/Makefile.am.orig     2016-09-24 04:12:45.000000000 +0200
26 +++ protobuf-3.1.0/Makefile.am  2016-12-29 21:03:50.640290792 +0100
27 @@ -11,28 +11,8 @@
28  # Always include gmock in distributions.
29  DIST_SUBDIRS = $(subdirs) src conformance benchmarks
30  
31 -# Build gmock before we build protobuf tests.  We don't add gmock to SUBDIRS
32 -# because then "make check" would also build and run all of gmock's own tests,
33 -# which takes a lot of time and is generally not useful to us.  Also, we don't
34 -# want "make install" to recurse into gmock since we don't want to overwrite
35 -# the installed version of gmock if there is one.
36 -check-local:
37 -       @echo "Making lib/libgmock.a lib/libgmock_main.a in gmock"
38 -       @cd gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
39 -       @cd gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
40 -
41 -# We would like to clean gmock when "make clean" is invoked.  But we have to
42 -# be careful because clean-local is also invoked during "make distclean", but
43 -# "make distclean" already recurses into gmock because it's listed among the
44 -# DIST_SUBDIRS.  distclean will delete gmock/Makefile, so if we then try to
45 -# cd to the directory again and "make clean" it will fail.  So, check that the
46 -# Makefile exists before recursing.
47  clean-local:
48 -       @if test -e gmock/Makefile; then \
49 -         echo "Making clean in gmock"; \
50 -         cd gmock && $(MAKE) $(AM_MAKEFLAGS) clean; \
51 -       fi; \
52 -       if test -e conformance/Makefile; then \
53 +       @if test -e conformance/Makefile; then \
54           echo "Making clean in conformance"; \
55           cd conformance && $(MAKE) $(AM_MAKEFLAGS) clean; \
56         fi; \
57 --- protobuf-3.1.0/src/Makefile.am.orig 2016-12-29 21:01:17.820292537 +0100
58 +++ protobuf-3.1.0/src/Makefile.am      2016-12-29 21:32:14.440271338 +0100
59 @@ -693,15 +693,22 @@
60    google/protobuf/testing/file.cc                              \
61    google/protobuf/testing/file.h
62  
63 +gmock_dir = /usr/src/gmock/src
64 +gmock_inc_dir = /usr/src/gmock/src
65 +gtest_inc_dir = /usr/include/gtest
66 +check_LTLIBRARIES = libgmock.la libgmock_main.la
67 +libgmock_la_SOURCES = ./gmock-all.cc
68 +libgmock_main_la_SOURCES = ./gmock_main.cc
69 +
70  check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
71                   protobuf-lite-test test_plugin protobuf-lite-arena-test \
72                   no-warning-test $(GZCHECKPROGRAMS)
73  protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
74 -                      ../gmock/gtest/lib/libgtest.la              \
75 -                      ../gmock/lib/libgmock.la                    \
76 -                      ../gmock/lib/libgmock_main.la
77 -protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \
78 -                         -I$(srcdir)/../gmock/include
79 +                      -lgtest              \
80 +                      libgmock_main.la                    \
81 +                      libgmock.la
82 +protobuf_test_CPPFLAGS = -I$(gtest_inc_dir) \
83 +                         -I$(gmock_inc_dir)
84  # Disable optimization for tests unless the user explicitly asked for it,
85  # since test_util.cc takes forever to compile with optimization (with GCC).
86  # See configure.ac for more info.
87 @@ -784,11 +790,11 @@
88  # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
89  protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
90                        libprotoc.la                                   \
91 -                      ../gmock/gtest/lib/libgtest.la                 \
92 -                      ../gmock/lib/libgmock.la                       \
93 -                      ../gmock/lib/libgmock_main.la
94 -protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
95 -                                         -I$(srcdir)/../gmock/gtest/include \
96 +                      -lgtest                 \
97 +                      libgmock_main.la                       \
98 +                      libgmock.la
99 +protobuf_lazy_descriptor_test_CPPFLAGS = -I$(gmock_dir)       \
100 +                                         -I$(gtest_inc_dir) \
101                                           -DPROTOBUF_TEST_NO_DESCRIPTORS
102  protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
103  protobuf_lazy_descriptor_test_SOURCES =                        \
104 @@ -819,11 +825,11 @@
105  # gtest when building the test internally our memory sanitizer doesn't detect
106  # memory leaks (don't know why).
107  protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
108 -                      ../gmock/gtest/lib/libgtest.la                 \
109 -                      ../gmock/lib/libgmock.la                       \
110 -                      ../gmock/lib/libgmock_main.la
111 -protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
112 -                                    -I$(srcdir)/../gmock/gtest/include
113 +                      -lgtest                 \
114 +                      libgmock_main.la                       \
115 +                      libgmock.la
116 +protobuf_lite_arena_test_CPPFLAGS = -I$(gmock_inc_dir)       \
117 +                                    -I$(gtest_inc_dir)
118  protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
119  protobuf_lite_arena_test_SOURCES =       \
120    google/protobuf/lite_arena_unittest.cc \
121 @@ -832,8 +838,8 @@
122  
123  # Test plugin binary.
124  test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
125 -                    ../gmock/gtest/lib/libgtest.la
126 -test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
127 +                    -lgtest
128 +test_plugin_CPPFLAGS = -I$(gmock_inc_dir)
129  test_plugin_SOURCES =                                          \
130    google/protobuf/compiler/mock_code_generator.cc              \
131    google/protobuf/testing/file.cc                              \
132 @@ -862,9 +868,9 @@
133         echo "TEST(NoWarningTest, Empty) {}" >> no_warning_test.cc
134  
135  no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la      \
136 -                        ../gmock/gtest/lib/libgtest.la      \
137 -                        ../gmock/gtest/lib/libgtest_main.la
138 -no_warning_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
139 +                        -lgtest      \
140 +                        -lgtest_main
141 +no_warning_test_CPPFLAGS = -I$(gtest_inc_dir)
142  no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
143                             -Wall -Werror
144  nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)
This page took 0.087826 seconds and 3 git commands to generate.