Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;; qemu.scm
- ;; I'm on debian, with guix installed via curl. My guix version:
- ;;
- ;; $ guix --version
- ;; guix (GNU Guix) 1.4.0
- ;; Copyright (C) 2022 the Guix authors
- ;; License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- ;; This is free software: you are free to change and redistribute it.
- ;; There is NO WARRANTY, to the extent permitted by law.
- ;;
- ;; I run build the file like so:
- ;;
- ;; $ time guix package -v3 -K -f qemu.scm
- ;; /home/stites/dev/guix/mnt-reform-nonguix/qemu.scm:45:18: error: (else (quote ())): bad use of 'else' syntactic keyword
- ;; guix package -v3 -K -f qemu.scm 0.87s user 0.11s system 132% cpu 0.741 total
- (define-module (qemu)
- #:use-module (gnu packages)
- #:use-module (gnu packages virtualization))
- ;; the rest (minus the last line) of this is c/p'd from qemu-minimal with a :%s/qemu-minimal/myqemu/g applied.
- (define-public myqemu
- ;; QEMU without GUI support, only supporting the host's architecture
- (package/inherit qemu
- (name "myqemu")
- (outputs '("out" "doc"))
- (synopsis
- "Machine emulator and virtualizer (without GUI) for the host architecture")
- (arguments
- (substitute-keyword-arguments (package-arguments qemu)
- ((#:configure-flags configure-flags #~'())
- ;; Restrict to the host's architecture.
- (let* ((system (or (%current-target-system)
- (%current-system)))
- (target-list-arg
- (match system
- ((? (cut string-prefix? "i686" <>))
- "--target-list=i386-softmmu")
- ((? (cut string-prefix? "x86_64" <>))
- "--target-list=i386-softmmu,x86_64-softmmu")
- ((? (cut string-prefix? "mips64" <>))
- (string-append "--target-list=mips-softmmu,mipsel-softmmu,"
- "mips64-softmmu,mips64el-softmmu"))
- ((? (cut string-prefix? "mips" <>))
- "--target-list=mips-softmmu,mipsel-softmmu")
- ((? (cut string-prefix? "aarch64" <>))
- "--target-list=arm-softmmu,aarch64-softmmu")
- ((? (cut string-prefix? "arm" <>))
- "--target-list=arm-softmmu")
- ((? (cut string-prefix? "alpha" <>))
- "--target-list=alpha-softmmu")
- ((? (cut string-prefix? "powerpc64" <>))
- "--target-list=ppc-softmmu,ppc64-softmmu")
- ((? (cut string-prefix? "powerpc" <>))
- "--target-list=ppc-softmmu")
- ((? (cut string-prefix? "s390" <>))
- "--target-list=s390x-softmmu")
- ((? (cut string-prefix? "riscv" <>))
- "--target-list=riscv32-softmmu,riscv64-softmmu")
- (else ; An empty list actually builds all the targets.
- '()))))
- #~(cons #$target-list-arg #$configure-flags)))
- ((#:phases phases)
- #~(modify-phases #$phases
- (delete 'configure-user-static)
- (delete 'build-user-static)
- (delete 'install-user-static)))))
- ;; Remove dependencies on optional libraries, notably GUI libraries.
- (native-inputs (filter (lambda (input)
- (match input
- ;; Work around the fact that modify-inputs can not
- ;; delete specific outputs; i.e. here we should keep
- ;; `(,glib "bin"), but not `(,glib "static").
- ((label package output)
- (not (string=? "static" output)))
- (_ input)))
- (modify-inputs (package-native-inputs qemu)
- (delete "gettext-minimal"))))
- (inputs (modify-inputs (package-inputs qemu)
- (delete "libusb"
- "mesa"
- "sdl2"
- "spice"
- "virglrenderer"
- "gtk+"
- "usbredir"
- "libdrm"
- "libepoxy"
- "pulseaudio"
- "vde2"
- "libcacard")))))
- ;;; and then I c/p here to build with guix package
- myqemu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement