# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # Nonofficial ebuild by Ycarus, additions by Oliver Schneider. For new version look here : http://gentoo.zugaina.org/ # This ebuild is a modification of the official qemu ebuild # Some patch can be appliqued : # - aog (http://www.boblycat.org/~malc/code/patches/qemu/) # - vvfat (http://libvncserver.sourceforge.net/qemu/) ECVS_SERVER="savannah.gnu.org:/cvsroot/qemu" ECVS_MODULE="qemu" ECVS_AUTH="ext" ECVS_USER="anoncvs" ECVS_TOP_DIR="${DISTDIR}/cvs-src/${PN}" inherit cvs eutils S=${WORKDIR}/${ECVS_MODULE} DESCRIPTION="Multi-platform & multi-targets cpu emulator and dynamic translator. CVS version with QEMU Accelerator Module (kqemu) and QVM86" DESCRIPTION_FR="Emulateur multi-plateforme et multi-cpu. Version CVS avec le module d'acceleration (QEMU Accelerator Module, kqemu) et QVM86" HOMEPAGE="http://fabrice.bellard.free.fr/qemu/" LICENSE="GPL-2 LGPL-2.1" SLOT="0" KEYWORDS="~x86 ~ppc -alpha -sparc ~amd64" IUSE="softmmu sdl kqemu vvfat aog qvm86" # nptl qemu-fast nptlonly" RESTRICT="nostrip" DEPEND="virtual/libc sdl? ( media-libs/libsdl ) app-text/texi2html !app-emulation/qemu" 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" export TARGET_LIST } src_compile() { if use kqemu; then wget http://fabrice.bellard.free.fr/qemu/kqemu-0.6.2-1.tar.gz tar xzvf kqemu-0.6.2-1.tar.gz rm kqemu-0.6.2-1.tar.gz cd kqemu rm install.sh touch install.sh chmod u+x install.sh cd .. fi if use qvm86; then tar xjvf ${FILESDIR}/qvm86_module-snapshot-2005-04-19_23.tar.bz2 mv qvm86_module-snapshot-2005-04-19_23 qvm86 cat qvm86/patch.qvm86 | patch -p0 rm qvm86/install.sh touch qvm86/install.sh chmod u+x qvm86/install.sh fi if use vvfat; then wget http://libvncserver.sourceforge.net/qemu/qemu-vvfat5.patch.gz gunzip qemu-vvfat5.patch.gz patch -p1 < qemu-vvfat5.patch fi if use aog; then wget http://www.boblycat.org/~malc/code/patches/qemu/4_aog_qemu.patch.gz gunzip 4_aog_qemu.patch.gz patch -p1 < 4_aog_qemu.patch fi set_target_list ./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} \ mandir=${D}/usr/share/man || die chmod -x ${D}/usr/share/man/*/* if use kqemu; then cd kqemu if [ -f kqemu.ko ] ; then module=kqemu.ko else module=kqemu.o fi kernel_path="/lib/modules/`uname -r`" dodir ${kernel_path}/misc insinto ${kernel_path}/misc doins ${module} fi if use qvm86; then cd qvm86 if [ -f qvm86.ko ] ; then module=qvm86.ko else module=qvm86.o fi kernel_path="/lib/modules/`uname -r`" dodir ${kernel_path}/misc insinto ${kernel_path}/misc doins ${module} fi } 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" ) if use kqemu; then /sbin/depmod -a einfo "" ewarn "Create the kqemu device :" ewarn "mknod /dev/kqemu c 250 0" ewarn "chmod 666 /dev/kqemu" einfo "" fi if use qvm86; then /sbin/depmod -a einfo "" ewarn "Create the qvm86 device :" ewarn "mknod /dev/qvm86 c 222 0" ewarn "chmod 666 /dev/qvm86" einfo "" fi }