@ -33,24 +33,16 @@
, nixosTestRunner ? false
} :
let
audio = lib . optionalString alsaSupport " a l s a , "
+ lib . optionalString pulseSupport " p a , "
+ lib . optionalString sdlSupport " s d l , "
+ lib . optionalString jackSupport " j a c k , " ;
in
stdenv . mkDerivation rec {
pname = " q e m u "
+ lib . optionalString xenSupport " - x e n "
+ lib . optionalString hostCpuOnly " - h o s t - c p u - o n l y "
+ lib . optionalString nixosTestRunner " - f o r - v m - t e s t s " ;
version = " 6 . 1 . 0 " ;
version = " 6 . 2 . 0 " ;
src = fetchurl {
url = " h t t p s : / / d o w n l o a d . q e m u . o r g / q e m u - ${ version } . t a r . x z " ;
sha256 = " 1 5 i w 7 9 8 2 g 6 v c 4 j y 1 l 9 k k 1 z 9 s l 5 b m 1 b d b w r 7 4 y 7 n v w j s 1 n f f h i g 7 f " ;
sha256 = " 0 i a v l s y 9 h i n 8 k 3 8 2 3 0 j 8 l f m y i p x 3 9 6 5 z l j l s 1 d p 3 4 m m c 8 n 7 5 v q b 8 " ;
} ;
depsBuildBuild = [ buildPackages . stdenv . cc ] ;
@ -101,55 +93,7 @@ stdenv.mkDerivation rec {
sha256 = " 0 9 x z 0 6 g 5 7 w x b a c i c 6 1 7 p q 9 c 0 q b 7 n l y 4 2 g i f 0 r a p l l d n 5 l w 9 6 4 x l 2 " ;
revert = true ;
} )
( fetchpatch {
name = " C V E - 2 0 2 1 - 3 7 1 3 . p a t c h " ; # remove with next release
url = " h t t p s : / / g i t l a b . c o m / q e m u - p r o j e c t / q e m u / - / c o m m i t / 1 3 b 2 5 0 b 1 2 a d 3 c 5 9 1 1 4 a 6 a 1 7 d 5 9 c a f 0 7 3 c e 4 5 b 3 3 a . p a t c h " ;
sha256 = " 0 l k z f c 7 g d l v j 4 r z 9 w k 0 7 f s k i d a q y s m x 8 9 1 1 g 9 1 4 d s 1 j n c z g k 7 1 m f " ;
} )
# Fixes a crash that frequently happens in some setups that share /nix/store over 9p like nixos tests
# on some systems. Remove with next release.
( fetchpatch {
name = " f i x - c r a s h - i n - v 9 f s _ w a l k . p a t c h " ;
url = " h t t p s : / / g i t l a b . c o m / q e m u - p r o j e c t / q e m u / - / c o m m i t / f 8 3 d f 0 0 9 0 0 8 1 6 4 7 6 c c a 4 1 b b 5 3 6 e 4 d 5 3 2 b 2 9 7 d 7 6 e . p a t c h " ;
sha256 = " s h a 2 5 6 - L Y G b B L S 5 Y V g q 8 B f 7 N V k 7 H B F x X q 3 4 N m Z R P C E G 7 9 J P w k 8 = " ;
} )
# Fixes an io error on discard/unmap operation for aio/file backend. Remove with next release.
( fetchpatch {
name = " f i x - a i o - d i s c a r d - r e t u r n - v a l u e . p a t c h " ;
url = " h t t p s : / / g i t l a b . c o m / q e m u - p r o j e c t / q e m u / - / c o m m i t / 1 3 a 0 2 8 3 3 6 f 2 c 0 5 e 7 f f 4 7 d f d a f 3 0 d f a c 7 f 4 8 8 3 e 8 0 . p a t c h " ;
sha256 = " s h a 2 5 6 - 2 3 x V i x V l + J D B N d h e 5 j 5 W Y 8 C B 4 M s n U o + s j r k A k G + J S 6 M = " ;
} )
# Fixes managedsave (snapshot creation) with QXL video device. Remove with next release.
( fetchpatch {
name = " q x l - f i x - p r e - s a v e - l o g i c . p a t c h " ;
url = " h t t p s : / / g i t l a b . c o m / q e m u - p r o j e c t / q e m u / - / c o m m i t / e b 9 4 8 4 6 2 8 0 d f 3 f 1 e 2 a 9 1 b 6 1 7 9 f c 0 5 f 9 8 9 0 b 7 e 3 8 4 . p a t c h " ;
sha256 = " s h a 2 5 6 - p 3 1 f d 4 7 R T S w 9 2 8 D O M r u b Q Q y b n z D A G m 2 3 z 4 Y h e + h G J Q 8 = " ;
} )
# Fixes socket_sockaddr_to_address_unix assertion errors in some setups. Remove with next release.
( fetchpatch {
name = " f i x - u n i x - s o c k e t - p a t h - c o p y - a g a i n . p a t c h " ;
url = " h t t p s : / / g i t l a b . c o m / q e m u - p r o j e c t / q e m u / - / c o m m i t / 1 1 8 d 5 2 7 f 2 e 4 b a e c 5 f e 8 0 6 0 b 2 2 a 6 2 1 2 4 6 8 b 8 e 4 d 3 f . p a t c h " ;
sha256 = " s h a 2 5 6 - o x + J S p c 0 p q d 3 b M i 5 O t 7 l j Q y k 7 0 S X 8 g + B L u f R 0 6 m Z P p s = " ;
} )
] ++ lib . optional nixosTestRunner ./force-uid0-on-9p.patch
++ lib . optionals stdenv . hostPlatform . isMusl [
./sigrtminmax.patch
( fetchpatch {
url = " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / a l p i n e l i n u x / a p o r t s / 2 b b 1 3 3 9 8 6 e 8 f a 9 0 e 2 e 7 6 d 5 3 3 6 9 f 0 3 8 6 1 a 8 7 a 7 4 e f / m a i n / q e m u / f i x - s i g e v e n t - a n d - s i g v a l _ t . p a t c h " ;
sha256 = " 0 w k 0 r r c q y w h r w 9 h y g y 6 a p 0 l f g 3 1 4 m 9 z 1 w r 2 h n 8 3 3 8 r 5 g f c w 7 5 m a v " ;
} )
] ++ lib . optionals stdenv . isDarwin [
# The Hypervisor.framework support patch converted something that can be applied:
# * https://patchwork.kernel.org/project/qemu-devel/list/?series=548227
# The base revision is whatever commit there is before the series starts:
# * https://github.com/patchew-project/qemu/commits/patchew/20210916155404.86958-1-agraf%40csgraf.de
# The target revision is what patchew has as the series tag from patchwork:
# * https://github.com/patchew-project/qemu/releases/tag/patchew%2F20210916155404.86958-1-agraf%40csgraf.de
( fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / p a t c h e w - p r o j e c t / q e m u / c o m p a r e / 7 a d b 9 6 1 9 9 5 a 3 7 4 4 f 5 1 3 9 6 5 0 2 b 3 3 a d 0 4 a 5 6 a 3 1 7 c 3 . . d 2 6 0 3 c 0 6 d 9 c 4 a 2 8 e 7 1 4 b 9 b 7 0 f e 5 a 9 d 0 c 7 b 0 f 9 3 4 d . d i f f " ;
sha256 = " s h a 2 5 6 - n S i 5 p F f 9 + E e f U m y J z S E K e u x O t 3 9 z t g k X Q y U B 8 f T H l c Y = " ;
} )
] ;
] ++ lib . optional nixosTestRunner ./force-uid0-on-9p.patch ;
postPatch = ''
# Otherwise tries to ensure /var/run exists.
@ -180,12 +124,9 @@ stdenv.mkDerivation rec {
- - replace ' $ source_path/VERSION ' ' $ source_path/QEMU_VERSION '
substituteInPlace meson . build \
- - replace " ' V E R S I O N ' " " ' Q E M U _ V E R S I O N ' "
'' + l i b . o p t i o n a l S t r i n g s t d e n v . h o s t P l a t f o r m . i s M u s l ''
NIX_CFLAGS_COMPILE + = " - D _ L I N U X _ S Y S I N F O _ H "
'' ;
configureFlags = [
" - - a u d i o - d r v - l i s t = ${ audio } "
" - - d i s a b l e - s t r i p " # We'll strip ourselves after separating debug info.
" - - e n a b l e - d o c s "
" - - e n a b l e - t o o l s "