|
| 1 | + |
| 2 | +# These special variables control how BitBake builds the project. |
| 3 | +# |
| 4 | +# Reference: https://docs.yoctoproject.org/bitbake/2.2/bitbake-user-manual/bitbake-user-manual-ref-variables.html |
| 5 | + |
| 6 | +SUMMARY = "Flexible, performant dependency analysis" |
| 7 | +HOMEPAGE = "https://fossa.com" |
| 8 | +LICENSE = "MPL-2.0" |
| 9 | +DEPENDS += "unzip-native" |
| 10 | +INHIBIT_DEFAULT_DEPS = "1" |
| 11 | +LIC_FILES_CHKSUM = "file://LICENSE;md5=815ca599c9df247a0c7f619bab123dad" |
| 12 | +S = "${WORKDIR}/fossa-cli-${PV}" |
| 13 | + |
| 14 | +inherit native |
| 15 | + |
| 16 | +# Every BitBake recipe implicitly inherits `base.bbclass`: https://docs.yoctoproject.org/ref-manual/classes.html#base-bbclass |
| 17 | +# This means that in addition to the tasks defined in this file, implicit tasks are defined. |
| 18 | +# Refer to `meta/classes/base.bbclass` in Poky for the implementation of these implicit tasks |
| 19 | +# and dependencies. |
| 20 | +# |
| 21 | +# In Dunfell, the following is the implicit task ordering: |
| 22 | +# - addtask fetch |
| 23 | +# - addtask unpack after do_fetch |
| 24 | +# - addtask configure after do_patch |
| 25 | +# - addtask compile after do_configure |
| 26 | +# - addtask install after do_compile |
| 27 | +# - addtask build after do_populate_sysroot |
| 28 | +# - addtask cleansstate after do_clean |
| 29 | +# - addtask cleanall after do_cleansstate |
| 30 | +# |
| 31 | +# An observant reader may have noticed that the `fossa` class is inherited in the quickstart, |
| 32 | +# but nothing is explicitly added to depend on this `fossa-cli` recipe. |
| 33 | +# |
| 34 | +# The connection is in the `fossa_upload` class: |
| 35 | +# |
| 36 | +# ``` |
| 37 | +# do_fossa_analyze[depends] = "fossa-cli:do_populate_sysroot" |
| 38 | +# do_fossa_test[deptask] += "fossa-cli:do_populate_sysroot" |
| 39 | +# ``` |
| 40 | +# |
| 41 | +# From the Yocto docs (https://docs.yoctoproject.org/ref-manual/tasks.html#do-populate-sysroot), |
| 42 | +# `do_populate_sysroot` depends on the `do_install` task since it populates files from that task |
| 43 | +# into the sysroot. |
| 44 | +# |
| 45 | +# In turn as we can see in the base class, `do_install` depends on `do_configure`, |
| 46 | +# which depends on `fetch` which starts things off by pulling the `fossa-cli` bundle |
| 47 | +# as part of the configuration step. Note: we delete the do_compile task here as |
| 48 | +# there is nothing to compile for this. |
| 49 | +# |
| 50 | +# While we specify populate_sysroot as the step to perform this, since we are a native |
| 51 | +# recipe installing a binary to be run on the build host, the install phase is applied |
| 52 | +# to sysroot-native. |
| 53 | + |
| 54 | +# https://docs.yoctoproject.org/ref-manual/tasks.html#do-compile |
| 55 | +# |
| 56 | +# Implicitly, before this step is run, the `fetch` and `unpack` tasks are run. |
| 57 | +# These ensure that the source at `SRC_URI` is present in `${S}`. |
| 58 | +# |
| 59 | +# This task downloads `fossa-cli` at the specified version to `${D}`. |
| 60 | +# The version provided to the install script should match the version specified by `${PV}`. |
| 61 | +do_configure() { |
| 62 | + chmod a+x ${S}/install-latest.sh |
| 63 | + ${S}/install-latest.sh -b ${S} -d v${PV} |
| 64 | +} |
| 65 | + |
| 66 | +do_compile[noexec] = "1" |
| 67 | + |
| 68 | +# https://docs.yoctoproject.org/ref-manual/tasks.html#do-install |
| 69 | +# |
| 70 | +# Implicitly, before this step is run the `compile` task is run. |
| 71 | +# |
| 72 | +# This task installs the downloaded `fossa` binary to the BitBake binary directory |
| 73 | +# for invocation. |
| 74 | +do_install() { |
| 75 | + install -d ${D}${bindir}/ |
| 76 | + install -m 0755 ${S}/fossa ${D}${bindir}/fossa |
| 77 | +} |
| 78 | + |
| 79 | +INSANE_SKIP_${PN} += "already-stripped" |
0 commit comments