diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2005-06-18 11:49:16 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2005-06-18 11:49:16 +0000 |
commit | d00ad18e2786a56b635219f0b297dc30d2265c67 (patch) | |
tree | 11a9109570c79aa538fe9a5beec088f10f59cec8 /app-emulation | |
parent | Stable on alpha (diff) | |
download | gentoo-2-d00ad18e2786a56b635219f0b297dc30d2265c67.tar.gz gentoo-2-d00ad18e2786a56b635219f0b297dc30d2265c67.tar.bz2 gentoo-2-d00ad18e2786a56b635219f0b297dc30d2265c67.zip |
Split ebuild part I - emulators
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'app-emulation')
-rw-r--r-- | app-emulation/qemu-softmmu/ChangeLog | 11 | ||||
-rw-r--r-- | app-emulation/qemu-softmmu/Manifest | 6 | ||||
-rw-r--r-- | app-emulation/qemu-softmmu/files/digest-qemu-softmmu-0.7.0-r1 | 2 | ||||
-rw-r--r-- | app-emulation/qemu-softmmu/files/kqemu-sysfs.patch | 77 | ||||
-rw-r--r-- | app-emulation/qemu-softmmu/files/qemu-softmmu-0.7.0-errno.patch | 11 | ||||
-rw-r--r-- | app-emulation/qemu-softmmu/metadata.xml | 8 | ||||
-rw-r--r-- | app-emulation/qemu-softmmu/qemu-softmmu-0.7.0-r1.ebuild | 142 |
7 files changed, 257 insertions, 0 deletions
diff --git a/app-emulation/qemu-softmmu/ChangeLog b/app-emulation/qemu-softmmu/ChangeLog new file mode 100644 index 000000000000..00c3559a85fa --- /dev/null +++ b/app-emulation/qemu-softmmu/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for app-emulation/qemu-softmmu +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-softmmu/ChangeLog,v 1.1 2005/06/18 11:49:16 lu_zero Exp $ + +*qemu-softmmu-0.7.0-r1 (18 Jun 2005) + + 18 Jun 2005; Luca Barbato <lu_zero@gentoo.org> + +files/qemu-softmmu-0.7.0-errno.patch, +files/kqemu-sysfs.patch, + +metadata.xml, +qemu-softmmu-0.7.0-r1.ebuild: + qemu split ebuild, system emulators + diff --git a/app-emulation/qemu-softmmu/Manifest b/app-emulation/qemu-softmmu/Manifest new file mode 100644 index 000000000000..c47c6a5c8aed --- /dev/null +++ b/app-emulation/qemu-softmmu/Manifest @@ -0,0 +1,6 @@ +MD5 898131aae735c3477ff2f9c6882f1178 metadata.xml 223 +MD5 8ceed443311d45ff5f080639a8d64f7c qemu-softmmu-0.7.0-r1.ebuild 3937 +MD5 738b30b12031f3c4fa236b27bc282ea2 ChangeLog 368 +MD5 f2e48bae97dad4e6e6bccdb212124ae0 files/digest-qemu-softmmu-0.7.0-r1 127 +MD5 87ec2e1fa832612fb834d7dd49cf7e5c files/kqemu-sysfs.patch 2094 +MD5 3202f7445799cce82ccaac9749e1443d files/qemu-softmmu-0.7.0-errno.patch 487 diff --git a/app-emulation/qemu-softmmu/files/digest-qemu-softmmu-0.7.0-r1 b/app-emulation/qemu-softmmu/files/digest-qemu-softmmu-0.7.0-r1 new file mode 100644 index 000000000000..279f446285f5 --- /dev/null +++ b/app-emulation/qemu-softmmu/files/digest-qemu-softmmu-0.7.0-r1 @@ -0,0 +1,2 @@ +MD5 234e9ace03b00259bb57dc5a9c633056 qemu-0.7.0.tar.gz 1211802 +MD5 c6bb3b40fb3d526d731eb0f1f9dee7ee kqemu-0.6.2-1.tar.gz 21002 diff --git a/app-emulation/qemu-softmmu/files/kqemu-sysfs.patch b/app-emulation/qemu-softmmu/files/kqemu-sysfs.patch new file mode 100644 index 000000000000..05c49ca67898 --- /dev/null +++ b/app-emulation/qemu-softmmu/files/kqemu-sysfs.patch @@ -0,0 +1,77 @@ +--- kqemu/kmod.c 2005-02-10 23:09:09.000000000 +0100 ++++ kqemu/kmod-sysfs.c 2005-02-22 19:46:44.000000000 +0100 +@@ -15,7 +15,10 @@ + #include <asm/processor.h> + #include <asm/uaccess.h> + #include <asm/io.h> +- ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) ++#include <linux/device.h> ++#endif ++#include <linux/devfs_fs_kernel.h> + #include "kqemu.h" + + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19) +@@ -34,6 +37,10 @@ + int page_alloc_count; + #endif + ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) ++static struct class_simple *kqemu_class; ++#endif ++ + /* lock the page at virtual address 'user_addr' and return its + page index. Return -1 if error */ + unsigned long CDECL kqemu_lock_user_page(unsigned long user_addr) +@@ -296,17 +303,51 @@ + max_locked_pages = 32768; + + ret = register_chrdev(KQEMU_MAJOR, "kqemu", &kqemu_fops); ++ + if (ret < 0) { + printk("kqemu: could not get major %d\n", KQEMU_MAJOR); + return ret; + } ++ ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) ++ kqemu_class = class_simple_create(THIS_MODULE, "kqemu"); ++ ++ if (IS_ERR(kqemu_class)) { ++ unregister_chrdev(KQEMU_MAJOR, "kqemu"); ++ ret = PTR_ERR(kqemu_class); ++ goto out_chrdev; ++ } ++ ++ class_simple_device_add(kqemu_class, MKDEV(KQEMU_MAJOR, 0), NULL, "kqemu"); ++#endif ++ ++ ret = devfs_mk_cdev(MKDEV(KQEMU_MAJOR, 0), ++ S_IFCHR|S_IRUSR|S_IWUSR, "kqemu"); ++ if (ret) ++ goto out_class; ++ + printk("KQEMU installed, max_instances=%d max_locked_mem=%dkB.\n", + KQEMU_MAX_INSTANCES, + max_locked_pages * 4); + return 0; ++ ++out_class: ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) ++ class_simple_device_remove(MKDEV(KQEMU_MAJOR,0)); ++ class_simple_destroy(kqemu_class); ++#endif ++out_chrdev: ++ unregister_chrdev(KQEMU_MAJOR, "kqemu"); ++ ++ return ret; + } + + void cleanup_module(void) + { + unregister_chrdev(KQEMU_MAJOR, "kqemu"); ++ devfs_remove("kqemu"); ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) ++ class_simple_device_remove(MKDEV(KQEMU_MAJOR, 0)); ++ class_simple_destroy(kqemu_class); ++#endif + } diff --git a/app-emulation/qemu-softmmu/files/qemu-softmmu-0.7.0-errno.patch b/app-emulation/qemu-softmmu/files/qemu-softmmu-0.7.0-errno.patch new file mode 100644 index 000000000000..291adc1725b5 --- /dev/null +++ b/app-emulation/qemu-softmmu/files/qemu-softmmu-0.7.0-errno.patch @@ -0,0 +1,11 @@ +diff -ruN qemu-0.7.0.orig/target-i386/helper2.c qemu-0.7.0/target-i386/helper2.c +--- qemu-0.7.0.orig/target-i386/helper2.c 2005-04-27 22:52:05.000000000 +0200 ++++ qemu-0.7.0/target-i386/helper2.c 2005-05-25 22:07:50.000000000 +0200 +@@ -17,6 +17,7 @@ + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ ++#include <errno.h> + #include <stdarg.h> + #include <stdlib.h> + #include <stdio.h> diff --git a/app-emulation/qemu-softmmu/metadata.xml b/app-emulation/qemu-softmmu/metadata.xml new file mode 100644 index 000000000000..7ea327a416ea --- /dev/null +++ b/app-emulation/qemu-softmmu/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>no-herd</herd> +<maintainer> + <email>lu_zero@gentoo.org</email> +</maintainer> +</pkgmetadata> diff --git a/app-emulation/qemu-softmmu/qemu-softmmu-0.7.0-r1.ebuild b/app-emulation/qemu-softmmu/qemu-softmmu-0.7.0-r1.ebuild new file mode 100644 index 000000000000..a6bc5ec33af8 --- /dev/null +++ b/app-emulation/qemu-softmmu/qemu-softmmu-0.7.0-r1.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-softmmu/qemu-softmmu-0.7.0-r1.ebuild,v 1.1 2005/06/18 11:49:16 lu_zero Exp $ + +inherit eutils flag-o-matic linux-mod toolchain-funcs + +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/-softmmu}.tar.gz + kqemu? ( http://fabrice.bellard.free.fr/qemu/kqemu-0.6.2-1.tar.gz )" +#qvm86? ( http://dev.gentoo.org/~lu_zero/distfiles/qvm86-20050409.tar.bz2 )" +#kqemu? ( http://fabrice.bellard.free.fr/qemu/kqemu-${PV%.*}-1.tar.gz ) + +LICENSE="GPL-2 LGPL-2.1 KQEMU" +SLOT="0" +KEYWORDS="~x86 ~ppc -alpha -sparc ~amd64" +IUSE="sdl kqemu" #qvm86 debug nptl qemu-fast nptlonly" +RESTRICT="nostrip" + +DEPEND="virtual/libc + sdl? ( media-libs/libsdl ) + !<=app-emulation/qemu-0.7.0 + app-text/texi2html" +RDEPEND="sdl? ( media-libs/libsdl )" + +S="${WORKDIR}/${P/-softmmu}" + +MODULE_NAMES="" +use kqemu && MODULE_NAMES=$MODULE_NAMES" kqemu(misc:${S}/kqemu)" +#use qvm86 && MODULE_NAMES=$MODULE_NAMES" qvm86(misc:${S}/qvm86)" + + + +set_target_list() { + TARGET_LIST="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu" + export TARGET_LIST +} + +pkg_setup() { + if [ "$(gcc-major-version)" == "4" ]; then + ewarn "Qemu could not build with GCC 4" + fi +# ( use kqemu || use qvm86 ) && linux-mod_pkg_setup + use kqemu && linux-mod_pkg_setup +} + +#RUNTIME_PATH="/emul/gnemul/" +src_unpack() { + unpack ${A} + + if use kqemu ; then + einfo "QEMU Accelerator enabled" + einfo "kqemu actually is a closed source software" + einfo "Please read carefully the KQEMU license" + einfo "and http://fabrice.bellard.free.fr/qemu/qemu-accel.html" + einfo "if you want it released under GPL" + mv ${S}/../kqemu ${S} + cd ${S}/kqemu + epatch ${FILESDIR}/kqemu-sysfs.patch + fi + # if use qvm86; then +# mv ${WORKDIR}/qvm86 ${S} +# cd ${S} +# epatch qvm86/patch.qvm86 +# fi + cd ${S} + #Fix errno mismatch on glibc-2.3.5 + epatch ${FILESDIR}/${P}-errno.patch + + # Alter target makefiles to accept CFLAGS set via flag-o. + sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \ + Makefile Makefile.target tests/Makefile + # Ensure mprotect restrictions are relaxed for emulator binaries + [[ -x /sbin/paxctl ]] && \ + sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \ + Makefile.target + # Prevent install of kernel module by qemu's makefile + sed -i 's/\(.\/install.sh\)/#\1/' Makefile +} + +src_compile() { + #Let the application set its cflags + unset CFLAGS + + # Switch off hardened tech + filter-flags -fpie -fstack-protector + + myconf="" + set_target_list +# --interp-prefix=${RUNTIME_PATH}/qemu-%M + ./configure \ + --prefix=/usr \ + --target-list="${TARGET_LIST}" \ + --enable-slirp \ + --kernel-path=${KV_DIR} \ + $(use_enable kqemu) \ + ${myconf} \ + $(use_enable sdl)\ + || die "could not configure" + + emake || 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 + + linux-mod_src_install + + # udev rule + dodir /etc/udev/rules.d/ + echo 'KERNEL="kqemu*", NAME="%k", GROUP="qemu", MODE="0660"' \ + > ${D}/etc/udev/rules.d/48-qemu.rules + enewgroup qemu + + # Module doc + dodoc ${S}/kqemu/README + + 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." + if use kqemu ; then + einfo "kqemu actually is a closed source software" + einfo "Please read carefully the KQEMU license" + einfo "and http://fabrice.bellard.free.fr/qemu/qemu-accel.html" + einfo "if you want it released under GPL" + linux-mod_pkg_postinst + einfo "make sure you have the kernel module loaded before running qemu" + einfo "and your user is in the qemu group" + fi +} |