summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-devtools/qemu/qemu-alt.inc
blob: c18a5326571284b7f2bd48e9c5ff96af57d0bbb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
PROVIDES += "qemu"

# Skip processing of this recipe if it is not explicitly specified as the
# PREFERRED_PROVIDER for qemu-syste-native. This avoids network access required by
# the use of AUTOREV SRCREVs, which may be the default for some recipes.
python () {
    if bb.data.inherits_class('nativesdk', d):
        if (not d.getVar("PREFERRED_PROVIDER_nativesdk-qemu") and "nativesdk-qemu" != d.getVar("PN")) or \
           (d.getVar("PREFERRED_PROVIDER_nativesdk-qemu") and d.getVar("PREFERRED_PROVIDER_nativesdk-qemu") != d.getVar("PN")):
            d.delVar("BB_DONT_CACHE")
            raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_nativesdk-qemu to %s to enable it" % (d.getVar("PN")))
    elif (not d.getVar("PREFERRED_PROVIDER_qemu") and "qemu" != d.getVar("PN")) or \
       (d.getVar("PREFERRED_PROVIDER_qemu") and d.getVar("PREFERRED_PROVIDER_qemu") != d.getVar("PN")):
        d.delVar("BB_DONT_CACHE")
        raise bb.parse.SkipRecipe("Set PREFERRED_PROVIDER_qemu to %s to enable it" % (d.getVar("PN")))

    if (d.getVar('BPN') != 'qemu'):
        for pkg in d.getVar('PACKAGES').split():
            d.appendVar('RPROVIDES:%s' % pkg, ' ' + pkg.replace(d.getVar('PN'), 'qemu'))

        for pkg in d.getVar('PACKAGES_DYNAMIC').split():
            d.appendVar('PACKAGES_DYNAMIC', ' ' + pkg.replace(d.getVar('PN'), 'qemu'))
}

# From Poky qemu.inc
# Modified to add compatibility RPROVIDES
python split_qemu_packages () {
    archdir = d.expand('${bindir}/')
    syspackages = do_split_packages(d, archdir, r'^qemu-system-(.*)$', '${PN}-system-%s', 'QEMU full system emulation binaries(%s)' , prepend=True)
    if syspackages:
        d.setVar('RDEPENDS:' + d.getVar('PN') + '-system-all', ' '.join(syspackages))

        if (d.getVar('BPN') != 'qemu'):
            for pkg in syspackages:
                d.appendVar('RPROVIDES:%s' % pkg, ' ' + pkg.replace(d.getVar('PN'), 'qemu'))

    userpackages = do_split_packages(d, archdir, r'^qemu-((?!system|edid|ga|img|io|nbd|pr-helper|storage-daemon).*)$', '${PN}-user-%s', 'QEMU full user emulation binaries(%s)' , prepend=True)
    if userpackages:
        d.setVar('RDEPENDS:' + d.getVar('PN') + '-user-all', ' '.join(userpackages))

        if (d.getVar('BPN') != 'qemu'):
            for pkg in userpackages:
                d.appendVar('RPROVIDES:%s' % pkg, ' ' + pkg.replace(d.getVar('PN'), 'qemu'))

    mipspackage = d.getVar('PN') + "-user-mips"
    if mipspackage in ' '.join(userpackages):
        d.appendVar('RDEPENDS:' + mipspackage, ' ' + d.getVar("MLPREFIX") + 'bash')

        if (d.getVar('BPN') != 'qemu'):
            for pkg in mipspackage:
                d.appendVar('RPROVIDES:%s' % pkg, ' ' + pkg.replace(d.getVar('PN'), 'qemu'))
}