Merge pull request #1561 from LuaAndC/protobuf-native

protobuf: update to 3.1.0 and compile host protoc as native package
This commit is contained in:
Boris Nagaev 2016-12-01 21:36:26 +00:00 committed by GitHub
commit 783dc94a0d
4 changed files with 65 additions and 21 deletions

View File

@ -1454,6 +1454,14 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
<td class="package">gnutls</td>
<td class="website"><a href="https://www.gnu.org/software/gnutls/">GnuTLS</a></td>
</tr>
<tr>
<td class="package">googlemock</td>
<td class="website"><a href="https://github.com/google/googlemock">Google Mock</a></td>
</tr>
<tr>
<td class="package">googletest</td>
<td class="website"><a href="https://github.com/google/googletest">Google Test</a></td>
</tr>
<tr>
<td class="package">graphicsmagick</td>
<td class="website"><a href="http://www.graphicsmagick.org/">GraphicsMagick</a></td>

15
src/googlemock.mk Normal file
View File

@ -0,0 +1,15 @@
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := googlemock
$(PKG)_IGNORE :=
$(PKG)_VERSION := 1.7.0
$(PKG)_CHECKSUM := 3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232
$(PKG)_SUBDIR := googlemock-release-$($(PKG)_VERSION)
$(PKG)_FILE := googlemock-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := https://github.com/google/googlemock/archive/release-$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS :=
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
define $(PKG)_UPDATE
$(call MXE_GET_GITHUB_TAGS, google/googlemock, release-)
endef

16
src/googletest.mk Normal file
View File

@ -0,0 +1,16 @@
# This file is part of MXE.
# See index.html for further information.
PKG := googletest
$(PKG)_IGNORE :=
$(PKG)_VERSION := 1.7.0
$(PKG)_CHECKSUM := f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc
$(PKG)_SUBDIR := $(PKG)-release-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := https://github.com/google/$(PKG)/archive/release-$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS :=
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
define $(PKG)_UPDATE
$(call MXE_GET_GITHUB_TAGS, google/googletest, release-)
endef

View File

@ -2,34 +2,39 @@
PKG := protobuf
$(PKG)_IGNORE :=
$(PKG)_VERSION := 2.6.1
$(PKG)_CHECKSUM := dbbd7bdd2381633995404de65a945ff1a7610b0da14593051b4738c90c6dd164
$(PKG)_VERSION := 3.1.0
$(PKG)_CHECKSUM := 0a0ae63cbffc274efb573bdde9a253e3f32e458c41261df51c5dbc5ad541e8f7
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := https://github.com/google/protobuf/releases/download/v$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_DEPS := gcc zlib
$(PKG)_URL := https://github.com/google/$(PKG)/archive/v$($(PKG)_VERSION).tar.gz
$(PKG)_DEPS := gcc zlib googlemock googletest
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
$(PKG)_DEPS_$(BUILD) := googlemock googletest
define $(PKG)_UPDATE
$(call MXE_GET_GITHUB_TAGS, google/protobuf, v)
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' '$(PREFIX)/bin/$(TARGET)-protoc'
$(MAKE) -C '$(1)' -j 1 distclean
# Second step: Build for target system.
cd '$(1)' && ./configure \
$(MXE_CONFIGURE_OPTS) \
--with-zlib \
--with-protoc='$(PREFIX)/bin/$(TARGET)-protoc'
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)' -j 1 install
$(call PREPARE_PKG_SOURCE,googlemock,$(SOURCE_DIR))
cd '$(SOURCE_DIR)' && mv '$(googlemock_SUBDIR)' gmock
$(call PREPARE_PKG_SOURCE,googletest,$(SOURCE_DIR))
cd '$(SOURCE_DIR)' && mv '$(googletest_SUBDIR)' gmock/gtest
cd '$(SOURCE_DIR)' && ./autogen.sh
'$(TARGET)-g++' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-protobuf.exe' \
`'$(TARGET)-pkg-config' protobuf --cflags --libs`
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)'/configure \
$(MXE_CONFIGURE_OPTS) \
$(if $(BUILD_CROSS), \
--with-zlib \
--with-protoc='$(PREFIX)/$(BUILD)/bin/protoc' \
)
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
$(if $(BUILD_CROSS),
'$(TARGET)-g++' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-protobuf.exe' \
`'$(TARGET)-pkg-config' protobuf --cflags --libs`
)
endef