summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2012-02-28 13:55:53 +0000
committerLuca Barbato <lu_zero@gentoo.org>2012-02-28 13:55:53 +0000
commitc9b7559a35e8b1339bfb65b19ede172c9d9541d6 (patch)
treea6998b5b6a3079906c5213da5ecfda6d198db95d
parentcorrect installation inside prefix (diff)
downloadgentoo-2-c9b7559a35e8b1339bfb65b19ede172c9d9541d6.tar.gz
gentoo-2-c9b7559a35e8b1339bfb65b19ede172c9d9541d6.tar.bz2
gentoo-2-c9b7559a35e8b1339bfb65b19ede172c9d9541d6.zip
New version, static only
(Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
-rw-r--r--app-emulation/qemu-user/ChangeLog10
-rw-r--r--app-emulation/qemu-user/files/qemu-binfmt.initd132
-rw-r--r--app-emulation/qemu-user/qemu-user-1.0.ebuild127
3 files changed, 267 insertions, 2 deletions
diff --git a/app-emulation/qemu-user/ChangeLog b/app-emulation/qemu-user/ChangeLog
index d63c6f7917c6..5657c0a3447f 100644
--- a/app-emulation/qemu-user/ChangeLog
+++ b/app-emulation/qemu-user/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/qemu-user
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-user/ChangeLog,v 1.40 2010/10/15 14:21:23 flameeyes Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-user/ChangeLog,v 1.41 2012/02/28 13:55:52 lu_zero Exp $
+
+*qemu-user-1.0 (28 Feb 2012)
+
+ 28 Feb 2012; Luca Barbato <lu_zero@gentoo.org> +qemu-user-1.0.ebuild,
+ +files/qemu-binfmt.initd:
+ New version, static only
15 Oct 2010; Diego E. Pettenò <flameeyes@gentoo.org>
-qemu-user-0.10.0.ebuild, -qemu-user-0.10.1.ebuild:
diff --git a/app-emulation/qemu-user/files/qemu-binfmt.initd b/app-emulation/qemu-user/files/qemu-binfmt.initd
new file mode 100644
index 000000000000..ff6ca8d3a626
--- /dev/null
+++ b/app-emulation/qemu-user/files/qemu-binfmt.initd
@@ -0,0 +1,132 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-user/files/qemu-binfmt.initd,v 1.1 2012/02/28 13:55:53 lu_zero Exp $
+
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
+
+depend() {
+ after procfs
+}
+
+start() {
+ ebegin "Registering qemu-user binaries"
+
+ if [[ ! -d /proc/sys/fs/binfmt_misc ]] ; then
+ eerror "You need support for \"misc binaries\" in your kernel!"
+ eend 1
+ fi
+
+ if [[ $(mount | grep -c binfmt_misc) -eq 0 ]] ; then
+ mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc &> /dev/null
+ local result=$?
+
+ if [[ $result -ne 0 ]] ; then
+ eend $result
+ fi
+ fi
+
+ # probe cpu type
+ cpu=`uname -m`
+ case "$cpu" in
+ i386|i486|i586|i686|i86pc|BePC|x86_64)
+ cpu="i386"
+ ;;
+ m68k)
+ cpu="m68k"
+ ;;
+ mips*)
+ cpu="mips"
+ ;;
+ "Power Macintosh"|ppc|ppc64)
+ cpu="ppc"
+ ;;
+ armv[4-9]*)
+ cpu="arm"
+ ;;
+ sparc*)
+ cpu="sparc"
+ ;;
+ esac
+
+ # register the interpreter for each cpu except for the native one
+ if [ $cpu != "i386" -a -x "/usr/bin/qemu-static-i386-binfmt" ] ; then
+ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "alpha" -a -x "/usr/bin/qemu-static-alpha-binfmt" ] ; then
+ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-alpha-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-static-arm-binfmt" ] ; then
+ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-arm-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-static-armeb-binfmt" ] ; then
+ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-armeb-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sparc" -a -x "/usr/bin/qemu-static-sparc-binfmt" ] ; then
+ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-sparc-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "ppc" -a -x "/usr/bin/qemu-static-ppc-binfmt" ] ; then
+ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-ppc-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "m68k" -a -x "/usr/bin/qemu-static-m68k-binfmt" ] ; then
+ echo 'Please check cpu value and header information for m68k!'
+ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-m68k-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-static-mips-binfmt" ] ; then
+ # FIXME: We could use the other endianness on a MIPS host.
+ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-mips-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-static-mipsel-binfmt" ] ; then
+ echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-mipsel-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-static-mipsn32-binfmt" ] ; then
+ echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-mipsn32-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-static-mipsn32el-binfmt" ] ; then
+ echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-mipsn32el-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-static-mips64-binfmt" ] ; then
+ echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-mips64-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-static-mips64el-binfmt" ] ; then
+ echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-mips64el-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-static-sh4-binfmt" ] ; then
+ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-static-sh4-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-static-sh4eb-binfmt" ] ; then
+ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-static-sh4eb-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "s390x" -a -x "/usr/local/bin/qemu-static-s390x-binfmt" ] ; then
+ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-static-s390x-binfmt:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Unregistering qemu-user binaries"
+ local arches
+
+ arches="${arches} i386 i486"
+ arches="${arches} alpha"
+ arches="${arches} arm armeb"
+ arches="${arches} sparc"
+ arches="${arches} ppc"
+ arches="${arches} m68k"
+ arches="${arches} mips mipsel mipsn32 mipsn32el mips64 mips64el"
+ arches="${arches} sh4 sh4eb"
+ arches="${arches} s390x"
+
+ for a in ${arches}; do
+ if [[ -f /proc/sys/fs/binfmt_misc/$a ]] ; then
+ echo '-1' > /proc/sys/fs/binfmt_misc/$a
+ fi
+ done
+
+ eend $?
+}
+
+# vim: ts=4 :
+
+
diff --git a/app-emulation/qemu-user/qemu-user-1.0.ebuild b/app-emulation/qemu-user/qemu-user-1.0.ebuild
new file mode 100644
index 000000000000..9d3a219064a1
--- /dev/null
+++ b/app-emulation/qemu-user/qemu-user-1.0.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-user/qemu-user-1.0.ebuild,v 1.1 2012/02/28 13:55:53 lu_zero Exp $
+
+EAPI=4
+
+inherit eutils base flag-o-matic pax-utils toolchain-funcs
+
+MY_P=${P/-user/}
+
+SRC_URI="http://wiki.qemu.org/download/${MY_P}.tar.gz
+ http://dev.gentoo.org/~lu_zero/distfiles/${MY_P}-patches.tar.xz"
+
+DESCRIPTION="Open source dynamic CPU translator"
+HOMEPAGE="http://www.qemu.org"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~ppc64"
+IUSE=""
+RESTRICT="test"
+
+COMMON_TARGETS="i386 x86_64 alpha arm cris m68k microblaze microblazeel mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64 s390x"
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb ppc64abi32 sparc32plus unicore32"
+
+for target in ${IUSE_USER_TARGETS}; do
+ IUSE="${IUSE} +qemu_user_targets_${target}"
+done
+
+
+DEPEND="app-text/texi2html
+ dev-util/pkgconfig
+ sys-libs/zlib[static-libs]
+ dev-libs/glib[static-libs]"
+RDEPEND=""
+
+QA_WX_LOAD="
+ usr/bin/qemu-static-ppc64abi32-binfmt
+ usr/bin/qemu-static-ppc64
+ usr/bin/qemu-static-x86_64-binfmt
+ usr/bin/qemu-static-x86_64
+ usr/bin/qemu-static-unicore32-binfmt
+ usr/bin/qemu-static-m68k-binfmt
+ usr/bin/qemu-static-ppc-binfmt
+ usr/bin/qemu-static-alpha-binfmt
+ usr/bin/qemu-static-microblazeel-binfmt
+ usr/bin/qemu-static-sparc-binfmt
+ usr/bin/qemu-static-sparc32plus-binfmt
+ usr/bin/qemu-static-ppc
+ usr/bin/qemu-static-mipsn32el-binfmt
+ usr/bin/qemu-static-sh4eb-binfmt
+ usr/bin/qemu-static-ppc64abi32
+ usr/bin/qemu-static-ppc64-binfmt
+ usr/bin/qemu-static-armeb-binfmt
+ usr/bin/qemu-static-microblaze-binfmt
+ usr/bin/qemu-static-mips-binfmt
+ usr/bin/qemu-static-mipsel-binfmt
+ usr/bin/qemu-static-sh4-binfmt
+ usr/bin/qemu-static-s390x-binfmt
+ usr/bin/qemu-static-i386-binfmt
+ usr/bin/qemu-static-cris-binfmt
+ usr/bin/qemu-static-arm-binfmt
+ usr/bin/qemu-static-sparc64-binfmt
+ usr/bin/qemu-static-mipsn32-binfmt
+"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ cd "${S}"
+ # prevent docs to get automatically installed
+ sed -i '/$(DESTDIR)$(docdir)/d' Makefile
+ # Alter target makefiles to accept CFLAGS set via flag-o
+ sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
+ Makefile Makefile.target
+
+ EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" epatch
+}
+
+src_configure() {
+ filter-flags -fpie -fstack-protector
+
+ local conf_opts user_targets
+
+ for target in ${IUSE_USER_TARGETS} ; do
+ use "qemu_user_targets_${target}" && \
+ user_targets="${user_targets} ${target}-linux-user"
+ done
+
+ conf_opts="--enable-linux-user --disable-strip"
+ conf_opts+=" --disable-darwin-user --disable-bsd-user"
+ conf_opts+=" --disable-system"
+ conf_opts+=" --disable-vnc-tls"
+ conf_opts+=" --disable-curses"
+ conf_opts+=" --disable-sdl"
+ conf_opts+=" --disable-vde"
+ conf_opts+=" --prefix=/usr --disable-bluez --disable-kvm"
+ conf_opts+=" --cc=$(tc-getCC) --host-cc=$(tc-getBUILD_CC)"
+ conf_opts+=" --disable-smartcard --disable-smartcard-nss"
+ conf_opts+=" --extra-ldflags=-Wl,-z,execheap"
+ conf_opts+=" --disable-strip --disable-werror"
+ conf_opts+=" --static"
+
+ ./configure ${conf_opts} --target-list="${user_targets}" || die "econf failed"
+}
+
+src_compile() {
+ emake || die "emake qemu failed"
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die "make install failed"
+
+ # fixup to avoid collisions with qemu
+ base_dir="${ED}/usr/bin"
+ for qemu_bin in "${base_dir}"/qemu-*; do
+ qemu_bin_name=$(basename "${qemu_bin}")
+ mv "${qemu_bin}" "${base_dir}"/"${qemu_bin_name/qemu-/qemu-static-}" || die
+ done
+
+ pax-mark r "${ED}"/usr/bin/qemu-static-*
+ rm -fr "${ED}/usr/share"
+ dohtml qemu-doc.html
+ dohtml qemu-tech.html
+ newinitd "${FILESDIR}/qemu-binfmt.initd" qemu-binfmt
+}