Archived
1
0
Fork 0

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,28 +8729,29 @@ properties, screen resolution, and other GNOME parameters.")
"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))))
(list
#:glib-or-gtk? #t
#:disallowed-references disallowed-references
#:configure-flags #:configure-flags
(list "-Dsystemd=false" #~(list "-Dsystemd=false"
;; Otherwise, the RUNPATH will lack the final path component. ;; Otherwise, the RUNPATH will lack the final path component.
(string-append "-Dc_link_args=-Wl,-rpath=" (string-append "-Dc_link_args=-Wl,-rpath="
(assoc-ref %outputs "out") #$output "/lib/gnome-shell"))
"/lib/gnome-shell")) #:modules '((guix build meson-build-system)
#:modules ((guix build meson-build-system)
(guix build utils) (guix build utils)
(ice-9 match)
(srfi srfi-1)) (srfi srfi-1))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'fix-keysdir (add-after 'unpack 'fix-keysdir
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (let ((keysdir
(keysdir (string-append (string-append #$output
out "/share/gnome-control-center/keybindings"))) "/share/gnome-control-center/keybindings")))
(substitute* "meson.build" (substitute* "meson.build"
(("keysdir =.*") (("keysdir =.*")
(string-append "keysdir = '" keysdir "'\n")))))) (string-append "keysdir = '" keysdir "'\n"))))))
@ -8761,14 +8762,15 @@ properties, screen resolution, and other GNOME parameters.")
(("gtk-update-icon-cache") "true")))) (("gtk-update-icon-cache") "true"))))
(add-before 'configure 'record-absolute-file-names (add-before 'configure 'record-absolute-file-names
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((ibus-daemon (search-input-file inputs "bin/ibus-daemon"))
(gkbd-keyboard-display
(search-input-file inputs "bin/gkbd-keyboard-display")))
(substitute* "js/misc/ibusManager.js" (substitute* "js/misc/ibusManager.js"
(("'ibus-daemon'") (("'ibus-daemon'")
(string-append "'" (assoc-ref inputs "ibus") (string-append "'" ibus-daemon "'")))
"/bin/ibus-daemon'")))
(substitute* "js/ui/status/keyboard.js" (substitute* "js/ui/status/keyboard.js"
(("'gkbd-keyboard-display'") (("'gkbd-keyboard-display'")
(string-append "'" (assoc-ref inputs "libgnomekbd") (string-append "'" gkbd-keyboard-display "'"))))))
"/bin/gkbd-keyboard-display'")))))
(add-before 'check 'pre-check (add-before 'check 'pre-check
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; Tests require a running X server. ;; Tests require a running X server.
@ -8776,16 +8778,15 @@ properties, screen resolution, and other GNOME parameters.")
(setenv "DISPLAY" ":1") (setenv "DISPLAY" ":1")
(setenv "HOME" "/tmp"))) ;to avoid "fatal" warnings (setenv "HOME" "/tmp"))) ;to avoid "fatal" warnings
(add-after 'install 'wrap-programs (add-after 'install 'wrap-programs
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")) (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH"))
(gi-typelib-path (getenv "GI_TYPELIB_PATH"))
(python-path (getenv "GUIX_PYTHONPATH"))) (python-path (getenv "GUIX_PYTHONPATH")))
(for-each (for-each
(lambda (prog) (lambda (prog)
(wrap-program (string-append out "/bin/" prog) (wrap-program (string-append #$output "/bin/" prog)
`("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))) `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
'("gnome-shell" "gnome-extensions-app")) '("gnome-shell" "gnome-extensions-app"))
(substitute* (string-append out "/share/gnome-shell/" (substitute* (string-append #$output "/share/gnome-shell/"
"org.gnome.Shell.Extensions") "org.gnome.Shell.Extensions")
(("imports\\.package\\.start" all) (("imports\\.package\\.start" all)
(string-append "'" gi-typelib-path "'.split(':').forEach(" (string-append "'" gi-typelib-path "'.split(':').forEach("
@ -8794,16 +8795,15 @@ properties, screen resolution, and other GNOME parameters.")
all))) all)))
(for-each (for-each
(lambda (prog) (lambda (prog)
(wrap-program (string-append out "/bin/" prog) (wrap-program (string-append #$output "/bin/" prog)
`("GUIX_PYTHONPATH" ":" prefix (,python-path)) `("GUIX_PYTHONPATH" ":" prefix (,python-path))
`("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))) `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
'("gnome-shell-perf-tool"))))) '("gnome-shell-perf-tool")))))
(add-after 'install 'rewire (add-after 'install 'rewire
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(for-each (for-each
(lambda (tool) (lambda (tool)
(call-with-output-file (string-append (call-with-output-file (string-append #$output
(assoc-ref outputs "out")
"/bin/" tool) "/bin/" tool)
(lambda (port) (lambda (port)
(format port "#!~a (format port "#!~a
@ -8814,28 +8814,32 @@ printf '~a is deprecated. Use the \"gnome-extensions\" CLI or \
'("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