gnu: texlive: Update to 2013.
[jackhill/guix/guix.git] / gnu / packages / qemu.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages qemu)
20 #:use-module (guix download)
21 #:use-module (guix packages)
22 #:use-module (guix utils)
23 #:use-module ((guix licenses) #:select (gpl2))
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages glib)
29 #:use-module (gnu packages python)
30 #:use-module (gnu packages ncurses)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages libpng)
33 #:use-module (gnu packages libjpeg)
34 #:use-module (gnu packages attr)
35 #:use-module (gnu packages linux)
36 #:use-module (gnu packages samba)
37 #:use-module (gnu packages xorg)
38 #:use-module (gnu packages perl))
39
40 (define-public qemu-kvm
41 (package
42 (name "qemu-kvm")
43 (version "1.2.0")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://sourceforge/kvm/qemu-kvm/"
47 version "/qemu-kvm-" version ".tar.gz"))
48 (sha256
49 (base32
50 "018vb5nmk2fsm143bs2bl2wirhasd4b10d7jchl32zik4inbk2p9"))))
51 (build-system gnu-build-system)
52 (arguments
53 '(#:phases (alist-replace
54 'configure
55 (lambda* (#:key inputs outputs #:allow-other-keys)
56 ;; The `configure' script doesn't understand some of the
57 ;; GNU options. Thus, add a new phase that's compatible.
58 (let ((out (assoc-ref outputs "out"))
59 (samba (assoc-ref inputs "samba")))
60 (setenv "SHELL" (which "bash"))
61
62 ;; The binaries need to be linked against -lrt.
63 (setenv "LDFLAGS" "-lrt")
64 (zero?
65 (system* "./configure"
66 (string-append "--cc=" (which "gcc"))
67 (string-append "--prefix=" out)
68 (string-append "--smbd=" samba
69 "/sbin/smbd")))))
70 %standard-phases)))
71 (inputs ; TODO: Add optional inputs.
72 `(;; ("mesa" ,mesa)
73 ;; ("libaio" ,libaio)
74 ("glib" ,glib)
75 ("python" ,python)
76 ("ncurses" ,ncurses)
77 ("libpng" ,libpng)
78 ("libjpeg" ,libjpeg-8)
79 ("pixman" ,pixman)
80 ;; ("vde2" ,vde2)
81 ("util-linux" ,util-linux)
82 ;; ("pciutils" ,pciutils)
83 ("pkg-config" ,pkg-config)
84 ("alsa-lib" ,alsa-lib)
85 ;; ("SDL" ,SDL)
86 ("zlib" ,zlib)
87 ("attr" ,attr)
88 ("samba" ,samba))) ; an optional dependency
89 (home-page "http://www.linux-kvm.org/")
90 (synopsis
91 "Virtualization for Linux on x86 hardware containing virtualization extensions")
92 (description
93 "KVM (for Kernel-based Virtual Machine) is a full virtualization solution
94 for Linux on x86 hardware containing virtualization extensions (Intel VT or
95 AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the
96 core virtualization infrastructure and a processor specific module,
97 kvm-intel.ko or kvm-amd.ko. KVM also requires a modified QEMU although work is
98 underway to get the required changes upstream.")
99
100 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
101 (license gpl2)))
102
103 (define-public qemu-kvm/smb-shares
104 ;; A patched QEMU-KVM where `-net smb' yields two shares instead of one: one
105 ;; for the store, and another one for exchanges with the host.
106 (package (inherit qemu-kvm)
107 (name "qemu-kvm-with-multiple-smb-shares")
108 (inputs `(,@(package-inputs qemu-kvm)
109 ("patch/smb-shares"
110 ,(search-patch "qemu-multiple-smb-shares.patch"))))
111 (arguments
112 `(#:patches (list (assoc-ref %build-inputs "patch/smb-shares"))
113 ,@(package-arguments qemu-kvm)))))
114
115 (define-public qemu
116 ;; The real one, with a complete target list.
117 (package (inherit qemu-kvm)
118 (name "qemu")
119 (version "1.5.1")
120 (location (source-properties->location (current-source-location)))
121 (source (origin
122 (method url-fetch)
123 (uri (string-append "http://wiki.qemu-project.org/download/qemu-"
124 version ".tar.bz2"))
125 (sha256
126 (base32
127 "1s7316pgizpayr472la8p8a4vhv7ymmzd5qlbkmq6y9q5zpa25ac"))))
128 (arguments
129 (substitute-keyword-arguments (package-arguments qemu-kvm)
130 ((#:phases phases)
131 `(alist-cons-before
132 'build 'pre-build
133 (lambda* (#:key inputs #:allow-other-keys)
134 (substitute* "tests/libqtest.c"
135 (("/bin/sh") (which "sh"))))
136 ,phases))))
137 (native-inputs `(("perl" ,perl)))
138 (home-page "http://www.qemu-project.org")
139 (description
140 "QEMU is a generic and open source machine emulator and virtualizer.
141
142 When used as a machine emulator, QEMU can run OSes and programs made for one
143 machine (e.g. an ARM board) on a different machine
144 (e.g. your own PC). By using dynamic translation, it achieves very good
145 performance.
146
147 When used as a virtualizer, QEMU achieves near native performances by
148 executing the guest code directly on the host CPU. QEMU supports
149 virtualization when executing under the Xen hypervisor or using
150 the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
151 server and embedded PowerPC, and S390 guests.")))