gnu: gnome-shell: Remove input labels and use G-expression.

* gnu/packages/gnome.scm (gnome-shell)[native-inputs]: Remove labels.
[arguments]: Convert to G-expressions.  Add (ice-9 match) to #:modules.  Use
SEARCH-INPUT-FILE and #$OUTPUT where appropriate.  Add let-binding for
DISALLOWED-REFERENCES and use them in glib-or-gtk-wrap phase.
This commit is contained in:
Marius Bakke 2022-09-10 16:33:49 +02:00
parent 45c2da3875
commit f011465687
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -8729,113 +8729,117 @@ (define-public gnome-shell
"0ragmcln210zvzhc2br33yprbkj9drjzd7inp5sdxra0a7l73yaj")))) "0ragmcln210zvzhc2br33yprbkj9drjzd7inp5sdxra0a7l73yaj"))))
(build-system meson-build-system) (build-system meson-build-system)
(arguments (arguments
`(#:glib-or-gtk? #t (let ((disallowed-references
#:disallowed-references ,(list (gexp-input glib "bin") (list (gexp-input glib "bin")
(gexp-input libxslt) (gexp-input libxslt)
(gexp-input ruby-sass)) (gexp-input ruby-sass))))
#:configure-flags (list
(list "-Dsystemd=false" #:glib-or-gtk? #t
;; Otherwise, the RUNPATH will lack the final path component. #:disallowed-references disallowed-references
(string-append "-Dc_link_args=-Wl,-rpath=" #:configure-flags
(assoc-ref %outputs "out") #~(list "-Dsystemd=false"
"/lib/gnome-shell")) ;; Otherwise, the RUNPATH will lack the final path component.
(string-append "-Dc_link_args=-Wl,-rpath="
#:modules ((guix build meson-build-system) #$output "/lib/gnome-shell"))
(guix build utils) #:modules '((guix build meson-build-system)
(srfi srfi-1)) (guix build utils)
(ice-9 match)
#:phases (srfi srfi-1))
(modify-phases %standard-phases #:phases
(add-after 'unpack 'fix-keysdir #~(modify-phases %standard-phases
(lambda* (#:key outputs #:allow-other-keys) (add-after 'unpack 'fix-keysdir
(let* ((out (assoc-ref outputs "out")) (lambda _
(keysdir (string-append (let ((keysdir
out "/share/gnome-control-center/keybindings"))) (string-append #$output
(substitute* "meson.build" "/share/gnome-control-center/keybindings")))
(("keysdir =.*") (substitute* "meson.build"
(string-append "keysdir = '" keysdir "'\n")))))) (("keysdir =.*")
(add-after 'unpack 'skip-gtk-update-icon-cache (string-append "keysdir = '" keysdir "'\n"))))))
;; Don't create 'icon-theme.cache'. (add-after 'unpack 'skip-gtk-update-icon-cache
(lambda _ ;; Don't create 'icon-theme.cache'.
(substitute* "meson/postinstall.py" (lambda _
(("gtk-update-icon-cache") "true")))) (substitute* "meson/postinstall.py"
(add-before 'configure 'record-absolute-file-names (("gtk-update-icon-cache") "true"))))
(lambda* (#:key inputs #:allow-other-keys) (add-before 'configure 'record-absolute-file-names
(substitute* "js/misc/ibusManager.js" (lambda* (#:key inputs #:allow-other-keys)
(("'ibus-daemon'") (let ((ibus-daemon (search-input-file inputs "bin/ibus-daemon"))
(string-append "'" (assoc-ref inputs "ibus") (gkbd-keyboard-display
"/bin/ibus-daemon'"))) (search-input-file inputs "bin/gkbd-keyboard-display")))
(substitute* "js/ui/status/keyboard.js" (substitute* "js/misc/ibusManager.js"
(("'gkbd-keyboard-display'") (("'ibus-daemon'")
(string-append "'" (assoc-ref inputs "libgnomekbd") (string-append "'" ibus-daemon "'")))
"/bin/gkbd-keyboard-display'"))))) (substitute* "js/ui/status/keyboard.js"
(add-before 'check 'pre-check (("'gkbd-keyboard-display'")
(lambda* (#:key inputs #:allow-other-keys) (string-append "'" gkbd-keyboard-display "'"))))))
;; Tests require a running X server. (add-before 'check 'pre-check
(system "Xvfb :1 &") (lambda* (#:key inputs #:allow-other-keys)
(setenv "DISPLAY" ":1") ;; Tests require a running X server.
(setenv "HOME" "/tmp"))) ;to avoid "fatal" warnings (system "Xvfb :1 &")
(add-after 'install 'wrap-programs (setenv "DISPLAY" ":1")
(lambda* (#:key inputs outputs #:allow-other-keys) (setenv "HOME" "/tmp"))) ;to avoid "fatal" warnings
(let ((out (assoc-ref outputs "out")) (add-after 'install 'wrap-programs
(gi-typelib-path (getenv "GI_TYPELIB_PATH")) (lambda* (#:key inputs #:allow-other-keys)
(python-path (getenv "GUIX_PYTHONPATH"))) (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH"))
(for-each (python-path (getenv "GUIX_PYTHONPATH")))
(lambda (prog) (for-each
(wrap-program (string-append out "/bin/" prog) (lambda (prog)
`("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))) (wrap-program (string-append #$output "/bin/" prog)
'("gnome-shell" "gnome-extensions-app")) `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
(substitute* (string-append out "/share/gnome-shell/" '("gnome-shell" "gnome-extensions-app"))
"org.gnome.Shell.Extensions") (substitute* (string-append #$output "/share/gnome-shell/"
(("imports\\.package\\.start" all) "org.gnome.Shell.Extensions")
(string-append "'" gi-typelib-path "'.split(':').forEach(" (("imports\\.package\\.start" all)
"path => imports.gi.GIRepository.Repository." (string-append "'" gi-typelib-path "'.split(':').forEach("
"prepend_search_path(path));\n" "path => imports.gi.GIRepository.Repository."
all))) "prepend_search_path(path));\n"
(for-each all)))
(lambda (prog) (for-each
(wrap-program (string-append out "/bin/" prog) (lambda (prog)
`("GUIX_PYTHONPATH" ":" prefix (,python-path)) (wrap-program (string-append #$output "/bin/" prog)
`("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))) `("GUIX_PYTHONPATH" ":" prefix (,python-path))
'("gnome-shell-perf-tool"))))) `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
(add-after 'install 'rewire '("gnome-shell-perf-tool")))))
(lambda* (#:key inputs outputs #:allow-other-keys) (add-after 'install 'rewire
(for-each (lambda* (#:key inputs #:allow-other-keys)
(lambda (tool) (for-each
(call-with-output-file (string-append (lambda (tool)
(assoc-ref outputs "out") (call-with-output-file (string-append #$output
"/bin/" tool) "/bin/" tool)
(lambda (port) (lambda (port)
(format port "#!~a (format port "#!~a
printf '~a is deprecated. Use the \"gnome-extensions\" CLI or \ printf '~a is deprecated. Use the \"gnome-extensions\" CLI or \
\"gnome-extensions-app\" instead.\\n'" \"gnome-extensions-app\" instead.\\n'"
(search-input-file inputs "bin/bash") (search-input-file inputs "bin/bash")
tool)))) tool))))
'("gnome-shell-extension-tool" "gnome-shell-extension-prefs")))) '("gnome-shell-extension-tool" "gnome-shell-extension-prefs"))))
(replace 'glib-or-gtk-wrap (replace 'glib-or-gtk-wrap
(let ((wrap (assoc-ref %standard-phases 'glib-or-gtk-wrap))) (let ((wrap (assoc-ref %standard-phases 'glib-or-gtk-wrap)))
(lambda* (#:key inputs outputs #:allow-other-keys #:rest rest) (lambda* (#:key inputs outputs #:allow-other-keys)
;; By default glib:bin et al. would end up in the XDG_DATA_DIRS ;; By default glib:bin et al. would end up in the XDG_DATA_DIRS
;; settings of the wrappers created by the 'glib-or-gtk-wrap' ;; settings of the wrappers created by the 'glib-or-gtk-wrap'
;; phase. Fix that since we don't need these. ;; phase. Fix that since we don't need these.
(wrap #:inputs (fold alist-delete inputs (wrap #:inputs
'("glib:bin")) (filter (match-lambda
#:outputs outputs))))))) ((label . output)
(not (member output
'#$disallowed-references))))
inputs)
#:outputs outputs))))))))
(native-inputs (native-inputs
`(("asciidoc" ,asciidoc) (list asciidoc
("gettext" ,gettext-minimal) gettext-minimal
("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc. `(,glib "bin") ;for glib-compile-schemas, etc.
("desktop-file-utils" ,desktop-file-utils) ; for update-desktop-database desktop-file-utils ;for update-desktop-database
("gobject-introspection" ,gobject-introspection) gobject-introspection
("hicolor-icon-theme" ,hicolor-icon-theme) hicolor-icon-theme
("perl" ,perl) libxslt
("pkg-config" ,pkg-config) perl
("python" ,python) pkg-config
("ruby-sass" ,ruby-sass) python
("sassc" ,sassc) ruby-sass
("xsltproc" ,libxslt) sassc
;; For tests ;; For tests
("xorg-server" ,xorg-server-for-tests))) xorg-server-for-tests))
(inputs (inputs
(list accountsservice (list accountsservice
caribou caribou
@ -8855,7 +8859,7 @@ (define-public gnome-shell
ibus ibus
libcanberra libcanberra
libcroco libcroco
libgnomekbd ;for gkbd-keyboard-display libgnomekbd ;for gkbd-keyboard-display
libgweather libgweather
libnma libnma
libsoup libsoup