1 |
commit: 31a13e419383fdfd86b52bc8d65cb0b063353e7b |
2 |
Author: Aric Belsito <lluixhi <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Dec 29 21:44:56 2016 +0000 |
4 |
Commit: Aric Belsito <lluixhi <AT> gmail <DOT> com> |
5 |
CommitDate: Thu Dec 29 21:44:56 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=31a13e41 |
7 |
|
8 |
app-emulation/qemu: Version bump to 2.7.1 |
9 |
|
10 |
app-emulation/qemu/Manifest | 2 + |
11 |
app-emulation/qemu/qemu-2.7.1.ebuild | 705 +++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 707 insertions(+) |
13 |
|
14 |
diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest |
15 |
index 89b8304..f1a94d8 100644 |
16 |
--- a/app-emulation/qemu/Manifest |
17 |
+++ b/app-emulation/qemu/Manifest |
18 |
@@ -36,5 +36,7 @@ AUX qemu-2.7.0-CVE-2016-9106.patch 835 SHA256 594213b4200ae109dfbc6ec8e536d275d7 |
19 |
AUX qemu-2.7.0-configure-ifunc.patch 517 SHA256 40f6183f1f490216855e83cf03bf21ec8d23786acf83cda21292fea92776d898 SHA512 e34476b5fc5039091862dc9e93c47b69e203e7e394092e7e0bda467b7523e0b5b743c2c6eaf1f36fad3ee743278e321a50d356b6365e2340280556ca6d9b32ad WHIRLPOOL cb6f92a70f91557f14a0f6719d1b3a4dee9cfcb5c34aa897eee0ad48d13c45255252666d826ce00f3183da86b9b265e0dd93aa9b85210cde2a7ce3de56644e59 |
20 |
AUX qemu-binfmt.initd-r1 7966 SHA256 5b4b432aa1e44f387c9eb789de0ec6322741fd36dd241f76520f17c6cd6ac49b SHA512 2ba0bff6eb2b6bac4ed440f793771ce9551cad48e38bddb6cf04f804faac2407e80879f66771910344ddcea45f0014095dcc8bfeb0aad5085ef048fd3612dbd8 WHIRLPOOL a2a1fb830a970757d1e203378c7d382b161b1040f3b8aaf0f22bb3b5e46467eff395474ff40d93c9f133bab307b345a6f75d63eae9f8dd8daf67324db41032f9 |
21 |
DIST qemu-2.7.0.tar.bz2 26867760 SHA256 326e739506ba690daf69fc17bd3913a6c313d9928d743bd8eddb82f403f81e53 SHA512 654acaa7b3724a288e5d7e2a26ab780d9c9ed9f647fba00a906cbaffbe9d58fd666f2d962514aa2c5b391b4c53811ac3170d2eb51727f090bd19dfe45ca9a9db WHIRLPOOL dcb3e5f7da89dd8e14d636d7ebd476e076e0043880bb9ea3fb1c03cb4bcd4e5c7d3c4719da26c3ce521e3a3db5ae671e86f198ac1bc3474e774d75504fef8b8d |
22 |
+DIST qemu-2.7.1.tar.bz2 26868403 SHA256 68636788eb69bcb0b44ba220b32b50495d6bd5712a934c282217831c4822958f SHA512 16a83946e9064733254c82c961749bf9c56a0a2a8ee46145b4a78e1452ac0e2548d888963d18c80e28f65202890fd643b0011951b5b1c66ef16234767ed91898 WHIRLPOOL ae3d3c2b2a3700613733659847de6187755631cb09e8c3548ea30cd994357c9ff128646edce88dfe4dce53e6c1c0f37f8de3688ee7e22262033b40f3fc706efa |
23 |
EBUILD qemu-2.7.0-r7.ebuild 22495 SHA256 a606d5b6805d24191245b4191c1f62a09096d8ee283c62629f038851b4c8e6c5 SHA512 c45e516c4c45b5a1eaec06d046cebf129f1422c2d5910699c0a367a4c8c7d49e323a6addc765e1ec57209df12270e196169e52a7618afef28019be06feff70ea WHIRLPOOL 94ae6ab13fc03450ce5b6b0e5840e488401116d6bf60ec411cc01f39f2d10931bd65572f25bdf958e9f94bb4f6582795018039b5b4c988fa3bd5dee928014c65 |
24 |
+EBUILD qemu-2.7.1.ebuild 22161 SHA256 a7d2ff5c706a35a1b2c5610866215a5db04674ce68fb01e3e076b68839dcafd8 SHA512 7d30615832f2fecf89b472c4ea56446335176a330a7d64693ed7cc9becd47a1f40064fca191467deb8603116b4f69307d7968971c9b3845356b8b8d4cf053472 WHIRLPOOL 23bda8ca28ff8620739c604289a0d81ec4d16c1908b8c02df7833f9c0d98f698922650636456ac0bcc285357836af23ffd28bf3b8c2653a690a86fa5ae662a61 |
25 |
MISC metadata.xml 3925 SHA256 d1c219b7da0cbf77919cd1e055acbb3f6788a574fd802c98a43c89a411697b36 SHA512 3ff45d1c8ede12b4eedc7d01f39777b76a1cbd0ba9364299dec99d4b4a05cade5784d6f6e50197d5b5ae1f1b8e831c49da195eb53263c49b7d16aec8ee28b6e6 WHIRLPOOL bc25783fac0f3f13318834cc535404af9af20de16c7aeec222e59dc2ed7740ac5e767b329a5bcd6356d0cbae2428e278515f1446aa8ecb87a873bf4dbe04bf41 |
26 |
|
27 |
diff --git a/app-emulation/qemu/qemu-2.7.1.ebuild b/app-emulation/qemu/qemu-2.7.1.ebuild |
28 |
new file mode 100644 |
29 |
index 0000000..49087c8 |
30 |
--- /dev/null |
31 |
+++ b/app-emulation/qemu/qemu-2.7.1.ebuild |
32 |
@@ -0,0 +1,705 @@ |
33 |
+# Copyright 1999-2016 Gentoo Foundation |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI="5" |
37 |
+ |
38 |
+PYTHON_COMPAT=( python2_7 ) |
39 |
+PYTHON_REQ_USE="ncurses,readline" |
40 |
+ |
41 |
+PLOCALES="bg de_DE fr_FR hu it tr zh_CN" |
42 |
+ |
43 |
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \ |
44 |
+ user udev fcaps readme.gentoo-r1 pax-utils l10n |
45 |
+ |
46 |
+if [[ ${PV} = *9999* ]]; then |
47 |
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git" |
48 |
+ inherit git-2 |
49 |
+ SRC_URI="" |
50 |
+else |
51 |
+ SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2" |
52 |
+ KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86 ~x86-fbsd" |
53 |
+fi |
54 |
+ |
55 |
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools" |
56 |
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org" |
57 |
+ |
58 |
+LICENSE="GPL-2 LGPL-2 BSD-2" |
59 |
+SLOT="0" |
60 |
+IUSE="accessibility +aio alsa bluetooth bzip2 +caps +curl debug +fdt glusterfs \ |
61 |
+gnutls gtk gtk2 infiniband iscsi +jpeg \ |
62 |
+kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs |
63 |
++png pulseaudio python \ |
64 |
+rbd sasl +seccomp sdl sdl2 selinux smartcard snappy spice ssh static static-softmmu |
65 |
+static-user systemtap tci test +threads usb usbredir +uuid vde +vhost-net \ |
66 |
+virgl virtfs +vnc vte xattr xen xfs" |
67 |
+ |
68 |
+COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips |
69 |
+mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32 |
70 |
+x86_64" |
71 |
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb tricore xtensa xtensaeb" |
72 |
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus tilegx" |
73 |
+ |
74 |
+use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS}) |
75 |
+use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS}) |
76 |
+IUSE+=" ${use_softmmu_targets} ${use_user_targets}" |
77 |
+ |
78 |
+# Allow no targets to be built so that people can get a tools-only build. |
79 |
+# Block USE flag configurations known to not work. |
80 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE} |
81 |
+ gtk2? ( gtk ) |
82 |
+ qemu_softmmu_targets_arm? ( fdt ) |
83 |
+ qemu_softmmu_targets_microblaze? ( fdt ) |
84 |
+ qemu_softmmu_targets_ppc? ( fdt ) |
85 |
+ qemu_softmmu_targets_ppc64? ( fdt ) |
86 |
+ sdl2? ( sdl ) |
87 |
+ static? ( static-softmmu static-user ) |
88 |
+ static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 ) |
89 |
+ virtfs? ( xattr ) |
90 |
+ vte? ( gtk )" |
91 |
+ |
92 |
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap. |
93 |
+# |
94 |
+# The attr lib isn't always linked in (although the USE flag is always |
95 |
+# respected). This is because qemu supports using the C library's API |
96 |
+# when available rather than always using the extranl library. |
97 |
+# |
98 |
+# Older versions of gnutls are supported, but it's simpler to just require |
99 |
+# the latest versions. This is also why we require nettle. |
100 |
+# |
101 |
+# TODO: Split out tools deps into another var. e.g. bzip2 is only used by |
102 |
+# system binaries and tools, not user binaries. |
103 |
+COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)] |
104 |
+ sys-libs/zlib[static-libs(+)] |
105 |
+ bzip2? ( app-arch/bzip2[static-libs(+)] ) |
106 |
+ xattr? ( sys-apps/attr[static-libs(+)] )" |
107 |
+SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND} |
108 |
+ >=x11-libs/pixman-0.28.0[static-libs(+)] |
109 |
+ accessibility? ( app-accessibility/brltty[static-libs(+)] ) |
110 |
+ aio? ( dev-libs/libaio[static-libs(+)] ) |
111 |
+ alsa? ( >=media-libs/alsa-lib-1.0.13 ) |
112 |
+ bluetooth? ( net-wireless/bluez ) |
113 |
+ caps? ( sys-libs/libcap-ng[static-libs(+)] ) |
114 |
+ curl? ( >=net-misc/curl-7.15.4[static-libs(+)] ) |
115 |
+ fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] ) |
116 |
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] ) |
117 |
+ gnutls? ( |
118 |
+ dev-libs/nettle:=[static-libs(+)] |
119 |
+ >=net-libs/gnutls-3.0:=[static-libs(+)] |
120 |
+ ) |
121 |
+ gtk? ( |
122 |
+ gtk2? ( |
123 |
+ x11-libs/gtk+:2 |
124 |
+ vte? ( x11-libs/vte:0 ) |
125 |
+ ) |
126 |
+ !gtk2? ( |
127 |
+ x11-libs/gtk+:3 |
128 |
+ vte? ( x11-libs/vte:2.91 ) |
129 |
+ ) |
130 |
+ ) |
131 |
+ infiniband? ( sys-fabric/librdmacm:=[static-libs(+)] ) |
132 |
+ iscsi? ( net-libs/libiscsi ) |
133 |
+ jpeg? ( virtual/jpeg:0=[static-libs(+)] ) |
134 |
+ lzo? ( dev-libs/lzo:2[static-libs(+)] ) |
135 |
+ ncurses? ( sys-libs/ncurses:0=[static-libs(+)] ) |
136 |
+ nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] ) |
137 |
+ numa? ( sys-process/numactl[static-libs(+)] ) |
138 |
+ opengl? ( |
139 |
+ virtual/opengl |
140 |
+ media-libs/libepoxy[static-libs(+)] |
141 |
+ media-libs/mesa[static-libs(+)] |
142 |
+ media-libs/mesa[egl,gles2,gbm] |
143 |
+ ) |
144 |
+ png? ( media-libs/libpng:0=[static-libs(+)] ) |
145 |
+ pulseaudio? ( media-sound/pulseaudio ) |
146 |
+ rbd? ( sys-cluster/ceph[static-libs(+)] ) |
147 |
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)] ) |
148 |
+ sdl? ( |
149 |
+ !sdl2? ( |
150 |
+ media-libs/libsdl[X] |
151 |
+ >=media-libs/libsdl-1.2.11[static-libs(+)] |
152 |
+ ) |
153 |
+ sdl2? ( |
154 |
+ media-libs/libsdl2[X] |
155 |
+ media-libs/libsdl2[static-libs(+)] |
156 |
+ ) |
157 |
+ ) |
158 |
+ seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] ) |
159 |
+ smartcard? ( >=app-emulation/libcacard-2.5.0[static-libs(+)] ) |
160 |
+ snappy? ( app-arch/snappy[static-libs(+)] ) |
161 |
+ spice? ( |
162 |
+ >=app-emulation/spice-protocol-0.12.3 |
163 |
+ >=app-emulation/spice-0.12.0[static-libs(+)] |
164 |
+ ) |
165 |
+ ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] ) |
166 |
+ usb? ( >=virtual/libusb-1-r2[static-libs(+)] ) |
167 |
+ usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] ) |
168 |
+ uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] ) |
169 |
+ vde? ( net-misc/vde[static-libs(+)] ) |
170 |
+ virgl? ( media-libs/virglrenderer[static-libs(+)] ) |
171 |
+ virtfs? ( sys-libs/libcap ) |
172 |
+ xfs? ( sys-fs/xfsprogs[static-libs(+)] )" |
173 |
+USER_LIB_DEPEND="${COMMON_LIB_DEPEND}" |
174 |
+X86_FIRMWARE_DEPEND=" |
175 |
+ >=sys-firmware/ipxe-1.0.0_p20130624 |
176 |
+ pin-upstream-blobs? ( |
177 |
+ ~sys-firmware/seabios-1.8.2 |
178 |
+ ~sys-firmware/sgabios-0.1_pre8 |
179 |
+ ~sys-firmware/vgabios-0.7a |
180 |
+ ) |
181 |
+ !pin-upstream-blobs? ( |
182 |
+ sys-firmware/seabios |
183 |
+ sys-firmware/sgabios |
184 |
+ sys-firmware/vgabios |
185 |
+ )" |
186 |
+CDEPEND=" |
187 |
+ !static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) ) |
188 |
+ !static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) ) |
189 |
+ qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} ) |
190 |
+ qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} ) |
191 |
+ python? ( ${PYTHON_DEPS} ) |
192 |
+ systemtap? ( dev-util/systemtap ) |
193 |
+ xen? ( app-emulation/xen-tools:= )" |
194 |
+DEPEND="${CDEPEND} |
195 |
+ dev-lang/perl |
196 |
+ =dev-lang/python-2* |
197 |
+ sys-apps/texinfo |
198 |
+ virtual/pkgconfig |
199 |
+ kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 ) |
200 |
+ gtk? ( nls? ( sys-devel/gettext ) ) |
201 |
+ static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) ) |
202 |
+ static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) ) |
203 |
+ test? ( |
204 |
+ dev-libs/glib[utils] |
205 |
+ sys-devel/bc |
206 |
+ )" |
207 |
+RDEPEND="${CDEPEND} |
208 |
+ selinux? ( sec-policy/selinux-qemu ) |
209 |
+" |
210 |
+ |
211 |
+STRIP_MASK="/usr/share/qemu/palcode-clipper" |
212 |
+ |
213 |
+QA_PREBUILT=" |
214 |
+ usr/share/qemu/openbios-ppc |
215 |
+ usr/share/qemu/openbios-sparc64 |
216 |
+ usr/share/qemu/openbios-sparc32 |
217 |
+ usr/share/qemu/palcode-clipper |
218 |
+ usr/share/qemu/s390-ccw.img |
219 |
+ usr/share/qemu/u-boot.e500 |
220 |
+" |
221 |
+ |
222 |
+QA_WX_LOAD="usr/bin/qemu-i386 |
223 |
+ usr/bin/qemu-x86_64 |
224 |
+ usr/bin/qemu-alpha |
225 |
+ usr/bin/qemu-arm |
226 |
+ usr/bin/qemu-cris |
227 |
+ usr/bin/qemu-m68k |
228 |
+ usr/bin/qemu-microblaze |
229 |
+ usr/bin/qemu-microblazeel |
230 |
+ usr/bin/qemu-mips |
231 |
+ usr/bin/qemu-mipsel |
232 |
+ usr/bin/qemu-or32 |
233 |
+ usr/bin/qemu-ppc |
234 |
+ usr/bin/qemu-ppc64 |
235 |
+ usr/bin/qemu-ppc64abi32 |
236 |
+ usr/bin/qemu-sh4 |
237 |
+ usr/bin/qemu-sh4eb |
238 |
+ usr/bin/qemu-sparc |
239 |
+ usr/bin/qemu-sparc64 |
240 |
+ usr/bin/qemu-armeb |
241 |
+ usr/bin/qemu-sparc32plus |
242 |
+ usr/bin/qemu-s390x |
243 |
+ usr/bin/qemu-unicore32" |
244 |
+ |
245 |
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure |
246 |
+you have the kernel module loaded before running kvm. The easiest way to |
247 |
+ensure that the kernel module is loaded is to load it on boot.\n |
248 |
+For AMD CPUs the module is called 'kvm-amd'.\n |
249 |
+For Intel CPUs the module is called 'kvm-intel'.\n |
250 |
+Please review /etc/conf.d/modules for how to load these.\n\n |
251 |
+Make sure your user is in the 'kvm' group\n |
252 |
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login.\n\n |
253 |
+For brand new installs, the default permissions on /dev/kvm might not let you |
254 |
+access it. You can tell udev to reset ownership/perms:\n |
255 |
+udevadm trigger -c add /dev/kvm" |
256 |
+ |
257 |
+qemu_support_kvm() { |
258 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \ |
259 |
+ use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \ |
260 |
+ use qemu_softmmu_targets_s390x; then |
261 |
+ return 0 |
262 |
+ fi |
263 |
+ |
264 |
+ return 1 |
265 |
+} |
266 |
+ |
267 |
+pkg_pretend() { |
268 |
+ if use kernel_linux && kernel_is lt 2 6 25; then |
269 |
+ eerror "This version of KVM requres a host kernel of 2.6.25 or higher." |
270 |
+ elif use kernel_linux; then |
271 |
+ if ! linux_config_exists; then |
272 |
+ eerror "Unable to check your kernel for KVM support" |
273 |
+ else |
274 |
+ CONFIG_CHECK="~KVM ~TUN ~BRIDGE" |
275 |
+ ERROR_KVM="You must enable KVM in your kernel to continue" |
276 |
+ ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in" |
277 |
+ ERROR_KVM_AMD+=" your kernel configuration." |
278 |
+ ERROR_KVM_INTEL="If you have an Intel CPU, you must enable" |
279 |
+ ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration." |
280 |
+ ERROR_TUN="You will need the Universal TUN/TAP driver compiled" |
281 |
+ ERROR_TUN+=" into your kernel or loaded as a module to use the" |
282 |
+ ERROR_TUN+=" virtual network device if using -net tap." |
283 |
+ ERROR_BRIDGE="You will also need support for 802.1d" |
284 |
+ ERROR_BRIDGE+=" Ethernet Bridging for some network configurations." |
285 |
+ use vhost-net && CONFIG_CHECK+=" ~VHOST_NET" |
286 |
+ ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net" |
287 |
+ ERROR_VHOST_NET+=" support" |
288 |
+ |
289 |
+ if use amd64 || use x86 || use amd64-linux || use x86-linux; then |
290 |
+ CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL" |
291 |
+ fi |
292 |
+ |
293 |
+ use python && CONFIG_CHECK+=" ~DEBUG_FS" |
294 |
+ ERROR_DEBUG_FS="debugFS support required for kvm_stat" |
295 |
+ |
296 |
+ # Now do the actual checks setup above |
297 |
+ check_extra_config |
298 |
+ fi |
299 |
+ fi |
300 |
+ |
301 |
+ if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then |
302 |
+ eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt" |
303 |
+ eerror "instances are still pointing to it. Please update your" |
304 |
+ eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag" |
305 |
+ eerror "and the right system binary (e.g. qemu-system-x86_64)." |
306 |
+ die "update your virt configs to not use qemu-kvm" |
307 |
+ fi |
308 |
+} |
309 |
+ |
310 |
+pkg_setup() { |
311 |
+ enewgroup kvm 78 |
312 |
+} |
313 |
+ |
314 |
+# Sanity check to make sure target lists are kept up-to-date. |
315 |
+check_targets() { |
316 |
+ local var=$1 mak=$2 |
317 |
+ local detected sorted |
318 |
+ |
319 |
+ pushd "${S}"/default-configs >/dev/null || die |
320 |
+ |
321 |
+ # Force C locale until glibc is updated. #564936 |
322 |
+ detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | LC_COLLATE=C sort -u)) |
323 |
+ sorted=$(echo $(printf '%s\n' ${!var} | LC_COLLATE=C sort -u)) |
324 |
+ if [[ ${sorted} != "${detected}" ]] ; then |
325 |
+ eerror "The ebuild needs to be kept in sync." |
326 |
+ eerror "${var}: ${sorted}" |
327 |
+ eerror "$(printf '%-*s' ${#var} configure): ${detected}" |
328 |
+ die "sync ${var} to the list of targets" |
329 |
+ fi |
330 |
+ |
331 |
+ popd >/dev/null |
332 |
+} |
333 |
+ |
334 |
+handle_locales() { |
335 |
+ # Make sure locale list is kept up-to-date. |
336 |
+ local detected sorted |
337 |
+ detected=$(echo $(cd po && printf '%s\n' *.po | grep -v messages.po | sed 's:.po$::' | sort -u)) |
338 |
+ sorted=$(echo $(printf '%s\n' ${PLOCALES} | sort -u)) |
339 |
+ if [[ ${sorted} != "${detected}" ]] ; then |
340 |
+ eerror "The ebuild needs to be kept in sync." |
341 |
+ eerror "PLOCALES: ${sorted}" |
342 |
+ eerror " po/*.po: ${detected}" |
343 |
+ die "sync PLOCALES" |
344 |
+ fi |
345 |
+ |
346 |
+ # Deal with selective install of locales. |
347 |
+ if use nls ; then |
348 |
+ # Delete locales the user does not want. #577814 |
349 |
+ rm_loc() { rm po/$1.po || die; } |
350 |
+ l10n_for_each_disabled_locale_do rm_loc |
351 |
+ else |
352 |
+ # Cheap hack to disable gettext .mo generation. |
353 |
+ rm -f po/*.po |
354 |
+ fi |
355 |
+} |
356 |
+ |
357 |
+src_prepare() { |
358 |
+ check_targets IUSE_SOFTMMU_TARGETS softmmu |
359 |
+ check_targets IUSE_USER_TARGETS linux-user |
360 |
+ |
361 |
+ # Alter target makefiles to accept CFLAGS set via flag-o |
362 |
+ sed -i -r \ |
363 |
+ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ |
364 |
+ Makefile Makefile.target || die |
365 |
+ |
366 |
+ # Patching for musl |
367 |
+ epatch "${FILESDIR}"/${PN}-2.0.0-F_SHLCK-and-F_EXLCK.patch |
368 |
+ epatch "${FILESDIR}"/${PN}-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch |
369 |
+ epatch "${FILESDIR}"/${PN}-2.2.0-_sigev_un.patch |
370 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-configure-ifunc.patch |
371 |
+ |
372 |
+ epatch "${FILESDIR}"/${PN}-2.5.0-cflags.patch |
373 |
+ epatch "${FILESDIR}"/${PN}-2.5.0-sysmacros.patch |
374 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-6836.patch #591242 |
375 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7156.patch #593036 |
376 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7170.patch #593284 |
377 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7422.patch #593956 |
378 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7466.patch #594520 |
379 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7907.patch #596048 |
380 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7908.patch #596049 |
381 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7909.patch #596048 |
382 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7994-1.patch #596738 |
383 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-7994-2.patch #596738 |
384 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8576.patch #596752 |
385 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8577.patch #596776 |
386 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8578.patch #596774 |
387 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8668.patch #597110 |
388 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8669-1.patch #597108 |
389 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8669-2.patch #597108 |
390 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-8909.patch #598044 |
391 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-9102.patch #598328 |
392 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-9103.patch #598328 |
393 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-9104.patch #598328 |
394 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-9105.patch #598328 |
395 |
+ epatch "${FILESDIR}"/${PN}-2.7.0-CVE-2016-9106.patch #598772 |
396 |
+ |
397 |
+ # Fix ld and objcopy being called directly |
398 |
+ tc-export AR LD OBJCOPY |
399 |
+ |
400 |
+ # Verbose builds |
401 |
+ MAKEOPTS+=" V=1" |
402 |
+ |
403 |
+ epatch_user |
404 |
+ |
405 |
+ # Run after we've applied all patches. |
406 |
+ handle_locales |
407 |
+} |
408 |
+ |
409 |
+## |
410 |
+# configures qemu based on the build directory and the build type |
411 |
+# we are using. |
412 |
+# |
413 |
+qemu_src_configure() { |
414 |
+ debug-print-function ${FUNCNAME} "$@" |
415 |
+ |
416 |
+ local buildtype=$1 |
417 |
+ local builddir="${S}/${buildtype}-build" |
418 |
+ local static_flag="static-${buildtype}" |
419 |
+ |
420 |
+ mkdir "${builddir}" |
421 |
+ |
422 |
+ local conf_opts=( |
423 |
+ --prefix=/usr |
424 |
+ --sysconfdir=/etc |
425 |
+ --libdir=/usr/$(get_libdir) |
426 |
+ --docdir=/usr/share/doc/${PF}/html |
427 |
+ --disable-bsd-user |
428 |
+ --disable-guest-agent |
429 |
+ --disable-strip |
430 |
+ --disable-werror |
431 |
+ # We support gnutls/nettle for crypto operations. It is possible |
432 |
+ # to use gcrypt when gnutls/nettle are disabled (but not when they |
433 |
+ # are enabled), but it's not really worth the hassle. Disable it |
434 |
+ # all the time to avoid automatically detecting it. #568856 |
435 |
+ --disable-gcrypt |
436 |
+ --python="${PYTHON}" |
437 |
+ --cc="$(tc-getCC)" |
438 |
+ --cxx="$(tc-getCXX)" |
439 |
+ --host-cc="$(tc-getBUILD_CC)" |
440 |
+ $(use_enable debug debug-info) |
441 |
+ $(use_enable debug debug-tcg) |
442 |
+ --enable-docs |
443 |
+ $(use_enable tci tcg-interpreter) |
444 |
+ $(use_enable xattr attr) |
445 |
+ ) |
446 |
+ |
447 |
+ # Disable options not used by user targets as the default configure |
448 |
+ # options will autoprobe and try to link in a bunch of unused junk. |
449 |
+ conf_softmmu() { |
450 |
+ if [[ ${buildtype} == "user" ]] ; then |
451 |
+ echo "--disable-${2:-$1}" |
452 |
+ else |
453 |
+ use_enable "$@" |
454 |
+ fi |
455 |
+ } |
456 |
+ conf_opts+=( |
457 |
+ $(conf_softmmu accessibility brlapi) |
458 |
+ $(conf_softmmu aio linux-aio) |
459 |
+ $(conf_softmmu bzip2) |
460 |
+ $(conf_softmmu bluetooth bluez) |
461 |
+ $(conf_softmmu caps cap-ng) |
462 |
+ $(conf_softmmu curl) |
463 |
+ $(conf_softmmu fdt) |
464 |
+ $(conf_softmmu glusterfs) |
465 |
+ $(conf_softmmu gnutls) |
466 |
+ $(conf_softmmu gnutls nettle) |
467 |
+ $(conf_softmmu gtk) |
468 |
+ $(conf_softmmu infiniband rdma) |
469 |
+ $(conf_softmmu iscsi libiscsi) |
470 |
+ $(conf_softmmu jpeg vnc-jpeg) |
471 |
+ $(conf_softmmu kernel_linux kvm) |
472 |
+ $(conf_softmmu lzo) |
473 |
+ $(conf_softmmu ncurses curses) |
474 |
+ $(conf_softmmu nfs libnfs) |
475 |
+ $(conf_softmmu numa) |
476 |
+ $(conf_softmmu opengl) |
477 |
+ $(conf_softmmu png vnc-png) |
478 |
+ $(conf_softmmu rbd) |
479 |
+ $(conf_softmmu sasl vnc-sasl) |
480 |
+ $(conf_softmmu sdl) |
481 |
+ $(conf_softmmu seccomp) |
482 |
+ $(conf_softmmu smartcard) |
483 |
+ $(conf_softmmu snappy) |
484 |
+ $(conf_softmmu spice) |
485 |
+ $(conf_softmmu ssh libssh2) |
486 |
+ $(conf_softmmu usb libusb) |
487 |
+ $(conf_softmmu usbredir usb-redir) |
488 |
+ $(conf_softmmu uuid) |
489 |
+ $(conf_softmmu vde) |
490 |
+ $(conf_softmmu vhost-net) |
491 |
+ $(conf_softmmu virgl virglrenderer) |
492 |
+ $(conf_softmmu virtfs) |
493 |
+ $(conf_softmmu vnc) |
494 |
+ $(conf_softmmu vte) |
495 |
+ $(conf_softmmu xen) |
496 |
+ $(conf_softmmu xen xen-pci-passthrough) |
497 |
+ $(conf_softmmu xfs xfsctl) |
498 |
+ ) |
499 |
+ |
500 |
+ case ${buildtype} in |
501 |
+ user) |
502 |
+ conf_opts+=( |
503 |
+ --enable-linux-user |
504 |
+ --disable-system |
505 |
+ --disable-blobs |
506 |
+ --disable-tools |
507 |
+ ) |
508 |
+ ;; |
509 |
+ softmmu) |
510 |
+ # audio options |
511 |
+ local audio_opts="oss" |
512 |
+ use alsa && audio_opts="alsa,${audio_opts}" |
513 |
+ use sdl && audio_opts="sdl,${audio_opts}" |
514 |
+ use pulseaudio && audio_opts="pa,${audio_opts}" |
515 |
+ |
516 |
+ conf_opts+=( |
517 |
+ --disable-linux-user |
518 |
+ --enable-system |
519 |
+ --with-system-pixman |
520 |
+ --audio-drv-list="${audio_opts}" |
521 |
+ ) |
522 |
+ use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) ) |
523 |
+ use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) ) |
524 |
+ ;; |
525 |
+ tools) |
526 |
+ conf_opts+=( |
527 |
+ --disable-linux-user |
528 |
+ --disable-system |
529 |
+ --disable-blobs |
530 |
+ $(use_enable bzip2) |
531 |
+ ) |
532 |
+ static_flag="static" |
533 |
+ ;; |
534 |
+ esac |
535 |
+ |
536 |
+ local targets="${buildtype}_targets" |
537 |
+ [[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" ) |
538 |
+ |
539 |
+ # Add support for SystemTAP |
540 |
+ use systemtap && conf_opts+=( --enable-trace-backend=dtrace ) |
541 |
+ |
542 |
+ # We always want to attempt to build with PIE support as it results |
543 |
+ # in a more secure binary. But it doesn't work with static or if |
544 |
+ # the current GCC doesn't have PIE support. |
545 |
+ if use ${static_flag}; then |
546 |
+ conf_opts+=( --static --disable-pie ) |
547 |
+ else |
548 |
+ gcc-specs-pie && conf_opts+=( --enable-pie ) |
549 |
+ fi |
550 |
+ |
551 |
+ echo "../configure ${conf_opts[*]}" |
552 |
+ cd "${builddir}" |
553 |
+ ../configure "${conf_opts[@]}" || die "configure failed" |
554 |
+ |
555 |
+ # FreeBSD's kernel does not support QEMU assigning/grabbing |
556 |
+ # host USB devices yet |
557 |
+ use kernel_FreeBSD && \ |
558 |
+ sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak |
559 |
+} |
560 |
+ |
561 |
+src_configure() { |
562 |
+ local target |
563 |
+ |
564 |
+ python_setup |
565 |
+ |
566 |
+ softmmu_targets= softmmu_bins=() |
567 |
+ user_targets= user_bins=() |
568 |
+ |
569 |
+ for target in ${IUSE_SOFTMMU_TARGETS} ; do |
570 |
+ if use "qemu_softmmu_targets_${target}"; then |
571 |
+ softmmu_targets+=",${target}-softmmu" |
572 |
+ softmmu_bins+=( "qemu-system-${target}" ) |
573 |
+ fi |
574 |
+ done |
575 |
+ |
576 |
+ for target in ${IUSE_USER_TARGETS} ; do |
577 |
+ if use "qemu_user_targets_${target}"; then |
578 |
+ user_targets+=",${target}-linux-user" |
579 |
+ user_bins+=( "qemu-${target}" ) |
580 |
+ fi |
581 |
+ done |
582 |
+ |
583 |
+ softmmu_targets=${softmmu_targets#,} |
584 |
+ user_targets=${user_targets#,} |
585 |
+ |
586 |
+ [[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu" |
587 |
+ [[ -n ${user_targets} ]] && qemu_src_configure "user" |
588 |
+ [[ -z ${softmmu_targets}${user_targets} ]] && qemu_src_configure "tools" |
589 |
+} |
590 |
+ |
591 |
+src_compile() { |
592 |
+ if [[ -n ${user_targets} ]]; then |
593 |
+ cd "${S}/user-build" |
594 |
+ default |
595 |
+ fi |
596 |
+ |
597 |
+ if [[ -n ${softmmu_targets} ]]; then |
598 |
+ cd "${S}/softmmu-build" |
599 |
+ default |
600 |
+ fi |
601 |
+ |
602 |
+ if [[ -z ${softmmu_targets}${user_targets} ]]; then |
603 |
+ cd "${S}/tools-build" |
604 |
+ default |
605 |
+ fi |
606 |
+} |
607 |
+ |
608 |
+src_test() { |
609 |
+ if [[ -n ${softmmu_targets} ]]; then |
610 |
+ cd "${S}/softmmu-build" |
611 |
+ pax-mark m */qemu-system-* #515550 |
612 |
+ emake -j1 check |
613 |
+ emake -j1 check-report.html |
614 |
+ fi |
615 |
+} |
616 |
+ |
617 |
+qemu_python_install() { |
618 |
+ python_domodule "${S}/scripts/qmp/qmp.py" |
619 |
+ |
620 |
+ python_doscript "${S}/scripts/kvm/vmxcap" |
621 |
+ python_doscript "${S}/scripts/qmp/qmp-shell" |
622 |
+ python_doscript "${S}/scripts/qmp/qemu-ga-client" |
623 |
+} |
624 |
+ |
625 |
+src_install() { |
626 |
+ if [[ -n ${user_targets} ]]; then |
627 |
+ cd "${S}/user-build" |
628 |
+ emake DESTDIR="${ED}" install |
629 |
+ |
630 |
+ # Install binfmt handler init script for user targets |
631 |
+ newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt |
632 |
+ fi |
633 |
+ |
634 |
+ if [[ -n ${softmmu_targets} ]]; then |
635 |
+ cd "${S}/softmmu-build" |
636 |
+ emake DESTDIR="${ED}" install |
637 |
+ |
638 |
+ # This might not exist if the test failed. #512010 |
639 |
+ [[ -e check-report.html ]] && dohtml check-report.html |
640 |
+ |
641 |
+ if use kernel_linux; then |
642 |
+ udev_dorules "${FILESDIR}"/65-kvm.rules |
643 |
+ fi |
644 |
+ |
645 |
+ if use python; then |
646 |
+ python_foreach_impl qemu_python_install |
647 |
+ fi |
648 |
+ fi |
649 |
+ |
650 |
+ if [[ -z ${softmmu_targets}${user_targets} ]]; then |
651 |
+ cd "${S}/tools-build" |
652 |
+ emake DESTDIR="${ED}" install |
653 |
+ fi |
654 |
+ |
655 |
+ # Disable mprotect on the qemu binaries as they use JITs to be fast #459348 |
656 |
+ pushd "${ED}"/usr/bin >/dev/null |
657 |
+ pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}" |
658 |
+ popd >/dev/null |
659 |
+ |
660 |
+ # Install config file example for qemu-bridge-helper |
661 |
+ insinto "/etc/qemu" |
662 |
+ doins "${FILESDIR}/bridge.conf" |
663 |
+ |
664 |
+ # Remove the docdir placed qmp-commands.txt |
665 |
+ mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/" || die |
666 |
+ |
667 |
+ cd "${S}" |
668 |
+ dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt |
669 |
+ newdoc pc-bios/README README.pc-bios |
670 |
+ dodoc docs/qmp-*.txt |
671 |
+ |
672 |
+ if [[ -n ${softmmu_targets} ]]; then |
673 |
+ # Remove SeaBIOS since we're using the SeaBIOS packaged one |
674 |
+ rm "${ED}/usr/share/qemu/bios.bin" |
675 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
676 |
+ dosym ../seabios/bios.bin /usr/share/qemu/bios.bin |
677 |
+ fi |
678 |
+ |
679 |
+ # Remove vgabios since we're using the vgabios packaged one |
680 |
+ rm "${ED}/usr/share/qemu/vgabios.bin" |
681 |
+ rm "${ED}/usr/share/qemu/vgabios-cirrus.bin" |
682 |
+ rm "${ED}/usr/share/qemu/vgabios-qxl.bin" |
683 |
+ rm "${ED}/usr/share/qemu/vgabios-stdvga.bin" |
684 |
+ rm "${ED}/usr/share/qemu/vgabios-vmware.bin" |
685 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
686 |
+ dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin |
687 |
+ dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin |
688 |
+ dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin |
689 |
+ dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin |
690 |
+ dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin |
691 |
+ fi |
692 |
+ |
693 |
+ # Remove sgabios since we're using the sgabios packaged one |
694 |
+ rm "${ED}/usr/share/qemu/sgabios.bin" |
695 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
696 |
+ dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin |
697 |
+ fi |
698 |
+ |
699 |
+ # Remove iPXE since we're using the iPXE packaged one |
700 |
+ rm "${ED}"/usr/share/qemu/pxe-*.rom |
701 |
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then |
702 |
+ dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom |
703 |
+ dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom |
704 |
+ dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom |
705 |
+ dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom |
706 |
+ dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom |
707 |
+ dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom |
708 |
+ fi |
709 |
+ fi |
710 |
+ |
711 |
+ qemu_support_kvm && readme.gentoo_create_doc |
712 |
+} |
713 |
+ |
714 |
+pkg_postinst() { |
715 |
+ if qemu_support_kvm; then |
716 |
+ readme.gentoo_print_elog |
717 |
+ fi |
718 |
+ |
719 |
+ if [[ -n ${softmmu_targets} ]] && use kernel_linux; then |
720 |
+ udev_reload |
721 |
+ fi |
722 |
+ |
723 |
+ fcaps cap_net_admin /usr/libexec/qemu-bridge-helper |
724 |
+} |
725 |
+ |
726 |
+pkg_info() { |
727 |
+ echo "Using:" |
728 |
+ echo " $(best_version app-emulation/spice-protocol)" |
729 |
+ echo " $(best_version sys-firmware/ipxe)" |
730 |
+ echo " $(best_version sys-firmware/seabios)" |
731 |
+ if has_version 'sys-firmware/seabios[binary]'; then |
732 |
+ echo " USE=binary" |
733 |
+ else |
734 |
+ echo " USE=''" |
735 |
+ fi |
736 |
+ echo " $(best_version sys-firmware/vgabios)" |
737 |
+} |