From 72b9eebf686381fae5b20652863108d3d8e5a743 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 10 Feb 2013 18:28:00 +0100 Subject: gnu: Add QEMU. * gnu/packages/autotools.scm (autoconf-wrapper): Make public. * gnu/packages/qemu.scm (qemu): New variable. --- gnu/packages/autotools.scm | 2 +- gnu/packages/qemu.scm | 56 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm index 5c90361de1..bc4dddc01f 100644 --- a/gnu/packages/autotools.scm +++ b/gnu/packages/autotools.scm @@ -62,7 +62,7 @@ (define-public autoconf can use, in the form of M4 macro calls.") (license gpl3+))) ; some files are under GPLv2+ -(define autoconf-wrapper +(define-public autoconf-wrapper ;; An Autoconf wrapper that generates `configure' scripts that use our ;; own Bash instead of /bin/sh in shebangs. For that reason, it ;; should only be used internally---users should not end up diff --git a/gnu/packages/qemu.scm b/gnu/packages/qemu.scm index b79da989a6..e6859aadf0 100644 --- a/gnu/packages/qemu.scm +++ b/gnu/packages/qemu.scm @@ -19,8 +19,10 @@ (define-module (gnu packages qemu) #:use-module (guix download) #:use-module (guix packages) + #:use-module (guix utils) #:use-module ((guix licenses) #:select (gpl2)) #:use-module (guix build-system gnu) + #:use-module (gnu packages autotools) #:use-module (gnu packages pkg-config) #:use-module (gnu packages glib) #:use-module (gnu packages python) @@ -29,7 +31,8 @@ (define-module (gnu packages qemu) #:use-module (gnu packages libpng) #:use-module (gnu packages libjpeg) #:use-module (gnu packages attr) - #:use-module (gnu packages linux)) + #:use-module (gnu packages linux) + #:use-module (gnu packages perl)) (define-public qemu-kvm (package @@ -87,3 +90,54 @@ (define-public qemu-kvm ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'. (license gpl2))) + +(define-public qemu + ;; The real one, with a complete target list. + (package (inherit qemu-kvm) + (name "qemu") + (version "1.3.1") + (location (source-properties->location (current-source-location))) + (source (origin + (method url-fetch) + (uri (string-append "http://wiki.qemu-project.org/download/qemu-" + version ".tar.bz2")) + (sha256 + (base32 + "1bqfrb5dlsxm8gxhkksz8qzi5fhj3xqhxyfwbqcphhcv1kpyfwip")))) + (arguments + (substitute-keyword-arguments (package-arguments qemu-kvm) + ((#:phases phases) + `(alist-cons-before + 'build 'pre-build + (lambda* (#:key inputs #:allow-other-keys) + (let ((libtool (assoc-ref inputs "libtool")) + (pkg-config (assoc-ref inputs "pkg-config"))) + ;; XXX: For lack of generic search path handling. + (setenv "ACLOCAL_PATH" + (format #f "~a/share/aclocal:~a/share/aclocal" + libtool pkg-config))) + + ;; For pixman's `configure' script. + (setenv "CONFIG_SHELL" (which "bash")) + + (substitute* "pixman/configure.ac" + (("AM_CONFIG_HEADER") "AC_CONFIG_HEADERS"))) + ,phases)))) + (native-inputs `(("autoconf" ,autoconf-wrapper) ; for "pixman" + ("automake" ,automake) + ("libtool" ,libtool) + ("libtool-bin" ,libtool "bin") + ("perl" ,perl))) + (description + "QEMU is a generic and open source machine emulator and virtualizer. + +When used as a machine emulator, QEMU can run OSes and programs made for one +machine (e.g. an ARM board) on a different machine +(e.g. your own PC). By using dynamic translation, it achieves very good +performance. + +When used as a virtualizer, QEMU achieves near native performances by +executing the guest code directly on the host CPU. QEMU supports +virtualization when executing under the Xen hypervisor or using +the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, +server and embedded PowerPC, and S390 guests."))) -- cgit v1.2.3