| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-user/qemu-user-9999.ebuild,v 1.4 2012/11/22 18:47:25 ago 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 base flag-o-matic pax-utils toolchain-funcs ${GIT_ECLASS}
|
| 14 |
|
| 15 |
MY_P=${P/-user/}
|
| 16 |
|
| 17 |
if [[ ${PV} != *9999 ]]; then
|
| 18 |
SRC_URI="http://wiki.qemu.org/download/${MY_P}-1.tar.bz2
|
| 19 |
http://dev.gentoo.org/~lu_zero/distfiles/qemu-1.1.0-r1-patches.tar.xz"
|
| 20 |
KEYWORDS="~amd64 ~ppc ~x86 ~ppc64"
|
| 21 |
S="${WORKDIR}/${MY_P}"
|
| 22 |
fi
|
| 23 |
|
| 24 |
DESCRIPTION="Open source dynamic CPU translator"
|
| 25 |
HOMEPAGE="http://www.qemu.org"
|
| 26 |
|
| 27 |
LICENSE="GPL-2 LGPL-2.1"
|
| 28 |
SLOT="0"
|
| 29 |
IUSE=""
|
| 30 |
RESTRICT="test"
|
| 31 |
|
| 32 |
COMMON_TARGETS="i386 x86_64 alpha arm cris m68k microblaze microblazeel mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64 s390x"
|
| 33 |
IUSE_USER_TARGETS="${COMMON_TARGETS} armeb ppc64abi32 sparc32plus unicore32"
|
| 34 |
|
| 35 |
for target in ${IUSE_USER_TARGETS}; do
|
| 36 |
IUSE="${IUSE} +qemu_user_targets_${target}"
|
| 37 |
done
|
| 38 |
|
| 39 |
DEPEND="app-text/texi2html
|
| 40 |
virtual/pkgconfig
|
| 41 |
sys-libs/zlib[static-libs]
|
| 42 |
dev-libs/glib[static-libs]"
|
| 43 |
RDEPEND=""
|
| 44 |
|
| 45 |
QA_WX_LOAD="
|
| 46 |
usr/bin/qemu-static-ppc64abi32-binfmt
|
| 47 |
usr/bin/qemu-static-ppc64
|
| 48 |
usr/bin/qemu-static-x86_64-binfmt
|
| 49 |
usr/bin/qemu-static-x86_64
|
| 50 |
usr/bin/qemu-static-unicore32-binfmt
|
| 51 |
usr/bin/qemu-static-m68k-binfmt
|
| 52 |
usr/bin/qemu-static-ppc-binfmt
|
| 53 |
usr/bin/qemu-static-alpha-binfmt
|
| 54 |
usr/bin/qemu-static-microblazeel-binfmt
|
| 55 |
usr/bin/qemu-static-sparc-binfmt
|
| 56 |
usr/bin/qemu-static-sparc32plus-binfmt
|
| 57 |
usr/bin/qemu-static-ppc
|
| 58 |
usr/bin/qemu-static-mipsn32el-binfmt
|
| 59 |
usr/bin/qemu-static-sh4eb-binfmt
|
| 60 |
usr/bin/qemu-static-ppc64abi32
|
| 61 |
usr/bin/qemu-static-ppc64-binfmt
|
| 62 |
usr/bin/qemu-static-armeb-binfmt
|
| 63 |
usr/bin/qemu-static-microblaze-binfmt
|
| 64 |
usr/bin/qemu-static-mips-binfmt
|
| 65 |
usr/bin/qemu-static-mipsel-binfmt
|
| 66 |
usr/bin/qemu-static-sh4-binfmt
|
| 67 |
usr/bin/qemu-static-s390x-binfmt
|
| 68 |
usr/bin/qemu-static-i386-binfmt
|
| 69 |
usr/bin/qemu-static-cris-binfmt
|
| 70 |
usr/bin/qemu-static-arm-binfmt
|
| 71 |
usr/bin/qemu-static-sparc64-binfmt
|
| 72 |
usr/bin/qemu-static-mipsn32-binfmt
|
| 73 |
"
|
| 74 |
|
| 75 |
src_prepare() {
|
| 76 |
# prevent docs to get automatically installed
|
| 77 |
sed -i '/$(DESTDIR)$(docdir)/d' Makefile || die
|
| 78 |
# Alter target makefiles to accept CFLAGS set via flag-o
|
| 79 |
sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
|
| 80 |
Makefile Makefile.target || die
|
| 81 |
|
| 82 |
EPATCH_SOURCE="${WORKDIR}/patches" EPATCH_SUFFIX="patch" \
|
| 83 |
EPATCH_FORCE="yes" epatch
|
| 84 |
}
|
| 85 |
|
| 86 |
src_configure() {
|
| 87 |
filter-flags -fpie -fstack-protector
|
| 88 |
|
| 89 |
local conf_opts user_targets
|
| 90 |
|
| 91 |
for target in ${IUSE_USER_TARGETS} ; do
|
| 92 |
use "qemu_user_targets_${target}" && \
|
| 93 |
user_targets="${user_targets} ${target}-linux-user"
|
| 94 |
done
|
| 95 |
|
| 96 |
conf_opts="--enable-linux-user --disable-strip"
|
| 97 |
conf_opts+=" --disable-bsd-user"
|
| 98 |
conf_opts+=" --disable-system"
|
| 99 |
conf_opts+=" --disable-vnc-tls"
|
| 100 |
conf_opts+=" --disable-curses"
|
| 101 |
conf_opts+=" --disable-sdl"
|
| 102 |
conf_opts+=" --disable-seccomp"
|
| 103 |
conf_opts+=" --disable-vde"
|
| 104 |
conf_opts+=" --prefix=/usr --disable-bluez --disable-kvm"
|
| 105 |
conf_opts+=" --cc=$(tc-getCC) --host-cc=$(tc-getBUILD_CC)"
|
| 106 |
conf_opts+=" --disable-smartcard --disable-smartcard-nss"
|
| 107 |
conf_opts+=" --extra-ldflags=-Wl,-z,execheap"
|
| 108 |
conf_opts+=" --disable-strip --disable-werror"
|
| 109 |
conf_opts+=" --static"
|
| 110 |
|
| 111 |
./configure ${conf_opts} --target-list="${user_targets}" || die "econf failed"
|
| 112 |
}
|
| 113 |
|
| 114 |
src_install() {
|
| 115 |
emake DESTDIR="${ED}" install
|
| 116 |
|
| 117 |
# fixup to avoid collisions with qemu
|
| 118 |
base_dir="${ED}/usr/bin"
|
| 119 |
for qemu_bin in "${base_dir}"/qemu-*; do
|
| 120 |
qemu_bin_name=$(basename "${qemu_bin}")
|
| 121 |
mv "${qemu_bin}" "${base_dir}"/"${qemu_bin_name/qemu-/qemu-static-}" || die
|
| 122 |
done
|
| 123 |
|
| 124 |
pax-mark r "${ED}"/usr/bin/qemu-static-*
|
| 125 |
rm -fr "${ED}/usr/share"
|
| 126 |
dohtml qemu-doc.html qemu-tech.html
|
| 127 |
newinitd "${FILESDIR}/qemu-binfmt.initd" qemu-binfmt
|
| 128 |
}
|