diff --git a/contrib/src/protobuf/SHA512SUMS b/contrib/src/protobuf/SHA512SUMS new file mode 100644 index 0000000000..1367522645 --- /dev/null +++ b/contrib/src/protobuf/SHA512SUMS @@ -0,0 +1 @@ +5994b3669808b82fef5c860ecad36358c0767f84acac877e7bfcf722e59d972835a955714149bdd4158fbd1328a51d01397a563991d26475351ee72be48142ee protobuf-2.5.0.tar.bz2 diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak new file mode 100644 index 0000000000..9fbd339ba9 --- /dev/null +++ b/contrib/src/protobuf/rules.mak @@ -0,0 +1,33 @@ +# protobuf +PROTOBUF_VERSION := 2.5.0 +PROTOBUF_URL := https://protobuf.googlecode.com/files/protobuf-$(PROTOBUF_VERSION).tar.bz2 + +PKGS += protobuf +ifeq ($(call need_pkg,"protobuf"),) +PKGS_FOUND += protobuf +endif + +$(TARBALLS)/protobuf-$(PROTOBUF_VERSION).tar.bz2: + $(call download,$(PROTOBUF_URL)) + +.sum-protobuf: protobuf-$(PROTOBUF_VERSION).tar.bz2 + +DEPS_protobuf = zlib $(DEPS_zlib) + +protobuf: protobuf-$(PROTOBUF_VERSION).tar.bz2 .sum-protobuf + $(UNPACK) +ifdef HAVE_WIN32 + $(APPLY) $(SRC)/protobuf/win32.patch +endif + $(MOVE) + +.protobuf: protobuf + $(RECONF) +# Local protoc Compiler +ifdef HAVE_CROSS_COMPILE + cd $< && ./configure --prefix="$(PREFIX)" && $(MAKE) install + cd $< && $(MAKE) clean +endif + cd $< && $(HOSTVARS) ./configure $(HOSTCONF) --with-protoc=protoc + cd $< && $(MAKE) install + touch $@ diff --git a/contrib/src/protobuf/win32.patch b/contrib/src/protobuf/win32.patch new file mode 100644 index 0000000000..c3df1ec258 --- /dev/null +++ b/contrib/src/protobuf/win32.patch @@ -0,0 +1,28 @@ +diff -ruN protobuf/src/google/protobuf/stubs/common.h protobuf.new/src/google/protobuf/stubs/common.h +--- protobuf/src/google/protobuf/stubs/common.h 2013-02-26 18:56:38.000000000 +0100 ++++ protobuf.new/src/google/protobuf/stubs/common.h 2014-08-13 21:27:13.620935659 +0200 +@@ -619,6 +619,10 @@ + // =================================================================== + // emulates google3/base/logging.h + ++#if defined(ERROR) ++# undef ERROR ++#endif ++ + enum LogLevel { + LOGLEVEL_INFO, // Informational. This is never actually used by + // libprotobuf. +diff -ruN protobuf/src/google/protobuf/extension_set.cc protobuf.new/src/google/protobuf/extension_set.cc +--- protobuf/src/google/protobuf/extension_set.cc 2013-02-26 18:56:42.000000000 +0100 ++++ protobuf.new/src/google/protobuf/extension_set.cc 2014-08-13 21:23:50.960935943 +0200 +@@ -218,6 +218,10 @@ + // =================================================================== + // Field accessors + ++#if defined(OPTIONAL) ++# undef OPTIONAL ++#endif ++ + namespace { + + enum Cardinality {