You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

140 lines
5.9 KiB

  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. (define-module (gnu packages qemu)
  19. #:use-module (guix download)
  20. #:use-module (guix packages)
  21. #:use-module (guix utils)
  22. #:use-module ((guix licenses) #:select (gpl2))
  23. #:use-module (guix build-system gnu)
  24. #:use-module (gnu packages)
  25. #:use-module (gnu packages autotools)
  26. #:use-module (gnu packages texinfo)
  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. (define-public qemu
  40. ;; Since QEMU 1.3, it incorporates KVM support formerly found in QEMU-KVM.
  41. (package
  42. (name "qemu")
  43. (version "1.5.1")
  44. (source (origin
  45. (method url-fetch)
  46. (uri (string-append "http://wiki.qemu-project.org/download/qemu-"
  47. version ".tar.bz2"))
  48. (sha256
  49. (base32
  50. "1s7316pgizpayr472la8p8a4vhv7ymmzd5qlbkmq6y9q5zpa25ac"))))
  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. ;; While we're at it, patch for tests.
  62. (substitute* "tests/libqtest.c"
  63. (("/bin/sh") (which "sh")))
  64. ;; The binaries need to be linked against -lrt.
  65. (setenv "LDFLAGS" "-lrt")
  66. (zero?
  67. (system* "./configure"
  68. (string-append "--cc=" (which "gcc"))
  69. (string-append "--prefix=" out)
  70. (string-append "--smbd=" samba
  71. "/sbin/smbd")))))
  72. (alist-cons-after
  73. 'install 'install-info
  74. (lambda* (#:key inputs outputs #:allow-other-keys)
  75. ;; Install the Info manual, unless Texinfo is missing.
  76. (or (not (assoc-ref inputs "texinfo"))
  77. (let ((out (assoc-ref outputs "out")))
  78. (and (zero? (system* "make" "info"))
  79. (let ((infodir (string-append out "/share/info")))
  80. (mkdir-p infodir)
  81. (for-each (lambda (info)
  82. (copy-file
  83. info
  84. (string-append infodir "/" info)))
  85. (find-files "." "\\.info$"))
  86. #t)))))
  87. %standard-phases))))
  88. (inputs ; TODO: Add optional inputs.
  89. `(;; ("mesa" ,mesa)
  90. ;; ("libaio" ,libaio)
  91. ("glib" ,glib)
  92. ("python" ,python-2) ; incompatible with Python 3 according to error message
  93. ("ncurses" ,ncurses)
  94. ("libpng" ,libpng)
  95. ("libjpeg" ,libjpeg-8)
  96. ("pixman" ,pixman)
  97. ;; ("vde2" ,vde2)
  98. ("util-linux" ,util-linux)
  99. ;; ("pciutils" ,pciutils)
  100. ("pkg-config" ,pkg-config)
  101. ("alsa-lib" ,alsa-lib)
  102. ;; ("SDL" ,SDL)
  103. ("zlib" ,zlib)
  104. ("attr" ,attr)
  105. ("samba" ,samba))) ; an optional dependency
  106. (native-inputs `(("texinfo" ,texinfo)
  107. ("perl" ,perl)))
  108. (home-page "http://www.qemu-project.org")
  109. (synopsis "Machine emulator and virtualizer")
  110. (description
  111. "QEMU is a generic machine emulator and virtualizer.
  112. When used as a machine emulator, QEMU can run OSes and programs made for one
  113. machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
  114. using dynamic translation, it achieves very good performance.
  115. When used as a virtualizer, QEMU achieves near native performances by
  116. executing the guest code directly on the host CPU. QEMU supports
  117. virtualization when executing under the Xen hypervisor or using
  118. the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
  119. server and embedded PowerPC, and S390 guests.")
  120. ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
  121. (license gpl2)))
  122. (define-public qemu/smb-shares
  123. ;; A patched QEMU where `-net smb' yields two shares instead of one: one for
  124. ;; the store, and another one for exchanges with the host.
  125. (package (inherit qemu)
  126. (name "qemu-with-multiple-smb-shares")
  127. (source (origin (inherit (package-source qemu))
  128. (patches
  129. (list (search-patch "qemu-multiple-smb-shares.patch")))))))