|
| 1 | +inherit: [meson, pkg-config, install, make, patch] |
| 2 | + |
| 3 | +# qemu uses a mix of meson and manual builds, therefore it also has its own not |
| 4 | +# autotools compatible configure. Needs a little bit of adjustment to make this |
| 5 | +# work. |
| 6 | + |
| 7 | +metaEnvironment: |
| 8 | + PKG_VERSION: "10.2.1" |
| 9 | + PKG_LICENSE: "GPL-2.0, LGPL-2.1, MIT, BSD-3-Clause, BSD-2-Clause, Others/BSD-1c" |
| 10 | + |
| 11 | +depends: |
| 12 | + - libs::glib-dev |
| 13 | + |
| 14 | + - use: [] |
| 15 | + depends: |
| 16 | + - libs::glib-tgt |
| 17 | + |
| 18 | +checkoutSCM: |
| 19 | + scm: url |
| 20 | + url: https://download.qemu.org/qemu-${PKG_VERSION}.tar.xz |
| 21 | + digestSHA1: 53ce67b2b57cccac3655c2ea6c4d88283dbef4f7 |
| 22 | + stripComponents: 1 |
| 23 | + |
| 24 | +checkoutDeterministic: True |
| 25 | +checkoutScript: | |
| 26 | + patchApplySeries $<@qemu/*.patch@> |
| 27 | +
|
| 28 | +buildVars: [CC, CXX, CROSS_COMPILE] |
| 29 | +buildToolsWeak: [python3] |
| 30 | +buildTools: [host-toolchain, target-toolchain] |
| 31 | +buildSetup: | |
| 32 | + QEMU_DEFAULT_CONFIGURE_OPTS="\ |
| 33 | + --prefix=/usr \ |
| 34 | + --cross-prefix=$CROSS_COMPILE \ |
| 35 | + --cc=$CC \ |
| 36 | + --cxx=$CXX \ |
| 37 | + --host-cc=gcc \ |
| 38 | + ${MESON_CFLAGS[@]/#/--extra-cflags=} \ |
| 39 | + ${MESON_LDFLAGS[@]/#/--extra-ldflags=} \ |
| 40 | + --disable-containers \ |
| 41 | + --disable-docs \ |
| 42 | + --disable-tsan \ |
| 43 | + --disable-download" |
| 44 | +
|
| 45 | + QEMU_DEFAULT_CONFIGURE_TOOLS_OPTS="\ |
| 46 | + $QEMU_DEFAULT_CONFIGURE_OPTS \ |
| 47 | + --without-default-features \ |
| 48 | + --without-default-devices \ |
| 49 | + --disable-tcg \ |
| 50 | + --enable-fdt=disabled \ |
| 51 | + --target-list=" |
| 52 | +
|
| 53 | +multiPackage: |
| 54 | + "": |
| 55 | + depends: |
| 56 | + - libs::slirp-dev |
| 57 | + - devel::dtc-dev |
| 58 | + - python::pycotap |
| 59 | + |
| 60 | + - use: [] |
| 61 | + depends: |
| 62 | + - libs::slirp-tgt |
| 63 | + - devel::dtc-tgt |
| 64 | + |
| 65 | + # This builds a simple version of qemu. Not a lot of features are |
| 66 | + # turned on. Its mainly for building it on the host and use it for |
| 67 | + # some local testing. |
| 68 | + buildScript: | |
| 69 | + mkdir -p build install |
| 70 | + pushd build |
| 71 | + $1/configure \ |
| 72 | + $QEMU_DEFAULT_CONFIGURE_OPTS \ |
| 73 | + --target-list='aarch64-softmmu arm-softmmu i386-softmmu x86_64-softmmu' |
| 74 | +
|
| 75 | + makeParallel |
| 76 | + makeParallel DESTDIR=$BOB_CWD/install install |
| 77 | + popd |
| 78 | +
|
| 79 | + "img": |
| 80 | + buildScript: | |
| 81 | + mkdir -p build install |
| 82 | + pushd build |
| 83 | + $1/configure \ |
| 84 | + $QEMU_DEFAULT_CONFIGURE_TOOLS_OPTS \ |
| 85 | + --enable-tools |
| 86 | +
|
| 87 | + # only build the required tool |
| 88 | + makeParallel \ |
| 89 | + qemu-img |
| 90 | + popd |
| 91 | +
|
| 92 | + install -D -m 0755 build/qemu-img \ |
| 93 | + install/usr/bin/qemu-img |
| 94 | +
|
| 95 | + "guest-agent": |
| 96 | + buildScript: | |
| 97 | + mkdir -p build install |
| 98 | + pushd build |
| 99 | + $1/configure \ |
| 100 | + $QEMU_DEFAULT_CONFIGURE_TOOLS_OPTS \ |
| 101 | + --enable-guest-agent |
| 102 | +
|
| 103 | + # only build the guest agent |
| 104 | + makeParallel \ |
| 105 | + qemu-ga |
| 106 | + popd |
| 107 | +
|
| 108 | + install -D -m 0755 build/qga/qemu-ga \ |
| 109 | + install/usr/bin/qemu-ga |
| 110 | +
|
| 111 | + "storage-daemon": |
| 112 | + buildScript: | |
| 113 | + mkdir -p build install |
| 114 | + pushd build |
| 115 | + $1/configure \ |
| 116 | + $QEMU_DEFAULT_CONFIGURE_TOOLS_OPTS \ |
| 117 | + --enable-tools \ |
| 118 | + --enable-vhost-user \ |
| 119 | + --enable-vhost-user-blk-server |
| 120 | +
|
| 121 | + # only build the required tool |
| 122 | + makeParallel \ |
| 123 | + storage-daemon/qemu-storage-daemon |
| 124 | + popd |
| 125 | +
|
| 126 | + install -D -m 0755 build/storage-daemon/qemu-storage-daemon \ |
| 127 | + install/usr/bin/qemu-storage-daemon |
| 128 | +
|
| 129 | + "vhost-user-input": |
| 130 | + buildScript: | |
| 131 | + mkdir -p build install |
| 132 | + pushd build |
| 133 | + $1/configure \ |
| 134 | + $QEMU_DEFAULT_CONFIGURE_TOOLS_OPTS \ |
| 135 | + --enable-tools \ |
| 136 | + --enable-vhost-user |
| 137 | +
|
| 138 | + # only build the required tool |
| 139 | + makeParallel \ |
| 140 | + contrib/vhost-user-input/vhost-user-input |
| 141 | + popd |
| 142 | +
|
| 143 | + install -D -m 0755 build/contrib/vhost-user-input/vhost-user-input \ |
| 144 | + install/usr/bin/vhost-user-input |
| 145 | +
|
| 146 | + "vhost-user-blk": |
| 147 | + buildScript: | |
| 148 | + mkdir -p build install |
| 149 | + pushd build |
| 150 | + $1/configure \ |
| 151 | + $QEMU_DEFAULT_CONFIGURE_TOOLS_OPTS \ |
| 152 | + --enable-tools \ |
| 153 | + --enable-vhost-user |
| 154 | +
|
| 155 | + # only build the required tool |
| 156 | + makeParallel \ |
| 157 | + contrib/vhost-user-blk/vhost-user-blk |
| 158 | + popd |
| 159 | +
|
| 160 | + install -D -m 0755 build/contrib/vhost-user-blk/vhost-user-blk \ |
| 161 | + install/usr/bin/vhost-user-blk |
| 162 | +
|
| 163 | + "vhost-user-gpu": |
| 164 | + depends: |
| 165 | + - virtual::libs::libegl-dev |
| 166 | + - virtual::libs::libgles-dev |
| 167 | + - virtual::libs::libdrm-dev |
| 168 | + - libs::pixman-dev |
| 169 | + - libs::libvirglrenderer-dev |
| 170 | + |
| 171 | + - use: [] |
| 172 | + depends: |
| 173 | + - virtual::libs::libegl-tgt |
| 174 | + - virtual::libs::libgles-tgt |
| 175 | + - virtual::libs::libdrm-tgt |
| 176 | + - libs::pixman-tgt |
| 177 | + - libs::libvirglrenderer-tgt |
| 178 | + |
| 179 | + buildScript: | |
| 180 | + mkdir -p build install |
| 181 | + pushd build |
| 182 | + $1/configure \ |
| 183 | + $QEMU_DEFAULT_CONFIGURE_TOOLS_OPTS \ |
| 184 | + --enable-tools \ |
| 185 | + --enable-vhost-user \ |
| 186 | + --enable-pixman \ |
| 187 | + --enable-virglrenderer \ |
| 188 | + --enable-opengl |
| 189 | +
|
| 190 | + # only build the required tool |
| 191 | + makeParallel \ |
| 192 | + contrib/vhost-user-gpu/vhost-user-gpu |
| 193 | + popd |
| 194 | +
|
| 195 | + install -D -m 0755 build/contrib/vhost-user-gpu/vhost-user-gpu \ |
| 196 | + install/usr/bin/vhost-user-gpu |
| 197 | +
|
| 198 | +packageScript: | |
| 199 | + # /usr/share may contain exec/code which should not be stripped. Ignore it |
| 200 | + # in the install step. |
| 201 | + installPackageTgt "$1/install/" "!/usr/share" |
| 202 | + # Now simply copy the unstripped files. |
| 203 | + installCopy "$1/install/" "/usr/" "/usr/share/***" "!*" |
| 204 | +provideDeps: [ "*-tgt" ] |
0 commit comments