protobuf_3.14.0.bb 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. SUMMARY = "Protocol Buffers - structured data serialisation mechanism"
  2. DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \
  3. efficient yet extensible format. Google uses Protocol Buffers for almost \
  4. all of its internal RPC protocols and file formats."
  5. HOMEPAGE = "https://github.com/google/protobuf"
  6. SECTION = "console/tools"
  7. LICENSE = "BSD-3-Clause"
  8. LIC_FILES_CHKSUM = "file://LICENSE;md5=37b5762e07f0af8c74ce80a8bda4266b"
  9. DEPENDS = "zlib"
  10. DEPENDS_append_class-target = " protobuf-native"
  11. SRCREV = "2514f0bd7da7e2af1bed4c5d1b84f031c4d12c10"
  12. SRC_URI = "git://github.com/protocolbuffers/protobuf.git \
  13. file://run-ptest \
  14. file://0001-protobuf-fix-configure-error.patch \
  15. file://0001-Makefile.am-include-descriptor.cc-when-building-libp.patch \
  16. file://0001-examples-Makefile-respect-CXX-LDFLAGS-variables-fix-.patch \
  17. "
  18. S = "${WORKDIR}/git"
  19. inherit autotools-brokensep pkgconfig ptest
  20. PACKAGECONFIG ??= ""
  21. PACKAGECONFIG[python] = ",,"
  22. EXTRA_OECONF += "--with-protoc=echo"
  23. TEST_SRC_DIR = "examples"
  24. LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
  25. do_compile_ptest() {
  26. mkdir -p "${B}/${TEST_SRC_DIR}"
  27. # Add the location of the cross-compiled header and library files
  28. # which haven't been installed yet.
  29. cp "${B}/protobuf.pc" "${B}/${TEST_SRC_DIR}/protobuf.pc"
  30. sed -e 's|libdir=|libdir=${PKG_CONFIG_SYSROOT_DIR}|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
  31. sed -e 's|Cflags:|Cflags: -I${S}/src|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
  32. sed -e 's|Libs:|Libs: -L${B}/src/.libs|' -i "${B}/${TEST_SRC_DIR}/protobuf.pc"
  33. export PKG_CONFIG_PATH="${B}/${TEST_SRC_DIR}"
  34. # Save the pkgcfg sysroot variable, and update it to nothing so
  35. # that it doesn't append the sysroot to the beginning of paths.
  36. # The header and library files aren't installed to the target
  37. # system yet. So the absolute paths were specified above.
  38. save_pkg_config_sysroot_dir=$PKG_CONFIG_SYSROOT_DIR
  39. export PKG_CONFIG_SYSROOT_DIR=
  40. # Compile the tests
  41. for lang in ${LANG_SUPPORT}; do
  42. oe_runmake -C "${S}/${TEST_SRC_DIR}" ${lang}
  43. done
  44. # Restore the pkgconfig sysroot variable
  45. export PKG_CONFIG_SYSROOT_DIR=$save_pkg_config_sysroot_dir
  46. }
  47. do_install_ptest() {
  48. local olddir=`pwd`
  49. cd "${S}/${TEST_SRC_DIR}"
  50. install -d "${D}/${PTEST_PATH}"
  51. for i in add_person* list_people*; do
  52. if [ -x "$i" ]; then
  53. install "$i" "${D}/${PTEST_PATH}"
  54. fi
  55. done
  56. cp "${S}/${TEST_SRC_DIR}/addressbook_pb2.py" "${D}/${PTEST_PATH}"
  57. cd "$olddir"
  58. }
  59. PACKAGE_BEFORE_PN = "${PN}-compiler ${PN}-lite"
  60. FILES_${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
  61. FILES_${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
  62. RDEPENDS_${PN}-compiler = "${PN}"
  63. RDEPENDS_${PN}-dev += "${PN}-compiler"
  64. RDEPENDS_${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}"
  65. MIPS_INSTRUCTION_SET = "mips"
  66. BBCLASSEXTEND = "native nativesdk"
  67. LDFLAGS_append_arm = " -latomic"
  68. LDFLAGS_append_mips = " -latomic"
  69. LDFLAGS_append_powerpc = " -latomic"
  70. LDFLAGS_append_mipsel = " -latomic"