breakpad.bbclass 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Class to inherit when you want to build against Breakpad.
  2. # Apart from inheriting this class, you need to set BREAKPAD_BIN in
  3. # your recipe, and make sure that you link against libbreakpad_client.a.
  4. DEPENDS += "breakpad breakpad-native"
  5. CFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad "
  6. CXXFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad "
  7. BREAKPAD_BIN ?= ""
  8. python () {
  9. breakpad_bin = d.getVar("BREAKPAD_BIN")
  10. if not breakpad_bin:
  11. PN = d.getVar("PN")
  12. FILE = os.path.basename(d.getVar("FILE"))
  13. bb.error("To build %s, see breakpad.bbclass for instructions on \
  14. setting up your Breakpad configuration" % PN)
  15. raise ValueError('BREAKPAD_BIN not defined in %s' % PN)
  16. }
  17. # Add creation of symbols here
  18. PACKAGE_PREPROCESS_FUNCS += "breakpad_package_preprocess"
  19. breakpad_package_preprocess () {
  20. mkdir -p ${PKGD}/usr/share/breakpad-syms
  21. find ${D} -name ${BREAKPAD_BIN} -exec sh -c "dump_syms {} > ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym" \;
  22. HASH=$(head -n1 ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym | rev | cut -d ' ' -f2 | rev)
  23. mkdir -p ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH}
  24. mv ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH}
  25. }
  26. PACKAGES =+ "${PN}-breakpad"
  27. FILES_${PN}-breakpad = "/usr/share/breakpad-syms"