phosphor-led-manager: pass led yaml to build

phosphor-led-manager has migrated from autotools to meson, and it needs
to be built with the correct led.yaml.
This will check if there's a led.yaml in the order of:
1. where LED_YAML_PATH specifies
2. default path of virtual/phosphor-led-manager-config-native
3. where SRC_URI += puts files to
and copies it to the right location.

Tested:
devtool modify phosphor-led-manager and checked if led.yaml is the
right one.
devtool reset, built the image and checked if led-manager are hosting
the correct led groups on dbus.
tried five different scenarios:
1. don't use phosphor-led-manager at all: yosemitev2
2. use config-native: romulus
3. use config-mrw-native: witherspoon
4. overrides the native path: hr855xg2
5. puts led.yaml in SRC_URI: created a custom one and tested that

Signed-off-by: Seires Li <seiresli@pcpartner.com>
Change-Id: Iacfbe633befd3f50f5ea685fd234a49e0eeb7b6f
diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb
index 3167da6..7d4e328 100644
--- a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb
+++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager_git.bb
@@ -52,3 +52,13 @@
 SYSTEMD_OVERRIDE_${PN} += "bmc_booted.conf:obmc-led-group-start@bmc_booted.service.d/bmc_booted.conf"
 
 EXTRA_OEMESON += "-Dtests=disabled"
+
+do_compile_prepend() {
+    if [ -f "${LED_YAML_PATH}/led.yaml" ]; then
+        cp "${LED_YAML_PATH}/led.yaml" "${S}/led.yaml"
+    elif [ -f "${STAGING_DATADIR_NATIVE}/${PN}/led.yaml" ]; then
+        cp "${STAGING_DATADIR_NATIVE}/${PN}/led.yaml" "${S}/led.yaml"
+    elif [ -f "${WORKDIR}/led.yaml" ]; then
+        cp "${WORKDIR}/led.yaml" "${S}/led.yaml"
+    fi
+}