protobuf: add native package to solve self-dependency

The installation of Google Protocol Buffers python header files
requires the ability to run the "protoc" compiler on the host to
generate the Python header files.  This fix adds a native package
that builds Google Protocol Buffers for the host machine to provide
the compiler that is used to cross-compile the package for the target
machine.

Signed-off-by: Keith Holman <Keith.Holman@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Keith Holman 2014-08-20 16:46:11 -04:00 committed by Bruce Ashfield
parent 3cdfb6aac1
commit d6ae4fc295
2 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,21 @@
SUMMARY = "protobuf"
DESCRIPTION = "Protocol Buffers are a way of encoding structured data in \
an efficient yet extensible format. Google uses Protocol Buffers for \
almost all of its internal RPC protocols and file formats."
HOMEPAGE = "http://code.google.com/p/protobuf/"
SECTION = "console/tools"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING.txt;md5=af6809583bfde9a31595a58bb4a24514"
PR = "r0"
SRC_URI[md5sum] = "b751f772bdeb2812a2a8e7202bf1dae8"
SRC_URI[sha256sum] = "c55aa3dc538e6fd5eaf732f4eb6b98bdcb7cedb5b91d3b5bdcf29c98c293f58e"
SRC_URI = "http://protobuf.googlecode.com/files/protobuf-${PV}.tar.gz \
"
EXTRA_OECONF += " --with-protoc=echo --disable-shared"
inherit native autotools

View File

@ -16,10 +16,10 @@ SRC_URI = "http://protobuf.googlecode.com/files/protobuf-${PV}.tar.gz \
file://protobuf-allow-running-python-scripts-from-anywhere.patch \
file://run-ptest"
EXTRA_OECONF += " --with-protoc=echo"
EXTRA_OECONF += " --with-protoc=${STAGING_BINDIR_NATIVE}/protoc"
inherit autotools setuptools ptest
RDEPENDS_${PN}-ptest += "make"
DEPENDS += "protobuf-native"
PYTHON_SRC_DIR="python"
TEST_SRC_DIR="examples"
@ -64,6 +64,7 @@ do_install() {
autotools_do_install
# Install header files
export PROTOC="${STAGING_BINDIR_NATIVE}/protoc"
cd "${S}/${PYTHON_SRC_DIR}"
distutils_do_install
@ -85,4 +86,5 @@ do_install_ptest() {
cd "$olddir"
}
BBCLASSEXTEND = "native nativesdk"
BBCLASSEXTEND = "nativesdk"