[vlc-devel] [PATCH 2/5] contrib: add protobuf

magsoft at videolan.org magsoft at videolan.org
Wed Aug 20 10:38:18 CEST 2014


From: Felix Paul Kühne <fkuehne at videolan.org>

---
 contrib/src/protobuf/SHA512SUMS  |  1 +
 contrib/src/protobuf/rules.mak   | 26 ++++++++++++++++++++++++++
 contrib/src/protobuf/win32.patch | 28 ++++++++++++++++++++++++++++
 3 files changed, 55 insertions(+)
 create mode 100644 contrib/src/protobuf/SHA512SUMS
 create mode 100644 contrib/src/protobuf/rules.mak
 create mode 100644 contrib/src/protobuf/win32.patch

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..77e9a53
--- /dev/null
+++ b/contrib/src/protobuf/rules.mak
@@ -0,0 +1,26 @@
+# protobuf
+
+PROTOBUF_VERSION := 2.5.0
+
+PROTOBUF_URL := https://protobuf.googlecode.com/files/protobuf-$(PROTOBUF_VERSION).tar.bz2
+
+PKGS += protobuf
+DEPS_protobuf = zlib
+
+$(TARBALLS)/protobuf-$(PROTOBUF_VERSION).tar.bz2:
+	$(call download,$(PROTOBUF_URL))
+
+.sum-protobuf: protobuf-$(PROTOBUF_VERSION).tar.bz2
+
+protobuf: protobuf-$(PROTOBUF_VERSION).tar.bz2 .sum-protobuf
+	$(UNPACK)
+ifdef HAVE_WIN32
+	$(APPLY) $(SRC)/protobuf/win32.patch
+endif
+	$(MOVE)
+
+.protobuf: protobuf
+	$(RECONF)
+	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..5137031
--- /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 {
-- 
1.9.1




More information about the vlc-devel mailing list