Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 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 | |
| 5 | DEPENDS += "breakpad breakpad-native" |
| 6 | |
| 7 | CFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad " |
| 8 | CXXFLAGS += "-I${STAGING_DIR_TARGET}${includedir}/breakpad " |
| 9 | |
| 10 | BREAKPAD_BIN ?= "" |
| 11 | |
| 12 | python () { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 13 | breakpad_bin = d.getVar("BREAKPAD_BIN") |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 14 | |
| 15 | if not breakpad_bin: |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | PN = d.getVar("PN") |
| 17 | FILE = os.path.basename(d.getVar("FILE")) |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 18 | bb.error("To build %s, see breakpad.bbclass for instructions on \ |
| 19 | setting up your Breakpad configuration" % PN) |
| 20 | raise ValueError('BREAKPAD_BIN not defined in %s' % PN) |
| 21 | } |
| 22 | |
| 23 | # Add creation of symbols here |
| 24 | PACKAGE_PREPROCESS_FUNCS += "breakpad_package_preprocess" |
| 25 | breakpad_package_preprocess () { |
| 26 | mkdir -p ${PKGD}/usr/share/breakpad-syms |
| 27 | find ${D} -name ${BREAKPAD_BIN} -exec sh -c "dump_syms {} > ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym" \; |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 28 | HASH=$(head -n1 ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym | rev | cut -d ' ' -f2 | rev) |
| 29 | mkdir -p ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH} |
| 30 | mv ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH} |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | PACKAGES =+ "${PN}-breakpad" |
| 34 | |
| 35 | FILES_${PN}-breakpad = "/usr/share/breakpad-syms" |
| 36 | |