me
/
guix
Archived
1
0
Fork 0

gnu: virt-manager: Update package style.

* gnu/packages/virtualization.scm (virt-manager)[arguments]: Remove trailing #t.
Use gexps.
[inputs]: Sort alphabetically.
[native-inputs]: Remove labels.

Change-Id: I6efe95061ff13feb01c45809004884ab0a563d0c
master
Hilton Chain 2024-01-23 23:58:33 +08:00
parent f6f52bb8f9
commit e6814d6c34
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
1 changed files with 75 additions and 78 deletions

View File

@ -1623,98 +1623,95 @@ virtualization library.")
"18lhlnd3gmyzhbnjc16gdyzhjcd33prlxnca4xlidiidngbq21lm")))) "18lhlnd3gmyzhbnjc16gdyzhjcd33prlxnca4xlidiidngbq21lm"))))
(build-system python-build-system) (build-system python-build-system)
(arguments (arguments
`(#:use-setuptools? #f ; uses custom distutils 'install' command (list #:use-setuptools? #f ; uses custom distutils 'install' command
#:tests? #f ; TODO The tests currently fail #:tests? #f ; TODO: The tests currently fail
; RuntimeError: Loop condition wasn't ; RuntimeError: Loop condition wasn't met
; met #:imported-modules
#:imported-modules ((guix build glib-or-gtk-build-system) `((guix build glib-or-gtk-build-system)
,@%python-build-system-modules) ,@%python-build-system-modules)
#:modules ((ice-9 match) #:modules
(srfi srfi-26) '((ice-9 match)
(guix build python-build-system) (srfi srfi-26)
((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) (guix build python-build-system)
(guix build utils)) ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
#:phases (guix build utils))
(modify-phases %standard-phases #:phases
(add-after 'unpack 'fix-setup #~(modify-phases %standard-phases
(lambda* (#:key outputs #:allow-other-keys) (add-after 'unpack 'fix-setup
(substitute* "virtinst/buildconfig.py" (lambda _
(("/usr") (assoc-ref outputs "out"))) (substitute* "virtinst/buildconfig.py"
#t)) (("/usr") #$output))))
(add-after 'unpack 'fix-default-uri (add-after 'unpack 'fix-default-uri
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; Xen is not available for now - so only patch qemu. ;; Xen is not available for now - so only patch qemu.
(substitute* "virtManager/createconn.py" (substitute* "virtManager/createconn.py"
(("/usr(/bin/qemu-system-[a-zA-Z0-9_-]+)" _ suffix) (("/usr(/bin/qemu-system-[a-zA-Z0-9_-]+)" _ suffix)
(search-input-file inputs suffix))) (search-input-file inputs suffix)))))
#t)) (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
(add-before 'wrap 'wrap-with-GI_TYPELIB_PATH (lambda* (#:key inputs #:allow-other-keys)
(lambda* (#:key inputs outputs #:allow-other-keys) (let* ((bin (string-append #$output "/bin"))
(let* ((bin (string-append (assoc-ref outputs "out") "/bin")) (bin-files (find-files bin ".*"))
(bin-files (find-files bin ".*")) (paths (map (match-lambda
(paths (map (match-lambda ((output . directory)
((output . directory) (let* ((girepodir (string-append
(let* ((girepodir (string-append directory
directory "/lib/girepository-1.0")))
"/lib/girepository-1.0"))) (if (file-exists? girepodir)
(if (file-exists? girepodir) girepodir #f))))
girepodir #f)))) inputs)))
inputs))) (for-each (lambda (file)
(for-each (lambda (file) (format #t "wrapping ~a\n" file)
(format #t "wrapping ~a\n" file) (wrap-program file
(wrap-program file `("GI_TYPELIB_PATH" ":" prefix
`("GI_TYPELIB_PATH" ":" prefix ,(filter identity paths))))
,(filter identity paths)))) bin-files))))
bin-files)) (replace 'check
#t)) (lambda* (#:key tests? #:allow-other-keys)
(replace 'check (when tests?
(lambda* (#:key tests? #:allow-other-keys) (setenv "HOME" "/tmp")
(when tests? (setenv "XDG_CACHE_HOME" "/tmp")
(setenv "HOME" "/tmp") (system "Xvfb :1 &")
(setenv "XDG_CACHE_HOME" "/tmp") (setenv "DISPLAY" ":1")
(system "Xvfb :1 &") ;; Dogtail requires that Assistive Technology support be enabled
(setenv "DISPLAY" ":1") (setenv "GTK_MODULES" "gail:atk-bridge")
;; Dogtail requires that Assistive Technology support be enabled (invoke "dbus-run-session" "--" "pytest" "--uitests"))))
(setenv "GTK_MODULES" "gail:atk-bridge") (add-after 'install 'glib-or-gtk-compile-schemas
(invoke "dbus-run-session" "--" "pytest" "--uitests")) (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
#t)) (add-after 'wrap 'glib-or-gtk-wrap
(add-after 'install 'glib-or-gtk-compile-schemas (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
(add-after 'wrap 'glib-or-gtk-wrap
(assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
(inputs (inputs
(list dconf (list dconf
gtk+ gtk+
gtk-vnc gtk-vnc
gtksourceview-4 gtksourceview-4
libosinfo
libvirt libvirt
libvirt-glib libvirt-glib
libosinfo
vte
python-libvirt python-libvirt
python-requests python-libxml2
python-pycairo python-pycairo
python-pygobject python-pygobject
python-libxml2 python-requests
spice-gtk)) spice-gtk
vte))
;; virt-manager searches for qemu-img or kvm-img in the PATH. ;; virt-manager searches for qemu-img or kvm-img in the PATH.
(propagated-inputs (propagated-inputs
(list qemu)) (list qemu))
(native-inputs (native-inputs
`(("glib" ,glib "bin") ; glib-compile-schemas (list `(,glib "bin") ; glib-compile-schemas
("gobject-introspection" ,gobject-introspection) gobject-introspection
("gtk+" ,gtk+ "bin") ; gtk-update-icon-cache `(,gtk+ "bin") ; gtk-update-icon-cache
("perl" ,perl) ; pod2man intltool
("intltool" ,intltool) perl ; pod2man
("rst2man" ,python-docutils) python-docutils ; rst2man
;; The following are required for running the tests ;; The following are required for running the tests
;; ("python-pytest" ,python-pytest) ;; at-spi2-core
;; ("python-dogtail" ,python-dogtail) ;; dbus
;; ("xvfb" ,xorg-server-for-tests) ;; gsettings-desktop-schemas
;; ("dbus" ,dbus) ;; python-dogtail
;; ("at-spi2-core" ,at-spi2-core) ;; python-pytest
;; ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) ;; xorg-server-for-tests ; xvfb
)) ))
(home-page "https://virt-manager.org/") (home-page "https://virt-manager.org/")
(synopsis "Manage virtual machines") (synopsis "Manage virtual machines")
(description (description