[vlc-commits] contrib: add protobuf
Felix Paul Kühne
git at videolan.org
Wed Oct 1 11:19:38 CEST 2014
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Aug 25 17:47:12 2014 +0200| [1ffac5a961ed48331f5bc67dd68a3050e32e98d2] | committer: Adrien Maglo
contrib: add protobuf
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ffac5a961ed48331f5bc67dd68a3050e32e98d2
---
contrib/src/protobuf/SHA512SUMS | 1 +
contrib/src/protobuf/rules.mak | 33 +++++++++++++++++++++++++++++++++
contrib/src/protobuf/win32.patch | 28 ++++++++++++++++++++++++++++
3 files changed, 62 insertions(+)
diff --git a/contrib/src/protobuf/SHA512SUMS b/contrib/src/protobuf/SHA512SUMS
new file mode 100644
index 0000000..1367522
--- /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 0000000..9fbd339
--- /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 0000000..c3df1ec
--- /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 {
More information about the vlc-commits
mailing list