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