# HG changeset patch # User mabrand # Date 1347999072 25200 # Node ID 24b754ef1d76d04623947bd379dbac6a0b41751a # Parent 8fbf0cc2ca6f0fff8a3e2d4b9ddad98bebcd90db# Parent a69eb5b6d9a52551725fe133c46ca65954cee384 Merge pull request #82 from lotodore/master Add package protobuf diff -r 8fbf0cc2ca6f -r 24b754ef1d76 index.html --- a/index.html Tue Sep 18 12:00:02 2012 +0200 +++ b/index.html Tue Sep 18 13:11:12 2012 -0700 @@ -1759,6 +1759,11 @@ proj + protobuf + 2.4.1 + protobuf + + pthreads 2-9-1 Pthreads-w32 diff -r 8fbf0cc2ca6f -r 24b754ef1d76 src/protobuf-test.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/protobuf-test.cpp Tue Sep 18 13:11:12 2012 -0700 @@ -0,0 +1,9 @@ +#include + +int +main() +{ + GOOGLE_PROTOBUF_VERIFY_VERSION; + google::protobuf::ShutdownProtobufLibrary(); + return 0; +} diff -r 8fbf0cc2ca6f -r 24b754ef1d76 src/protobuf.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/protobuf.mk Tue Sep 18 13:11:12 2012 -0700 @@ -0,0 +1,39 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := protobuf +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := df5867e37a4b51fb69f53a8baf5b994938691d6d +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 +$(PKG)_URL := http://protobuf.googlecode.com/files/$($(PKG)_FILE) +$(PKG)_DEPS := gcc zlib + +define $(PKG)_UPDATE + $(WGET) -q -O- 'http://code.google.com/p/protobuf/downloads/list?sort=-uploaded' | \ + $(SED) -n 's,.*protobuf-\([0-9][^<]*\)\.tar.*,\1,p' | \ + head -1 +endef + +define $(PKG)_BUILD +# First step: Build for host system in order to create "protoc" binary. + cd '$(1)' && ./configure \ + --disable-shared + $(MAKE) -C '$(1)' -j '$(JOBS)' + cp '$(1)/src/protoc' '$(1)/src/protoc_host' + $(MAKE) -C '$(1)' -j 1 distclean +# Second step: Build for target system. + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --prefix='$(PREFIX)/$(TARGET)' \ + --disable-shared \ + --with-zlib \ + --with-protoc=src/protoc_host + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-protobuf.exe' \ + `'$(TARGET)-pkg-config' protobuf --cflags --libs` +endef