Brad Bishop | 286d45c | 2018-10-02 15:21:57 -0400 | [diff] [blame^] | 1 | |
| 2 | python () { |
| 3 | if d.getVar("PREFERRED_PROVIDER_qemu-helper-native") != d.getVar("PN"): |
| 4 | raise bb.parse.SkipRecipe("Set qemu-helper-native provider to use this recipe") |
| 5 | } |
| 6 | |
| 7 | def get_filespath_extra(d, subpath): |
| 8 | metaroot = next((p for p in d.getVar('BBPATH').split(':') if os.path.basename(p) == 'meta'), None) |
| 9 | if metaroot: |
| 10 | return os.path.join(metaroot, subpath) + ":" |
| 11 | return "" |
| 12 | |
| 13 | # TODO: improve this, since it is very hacky that this recipe need to build tunctl. |
| 14 | # include the existing qemu-helper-native |
| 15 | require recipes-devtools/qemu/qemu-helper-native_1.0.bb |
| 16 | # get the path to tunctl.c |
| 17 | FILESEXTRAPATHS_prepend := "${@get_filespath_extra(d, 'recipes-devtools/qemu/qemu-helper')}" |
| 18 | |
| 19 | # provide it, to replace the existing |
| 20 | PROVIDES += "qemu-helper-native" |
| 21 | |
| 22 | # replace qemu with qemu-xilinx |
| 23 | DEPENDS_remove = "qemu-native" |
| 24 | DEPENDS_append = " \ |
| 25 | qemu-xilinx-native \ |
| 26 | qemu-xilinx-multiarch-helper-native \ |
| 27 | " |
| 28 | |