gnu: gnome-weather: Fix GNOME integration.

Fixes: <https://issues.guix.gnu.org/39324>.

* gnu/packages/gnome.scm (gnome-weather)[inputs]: Remove gdk-pixbuf.
[arguments]: Use a gexp to defined the phases. Add a 'fix-service-file phase
and adapt 'fix-desktop-file and 'wrap phases. Remove trailing #t.
This commit is contained in:
Mathieu Othacehe 2021-09-27 11:48:38 +00:00
parent 57b32debe3
commit 391fb7a60a
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -9213,10 +9213,8 @@ (define-public gnome-weather
("gtk+:bin" ,gtk+ "bin") ("gtk+:bin" ,gtk+ "bin")
("pkg-config" ,pkg-config))) ("pkg-config" ,pkg-config)))
(inputs (inputs
`( ;("adwaita-icon-theme" ,adwaita-icon-theme) `(("appstream-glib" ,appstream-glib)
("appstream-glib" ,appstream-glib)
("geoclue" ,geoclue) ("geoclue" ,geoclue)
("gdk-pixbuf" ,gdk-pixbuf)
("gjs" ,gjs) ("gjs" ,gjs)
("gnome-desktop" ,gnome-desktop) ("gnome-desktop" ,gnome-desktop)
("libgweather" ,libgweather) ("libgweather" ,libgweather)
@ -9224,24 +9222,29 @@ (define-public gnome-weather
(arguments (arguments
`(#:glib-or-gtk? #t `(#:glib-or-gtk? #t
#:phases #:phases
(modify-phases %standard-phases ,#~(modify-phases %standard-phases
(add-after 'install 'fix-desktop-file (add-after 'unpack 'fix-service-file
;; FIXME: "gapplication launch org.gnome.Weather" fails for some reason. (lambda _
;; See https://issues.guix.gnu.org/issue/39324. (substitute* "data/org.gnome.Weather.service.in"
(lambda* (#:key outputs #:allow-other-keys) (("Exec=[[:graph:]]+")
(let* ((out (assoc-ref outputs "out")) (string-append "Exec=" #$output
(applications (string-append out "/share/applications"))) "/bin/gnome-weather")))))
(substitute* (string-append applications "/org.gnome.Weather.desktop") (add-after 'install 'fix-desktop-file
(("Exec=.*") "Exec=gnome-weather\n")) ;; FIXME: "gapplication launch org.gnome.Weather" fails for some
#t))) ;; reason. See https://issues.guix.gnu.org/issue/39324.
(add-after 'install 'wrap (lambda _
(lambda* (#:key inputs outputs #:allow-other-keys) (let ((applications
(let ((out (assoc-ref outputs "out")) (string-append #$output "/share/applications")))
(gi-typelib-path (getenv "GI_TYPELIB_PATH"))) (substitute* (string-append applications
;; GNOME Weather needs the typelib files of GTK+, Pango etc at runtime. "/org.gnome.Weather.desktop")
(wrap-program (string-append out "/bin/gnome-weather") (("Exec=.*") "Exec=gnome-weather\n")))))
`("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))) (add-after 'install 'wrap
#t)))))) (lambda _
(let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
;; GNOME Weather needs the typelib files of GTK+, Pango etc
;; at runtime.
(wrap-program (string-append #$output "/bin/gnome-weather")
`("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
(synopsis "Weather monitoring for GNOME desktop") (synopsis "Weather monitoring for GNOME desktop")
(description "GNOME Weather is a small application that allows you to (description "GNOME Weather is a small application that allows you to
monitor the current weather conditions for your city, or anywhere in the monitor the current weather conditions for your city, or anywhere in the