summaryrefslogtreecommitdiff
blob: c532f9ca27c60de3b238fce66ad62908ef633acf (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-0.6.0.ebuild,v 1.8 2005/01/01 14:16:15 eradicator Exp $

inherit eutils

DESCRIPTION="Multi-platform & multi-targets cpu emulator and dynamic translator"
HOMEPAGE="http://fabrice.bellard.free.fr/qemu/"
SRC_URI="http://fabrice.bellard.free.fr/qemu/${P}.tar.gz"

LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="x86 ppc -alpha -sparc"
IUSE="softmmu qemu-fast sdl"
RESTRICT="nostrip"

DEPEND="virtual/libc
	sdl? ( media-libs/libsdl )"
RDEPEND=""

set_target_list() {
	TARGET_LIST="arm-user i386-user ppc-user sparc-user" #i386-softmmu ppc-softmmu
	use softmmu && TARGET_LIST="${TARGET_LIST} i386-softmmu ppc-softmmu"
	use qemu-fast && TARGET_LIST="${TARGET_LIST} i386"
	export TARGET_LIST
}

#RUNTIME_PATH="/emul/gnemul/"
src_unpack() {
	unpack ${A}
	cd ${S}
	epatch ${FILESDIR}/${P}-typo.patch
	epatch ${FILESDIR}/${P}-sigaction.patch
	epatch ${FILESDIR}/qemu_gcc34.patch.gz
	epatch ${FILESDIR}/${P}-configure.patch
}

src_compile() {
	set_target_list
#		--interp-prefix=${RUNTIME_PATH}/qemu-%M
	./configure \
		--prefix=/usr \
		--target-list="${TARGET_LIST}" \
		--enable-slirp \
		`use_enable sdl`\
		|| die "could not configure"
	make || die "make failed"
}

src_install() {
	make install \
		prefix=${D}/usr \
		bindir=${D}/usr/bin \
		datadir=${D}/usr/share/qemu \
		docdir=${D}/usr/share/doc/${P}-${PR} \
		mandir=${D}/usr/share/man || die
	chmod -x ${D}/usr/share/man/*/*
}

pkg_postinst() {
	einfo "You will need the Universal TUN/TAP driver compiled into"
	einfo "kernel or as a module to use the virtual network device."
	use softmmu || \
	(
	ewarn "You have the softmmu useflag disabled."
	ewarn "In order to have the full system emulator (qemu) you have"
	ewarn "to emerge qemu again with the softmmu useflag enabled"
	)
}