# Contributor: Valery Kartel # Maintainer: Natanael Copa pkgname=qemu pkgver=2.5.1 pkgrel=0 pkgdesc="QEMU is a generic machine emulator and virtualizer" url="http://qemu.org/" arch="all" license="GPL2 LGPL-2" makedepends=" alsa-lib-dev bison curl-dev flex glib-dev gnutls-dev gtk+3.0-dev libaio-dev libcap-dev libcap-ng-dev libjpeg-turbo-dev libnfs-dev libpng-dev libssh2-dev libusb-dev linux-headers lzo-dev ncurses-dev paxmark snappy-dev spice-dev usbredir-dev util-linux-dev vde2-dev xfsprogs-dev zlib-dev " depends= install="$pkgname.pre-install" subpackages=" $pkgname-aarch64:aarch64 $pkgname-alpha:alpha $pkgname-arm:arm $pkgname-armeb:armeb $pkgname-cris:cris $pkgname-i386:i386 $pkgname-m68k:m68k $pkgname-microblaze:microblaze $pkgname-microblazeel:microblazeel $pkgname-mips:mips $pkgname-mips64:mips64 $pkgname-mips64el:mips64el $pkgname-mipsel:mipsel $pkgname-mipsn32:mipsn32 $pkgname-mipsn32el:mipsn32el $pkgname-or32:or32 $pkgname-ppc:ppc $pkgname-ppc64:ppc64 $pkgname-ppc64abi32:ppc64abi32 $pkgname-ppc64le:ppc64le $pkgname-s390x:s390x $pkgname-sh4:sh4 $pkgname-sh4eb:sh4eb $pkgname-sparc:sparc $pkgname-sparc32plus:sparc32plus $pkgname-sparc64:sparc64 $pkgname-system-aarch64:system_aarch64 $pkgname-system-alpha:system_alpha $pkgname-system-arm:system_arm $pkgname-system-cris:system_cris $pkgname-system-i386:system_i386 $pkgname-system-lm32:system_lm32 $pkgname-system-m68k:system_m68k $pkgname-system-microblaze:system_microblaze $pkgname-system-microblazeel:system_microblazeel $pkgname-system-mips:system_mips $pkgname-system-mips64:system_mips64 $pkgname-system-mips64el:system_mips64el $pkgname-system-mipsel:system_mipsel $pkgname-system-moxie:system_moxie $pkgname-system-or32:system_or32 $pkgname-system-ppc:system_ppc $pkgname-system-ppc64:system_ppc64 $pkgname-system-ppcemb:system_ppcemb $pkgname-system-s390x:system_s390x $pkgname-system-sh4:system_sh4 $pkgname-system-sh4eb:system_sh4eb $pkgname-system-sparc:system_sparc $pkgname-system-sparc64:system_sparc64 $pkgname-system-tricore:system_tricore $pkgname-system-unicore32:system_unicore32 $pkgname-system-x86_64:system_x86_64 $pkgname-system-xtensa:system_xtensa $pkgname-system-xtensaeb:system_xtensaeb $pkgname-unicore32:unicore32 $pkgname-x86_64:x86_64 $pkgname-guest-agent:guest " case "$CARCH" in x86) _arch=i386 subpackages="$subpackages $pkgname-gtk" ;; x86_64) _arch=x86_64 subpackages="$subpackages $pkgname-gtk" ;; *) _arch="" ;; esac subpackages="$subpackages $pkgname-img" source="http://wiki.qemu-project.org/download/$pkgname-$pkgver.tar.bz2 0001-elfload-load-PIE-executables-to-right-address.patch 0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch musl-F_SHLCK-and-F_EXLCK.patch fix-sigevent-and-sigval_t.patch $pkgname-guest-agent.confd $pkgname-guest-agent.initd 80-kvm.rules " _builddir="$srcdir"/$pkgname-$pkgver prepare() { cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done # prevent docs to get automatically installed sed -i '/$(DESTDIR)$(docdir)/d' Makefile sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \ Makefile.target } _compile() { ../configure \ --prefix=/usr \ --localstatedir=/var \ --sysconfdir=/etc \ --libexecdir=/usr/lib/qemu \ --audio-drv-list=oss,alsa \ --enable-kvm \ --enable-vde \ --enable-virtfs \ --enable-curl \ --enable-cap-ng \ --enable-linux-aio \ --enable-usb-redir \ --enable-uuid \ --enable-libssh2 \ --enable-vhost-net \ --enable-pie \ --enable-snappy \ --enable-tpm \ --enable-libnfs \ --enable-lzo \ --disable-glusterfs \ --disable-debug-info \ --disable-bsd-user \ --disable-werror \ --disable-sdl \ --disable-xen \ --cc="${CC:-gcc}" \ "$@" \ || return 1 make ARFLAGS="rc" || return 1 } build() { mkdir -p "$_builddir"/build \ "$_builddir"/build-gtk cd "$_builddir"/build _compile \ --enable-vnc \ --enable-vnc-png \ --enable-vnc-jpeg \ --enable-spice \ --enable-linux-user \ --enable-guest-agent \ --disable-gtk \ || return 1 # tests fails on x86 # http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg01429.html # http://web.archiveorange.com/archive/v/21oVv8wOfpQGkyy8EK0N # make check || return 1 [ -z "$_arch" ] && return 0 cd "$_builddir"/build-gtk _compile \ --enable-gtk \ --with-gtkabi=3.0 \ --disable-linux-user \ --disable-vnc \ --disable-spice \ --disable-guest-agent \ --target-list="$_arch-softmmu" \ || return 1 } package() { cd "$_builddir"/build make DESTDIR="$pkgdir" install || return 1 install -Dm644 "$srcdir"/80-kvm.rules \ "$pkgdir"/lib/udev/rules.d/80-kvm.rules || return 1 paxmark -m "$pkgdir"/usr/bin/qemu-system-* || return 1 gzip "$pkgdir"/usr/share/man/man1/* gzip "$pkgdir"/usr/share/man/man8/* [ -z "$_arch" ] && return 0 cd "$_builddir"/build-gtk install $_arch-softmmu/qemu-system-$_arch \ "$pkgdir"/usr/bin/qemu-system-$_arch-gtk } _subsys() { pkgdesc="Qemu ${1/-/ } emulator" depends="qemu" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-$1 "$subpkgdir"/usr/bin/ || return 1 } aarch64() { _subsys aarch64; } alpha() { _subsys alpha; } arm() { _subsys arm; } armeb() { _subsys armeb; } cris() { _subsys cris; } i386() { _subsys i386; } m68k() { _subsys m68k; } microblaze() { _subsys microblaze; } microblazeel() { _subsys microblazeel; } mips() { _subsys mips; } mips64() { _subsys mips64; } mips64el() { _subsys mips64el; } mipsel() { _subsys mipsel; } mipsn32() { _subsys mipsn32; } mipsn32el() { _subsys mipsn32el; } or32() { _subsys or32; } ppc() { _subsys ppc; } ppc64() { _subsys ppc64; } ppc64abi32() { _subsys ppc64abi32; } ppc64le() { _subsys ppc64le; } s390x() { _subsys s390x; } sh4() { _subsys sh4; } sh4eb() { _subsys sh4eb; } sparc() { _subsys sparc; } sparc32plus() { _subsys sparc32plus; } sparc64() { _subsys sparc64; } system_aarch64() { _subsys system-aarch64; } system_alpha() { _subsys system-alpha; } system_arm() { _subsys system-arm; } system_cris() { _subsys system-cris; } system_i386() { _subsys system-i386; } system_lm32() { _subsys system-lm32; } system_m68k() { _subsys system-m68k; } system_microblaze() { _subsys system-microblaze; } system_microblazeel() { _subsys system-microblazeel; } system_mips() { _subsys system-mips; } system_mips64() { _subsys system-mips64; } system_mips64el() { _subsys system-mips64el; } system_mipsel() { _subsys system-mipsel; } system_moxie() { _subsys system-moxie; } system_or32() { _subsys system-or32; } system_ppc() { _subsys system-ppc; } system_ppc64() { _subsys system-ppc64; } system_ppcemb() { _subsys system-ppcemb; } system_s390x() { _subsys system-s390x; } system_sh4() { _subsys system-sh4; } system_sh4eb() { _subsys system-sh4eb; } system_sparc() { _subsys system-sparc; } system_tricore() { _subsys system-tricore; } system_sparc64() { _subsys system-sparc64; } system_unicore32() { _subsys system-unicore32; } system_x86_64() { _subsys system-x86_64; } system_xtensa() { _subsys system-xtensa; } system_xtensaeb() { _subsys system-xtensaeb; } unicore32() { _subsys unicore32; } x86_64() { _subsys x86_64; } gtk() { _subsys system-$_arch-gtk; } img() { pkgdesc="QEMU command line tool for manipulating disk images" replaces="qemu" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-img \ "$pkgdir"/usr/bin/qemu-io \ "$subpkgdir"/usr/bin/ # we exploit the fact that -img subpackage are created last # and check that we done have new systems that belongs in # subpackage local _bins= _ret=0 for i in "$pkgdir"/usr/bin/qemu-system-*; do if [ -r "$i" ]; then error "Please create a subpackage for ${i##*/}" _ret=1 fi done return $_ret } guest() { pkgdesc="QEMU guest agent" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-ga "$subpkgdir"/usr/bin/ install -Dm755 "$srcdir"/$pkgname-guest-agent.initd \ "$subpkgdir"/etc/init.d/$pkgname-guest-agent || return 1 install -Dm644 "$srcdir"/$pkgname-guest-agent.confd \ "$subpkgdir"/etc/conf.d/$pkgname-guest-agent || return 1 } md5sums="42e73182dea8b9213fa7050e168a4615 qemu-2.5.1.tar.bz2 672727bb1d8c8ab7b5def65dd1793c33 0001-elfload-load-PIE-executables-to-right-address.patch d364208c4847ad2baeb237900befecd1 0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch bc5f2e41ed3b6d6d30b672adab82e3e1 musl-F_SHLCK-and-F_EXLCK.patch 9afbd6c9586229ce64275f012d665e2a fix-sigevent-and-sigval_t.patch 1663bc6977f6886a58394155b1bf3676 qemu-guest-agent.confd ea972f2fc5505488f68320bf386106bb qemu-guest-agent.initd 66660f143235201249dc0648b39b86ee 80-kvm.rules" sha256sums="028752c33bb786abbfe496ba57315dc5a7d0a33b5a7a767f6d7a29020c525d2c qemu-2.5.1.tar.bz2 af35304b165622a53f7557b59ffd8da5030f5fd444e669c862f9410131f3b987 0001-elfload-load-PIE-executables-to-right-address.patch 6af6cf9044997710a6d0fbdba30a35c8d775e30d30c032ec97db672f75ec88ac 0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch eefd597197223899d3b12d8274af493153e270fd06ea8622e33d6eaeae063d40 musl-F_SHLCK-and-F_EXLCK.patch 9abdf3410dea742cac3552363950c8a7fbcec8dd2bfd68e3c417a284f4e702f5 fix-sigevent-and-sigval_t.patch d84e53a94584f37f3bd1b21f44077b5de0d07094c6729f26ae20ab1f7b9cc298 qemu-guest-agent.confd 5bef90ccab2e743868fd562eee9a3ded35c8d3e01fa387367ed55a0da95570d5 qemu-guest-agent.initd 37f666f1cdb7d8a62171de69b531681dcb0fba74236729dac8b6c019232eba84 80-kvm.rules" sha512sums="66959ad6a2a89f23c5daba245c76f71ddc03a33a1167bca639a042ebbf7329b2e698cd2c0e65c22a9874563a34256a48386aa9df6475b06d38db74187e3e3b3f qemu-2.5.1.tar.bz2 405008589cad1c8b609eca004d520bf944366e8525f85a19fc6e283c95b84b6c2429822ba064675823ab69f1406a57377266a65021623d1cd581e7db000134fd 0001-elfload-load-PIE-executables-to-right-address.patch ec84b27648c01c6e58781295dcd0c2ff8e5a635f9836ef50c1da5d0ed125db1afc4cb5b01cb97606d6dd8f417acba93e1560d9a32ca29161a4bb730b302440ea 0006-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch 5de10f7e8abae16d1d7521e5ca1bfb62a8f295b324bea84f122f882b7b9354c21e5a00b20a1c5484c1b737b937e53c4ca6979e55705522f0779a5669725369f5 musl-F_SHLCK-and-F_EXLCK.patch e3f006c28318669356cd5b778f26774f06b0a40a4ac852573379df63efcc8276869958faec16797a38bf96c6061dfc040309e462d8559984f67eaf4af701ca1a fix-sigevent-and-sigval_t.patch d90c034cae3f9097466854ed1a9f32ab4b02089fcdf7320e8f4da13b2b1ff65067233f48809911485e4431d7ec1a22448b934121bc9522a2dc489009e87e2b1f qemu-guest-agent.confd 316b40d97587fea717821852859d81039cfdcb276a658bb6e6fb554e321d5856a833ebb3778149c4732cea625bac320b1008d374c88a9aae35c0fb67977c01b7 qemu-guest-agent.initd 9b7a89b20fcf737832cb7b4d5dc7d8301dd88169cbe5339eda69fbb51c2e537d8cb9ec7cf37600899e734209e63410d50d0821bce97e401421db39c294d97be2 80-kvm.rules"