| 1 |
vapier |
1.1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
|
|
# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-1.0.1.ebuild,v 1.6 2012/08/18 17:24:16 vapier Exp $
|
| 4 |
|
|
|
| 5 |
|
|
EAPI=4
|
| 6 |
|
|
|
| 7 |
|
|
if [[ ${PV} = *9999* ]]; then
|
| 8 |
|
|
EGIT_REPO_URI="git://git.qemu.org/qemu.git
|
| 9 |
|
|
http://git.qemu.org/git/qemu.git"
|
| 10 |
|
|
GIT_ECLASS="git-2"
|
| 11 |
|
|
fi
|
| 12 |
|
|
|
| 13 |
|
|
inherit eutils flag-o-matic ${GIT_ECLASS} linux-info toolchain-funcs python
|
| 14 |
|
|
|
| 15 |
|
|
if [[ ${PV} != *9999* ]]; then
|
| 16 |
|
|
SRC_URI="http://wiki.qemu.org/download/${P}-1.tar.bz2"
|
| 17 |
|
|
# Pending review
|
| 18 |
|
|
#KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
|
| 19 |
|
|
fi
|
| 20 |
|
|
|
| 21 |
|
|
DESCRIPTION="QEMU emulator and ABI wrapper"
|
| 22 |
|
|
HOMEPAGE="http://www.qemu.org"
|
| 23 |
|
|
|
| 24 |
|
|
LICENSE="GPL-2"
|
| 25 |
|
|
SLOT="0"
|
| 26 |
|
|
IUSE="+aio alsa bluetooth brltty curl fdt hardened jpeg kvm ncurses nss
|
| 27 |
|
|
opengl png pulseaudio qemu-ifup rbd sasl sdl spice ssl static threads usbredir vde
|
| 28 |
|
|
+vhost-net xattr xen xfs"
|
| 29 |
|
|
|
| 30 |
|
|
COMMON_TARGETS="i386 x86_64 alpha arm cris m68k microblaze microblazeel mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64 s390x"
|
| 31 |
|
|
IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 mips64 mips64el ppcemb xtensa xtensaeb"
|
| 32 |
|
|
IUSE_USER_TARGETS="${COMMON_TARGETS} armeb ppc64abi32 sparc32plus unicore32"
|
| 33 |
|
|
|
| 34 |
|
|
for target in ${IUSE_SOFTMMU_TARGETS}; do
|
| 35 |
|
|
IUSE="${IUSE} +qemu_softmmu_targets_${target}"
|
| 36 |
|
|
done
|
| 37 |
|
|
|
| 38 |
|
|
for target in ${IUSE_USER_TARGETS}; do
|
| 39 |
|
|
IUSE="${IUSE} +qemu_user_targets_${target}"
|
| 40 |
|
|
done
|
| 41 |
|
|
|
| 42 |
|
|
RESTRICT="test"
|
| 43 |
|
|
|
| 44 |
|
|
RDEPEND="
|
| 45 |
|
|
!app-emulation/qemu-kvm
|
| 46 |
|
|
!app-emulation/qemu-user
|
| 47 |
|
|
>=dev-libs/glib-2.0
|
| 48 |
|
|
sys-apps/pciutils
|
| 49 |
|
|
>=sys-apps/util-linux-2.16.0
|
| 50 |
|
|
sys-libs/zlib
|
| 51 |
|
|
aio? ( dev-libs/libaio )
|
| 52 |
|
|
alsa? ( >=media-libs/alsa-lib-1.0.13 )
|
| 53 |
|
|
bluetooth? ( net-wireless/bluez )
|
| 54 |
|
|
brltty? ( app-accessibility/brltty )
|
| 55 |
|
|
curl? ( net-misc/curl )
|
| 56 |
|
|
fdt? ( >=sys-apps/dtc-1.2.0 )
|
| 57 |
|
|
jpeg? ( virtual/jpeg )
|
| 58 |
|
|
ncurses? ( sys-libs/ncurses )
|
| 59 |
|
|
nss? ( dev-libs/nss )
|
| 60 |
|
|
opengl? (
|
| 61 |
|
|
virtual/opengl
|
| 62 |
|
|
x11-libs/libX11
|
| 63 |
|
|
)
|
| 64 |
|
|
png? ( media-libs/libpng )
|
| 65 |
|
|
pulseaudio? ( media-sound/pulseaudio )
|
| 66 |
|
|
qemu-ifup? (
|
| 67 |
|
|
sys-apps/iproute2
|
| 68 |
|
|
net-misc/bridge-utils
|
| 69 |
|
|
)
|
| 70 |
|
|
rbd? ( sys-cluster/ceph )
|
| 71 |
|
|
sasl? ( dev-libs/cyrus-sasl )
|
| 72 |
|
|
sdl? ( >=media-libs/libsdl-1.2.11[X] )
|
| 73 |
|
|
spice? (
|
| 74 |
|
|
>=app-emulation/spice-0.9.0
|
| 75 |
|
|
>=app-emulation/spice-protocol-0.8.1
|
| 76 |
|
|
)
|
| 77 |
|
|
ssl? ( net-libs/gnutls )
|
| 78 |
|
|
usbredir? ( sys-apps/usbredir )
|
| 79 |
|
|
vde? ( net-misc/vde )
|
| 80 |
|
|
xattr? ( sys-apps/attr )
|
| 81 |
|
|
xen? ( app-emulation/xen-tools )
|
| 82 |
|
|
xfs? ( sys-fs/xfsprogs )
|
| 83 |
|
|
"
|
| 84 |
|
|
|
| 85 |
|
|
DEPEND="${RDEPEND}
|
| 86 |
|
|
app-text/texi2html
|
| 87 |
|
|
virtual/pkgconfig
|
| 88 |
|
|
>=sys-kernel/linux-headers-2.6.35
|
| 89 |
|
|
"
|
| 90 |
|
|
|
| 91 |
|
|
# alpha ELF binary. don't let portage mess with it
|
| 92 |
|
|
STRIP_MASK="usr/share/qemu/palcode-clipper"
|
| 93 |
|
|
|
| 94 |
|
|
QA_PRESTRIPPED="
|
| 95 |
|
|
usr/share/qemu/openbios-ppc
|
| 96 |
|
|
usr/share/qemu/openbios-sparc64
|
| 97 |
|
|
usr/share/qemu/openbios-sparc32
|
| 98 |
|
|
usr/share/qemu/palcode-clipper
|
| 99 |
|
|
"
|
| 100 |
|
|
# keep sorted
|
| 101 |
|
|
QA_WX_LOAD="${QA_PRESTRIPPED}
|
| 102 |
|
|
usr/bin/qemu-alpha
|
| 103 |
|
|
usr/bin/qemu-arm
|
| 104 |
|
|
usr/bin/qemu-armeb
|
| 105 |
|
|
usr/bin/qemu-cris
|
| 106 |
|
|
usr/bin/qemu-i386
|
| 107 |
|
|
usr/bin/qemu-m68k
|
| 108 |
|
|
usr/bin/qemu-microblaze
|
| 109 |
|
|
usr/bin/qemu-microblazeel
|
| 110 |
|
|
usr/bin/qemu-mips
|
| 111 |
|
|
usr/bin/qemu-mipsel
|
| 112 |
|
|
usr/bin/qemu-ppc
|
| 113 |
|
|
usr/bin/qemu-ppc64
|
| 114 |
|
|
usr/bin/qemu-ppc64abi32
|
| 115 |
|
|
usr/bin/qemu-sh4
|
| 116 |
|
|
usr/bin/qemu-sh4eb
|
| 117 |
|
|
usr/bin/qemu-sparc
|
| 118 |
|
|
usr/bin/qemu-sparc32plus
|
| 119 |
|
|
usr/bin/qemu-sparc64
|
| 120 |
|
|
usr/bin/qemu-s390x
|
| 121 |
|
|
usr/bin/qemu-unicore32
|
| 122 |
|
|
usr/bin/qemu-x86_64
|
| 123 |
|
|
"
|
| 124 |
|
|
|
| 125 |
|
|
pkg_setup() {
|
| 126 |
|
|
use qemu_softmmu_targets_x86_64 || ewarn "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64"
|
| 127 |
|
|
|
| 128 |
|
|
use kvm && ewarn "You have enabled USE=kvm feature. Please consider using app-emulation/qemu-kvm"
|
| 129 |
|
|
|
| 130 |
|
|
python_set_active_version 2
|
| 131 |
|
|
}
|
| 132 |
|
|
|
| 133 |
|
|
src_prepare() {
|
| 134 |
|
|
epatch "${FILESDIR}"/${PN}-1.0.1-siginfo.patch
|
| 135 |
|
|
|
| 136 |
|
|
# prevent docs to get automatically installed
|
| 137 |
|
|
sed -i '/$(DESTDIR)$(docdir)/d' Makefile || die
|
| 138 |
|
|
|
| 139 |
|
|
# Fix underlinking.
|
| 140 |
|
|
# Fault reproducer: USE=nss QEMU_SOFTMMU_TARGETS=lm32 QEMU_USER_TARGETS=
|
| 141 |
|
|
sed -i 's/opengl_libs="-lGL"/opengl_libs="-lGL -lX11"/' configure || die
|
| 142 |
|
|
}
|
| 143 |
|
|
|
| 144 |
|
|
src_configure() {
|
| 145 |
|
|
local conf_opts audio_opts user_targets
|
| 146 |
|
|
|
| 147 |
|
|
for target in ${IUSE_SOFTMMU_TARGETS} ; do
|
| 148 |
|
|
use "qemu_softmmu_targets_${target}" && \
|
| 149 |
|
|
softmmu_targets="${softmmu_targets} ${target}-softmmu"
|
| 150 |
|
|
done
|
| 151 |
|
|
|
| 152 |
|
|
for target in ${IUSE_USER_TARGETS} ; do
|
| 153 |
|
|
use "qemu_user_targets_${target}" && \
|
| 154 |
|
|
user_targets="${user_targets} ${target}-linux-user"
|
| 155 |
|
|
done
|
| 156 |
|
|
|
| 157 |
|
|
if [[ -z ${softmmu_targets} ]]; then
|
| 158 |
|
|
conf_opts="${conf_opts} --disable-system"
|
| 159 |
|
|
else
|
| 160 |
|
|
einfo "Building the following softmmu targets: ${softmmu_targets}"
|
| 161 |
|
|
fi
|
| 162 |
|
|
|
| 163 |
|
|
if [[ -n ${user_targets} ]]; then
|
| 164 |
|
|
einfo "Building the following user targets: ${user_targets}"
|
| 165 |
|
|
conf_opts="${conf_opts} --enable-linux-user"
|
| 166 |
|
|
else
|
| 167 |
|
|
conf_opts="${conf_opts} --disable-linux-user"
|
| 168 |
|
|
fi
|
| 169 |
|
|
|
| 170 |
|
|
# Fix QA issues. QEMU needs executable heaps and we need to mark it as such
|
| 171 |
|
|
conf_opts="${conf_opts} --extra-ldflags=-Wl,-z,execheap"
|
| 172 |
|
|
|
| 173 |
|
|
# drop '-g' by default as it tends to eat
|
| 174 |
|
|
# A LOT (~2GB) of ram for each job #355861
|
| 175 |
|
|
conf_opts="${conf_opts} --disable-debug-info"
|
| 176 |
|
|
|
| 177 |
|
|
# Add support for static builds
|
| 178 |
|
|
use static && conf_opts="${conf_opts} --static"
|
| 179 |
|
|
|
| 180 |
|
|
#config options
|
| 181 |
|
|
conf_opts="${conf_opts}
|
| 182 |
|
|
$(use_enable aio linux-aio)
|
| 183 |
|
|
$(use_enable bluetooth bluez)
|
| 184 |
|
|
$(use_enable brltty brlapi)
|
| 185 |
|
|
$(use_enable curl)
|
| 186 |
|
|
$(use_enable fdt)
|
| 187 |
|
|
$(use_enable hardened pie)
|
| 188 |
|
|
$(use_enable jpeg vnc-jpeg)
|
| 189 |
|
|
$(use_enable ncurses curses)
|
| 190 |
|
|
$(use_enable nss smartcard-nss)
|
| 191 |
|
|
$(use_enable opengl)
|
| 192 |
|
|
$(use_enable png vnc-png)
|
| 193 |
|
|
$(use_enable rbd)
|
| 194 |
|
|
$(use_enable sasl vnc-sasl)
|
| 195 |
|
|
$(use_enable sdl)
|
| 196 |
|
|
$(use_enable spice)
|
| 197 |
|
|
$(use_enable ssl vnc-tls)
|
| 198 |
|
|
$(use_enable threads vnc-thread)
|
| 199 |
|
|
$(use_enable vde)
|
| 200 |
|
|
$(use_enable vhost-net)
|
| 201 |
|
|
$(use_enable xen)
|
| 202 |
|
|
$(use_enable xattr attr)
|
| 203 |
|
|
$(use_enable xfs xfsctl)
|
| 204 |
|
|
--disable-bsd-user
|
| 205 |
|
|
"
|
| 206 |
|
|
|
| 207 |
|
|
# audio options
|
| 208 |
|
|
audio_opts="oss"
|
| 209 |
|
|
use alsa && audio_opts="alsa ${audio_opts}"
|
| 210 |
|
|
use pulseaudio && audio_opts="pa ${audio_opts}"
|
| 211 |
|
|
use sdl && audio_opts="sdl ${audio_opts}"
|
| 212 |
|
|
|
| 213 |
|
|
set -- --prefix="${EPREFIX}"/usr \
|
| 214 |
|
|
--sysconfdir="${EPREFIX}"/etc \
|
| 215 |
|
|
--disable-strip \
|
| 216 |
|
|
--disable-werror \
|
| 217 |
|
|
$(use_enable kvm) \
|
| 218 |
|
|
--disable-libiscsi \
|
| 219 |
|
|
--enable-nptl \
|
| 220 |
|
|
--enable-uuid \
|
| 221 |
|
|
${conf_opts} \
|
| 222 |
|
|
--audio-card-list="ac97 es1370 sb16 cs4231a adlib gus hda" \
|
| 223 |
|
|
--audio-drv-list="${audio_opts}" \
|
| 224 |
|
|
--target-list="${softmmu_targets} ${user_targets}" \
|
| 225 |
|
|
--cc="$(tc-getCC)" \
|
| 226 |
|
|
--host-cc="$(tc-getBUILD_CC)"
|
| 227 |
|
|
|
| 228 |
|
|
echo ./configure "$@" # show actual options
|
| 229 |
|
|
./configure "$@" || die "configure failed"
|
| 230 |
|
|
}
|
| 231 |
|
|
|
| 232 |
|
|
src_install() {
|
| 233 |
|
|
emake DESTDIR="${D}" install || die "make install failed"
|
| 234 |
|
|
|
| 235 |
|
|
if [[ -n ${softmmu_targets} ]]; then
|
| 236 |
|
|
if use qemu-ifup; then
|
| 237 |
|
|
exeinto /etc/qemu
|
| 238 |
|
|
doexe "${FILESDIR}"/qemu-if{up,down}
|
| 239 |
|
|
fi
|
| 240 |
|
|
fi
|
| 241 |
|
|
|
| 242 |
|
|
dodoc Changelog MAINTAINERS TODO pci-ids.txt
|
| 243 |
|
|
newdoc pc-bios/README README.pc-bios
|
| 244 |
|
|
dohtml qemu-doc.html qemu-tech.html
|
| 245 |
|
|
}
|
| 246 |
|
|
|
| 247 |
|
|
pkg_postinst() {
|
| 248 |
|
|
use qemu-ifup || return
|
| 249 |
|
|
elog "You will need the Universal TUN/TAP driver compiled into your"
|
| 250 |
|
|
elog "kernel or loaded as a module to use the virtual network device"
|
| 251 |
|
|
elog "if using -net tap. You will also need support for 802.1d"
|
| 252 |
|
|
elog "Ethernet Bridging and a configured bridge if using the provided"
|
| 253 |
|
|
elog "qemu-ifup script from /etc/qemu."
|
| 254 |
|
|
echo
|
| 255 |
|
|
}
|