Archived
1
0
Fork 0

gnu: gdm: Use gexps and new style inputs.

* gnu/packages/gnome.scm (gdm)[phases]: Use gexps.
{pre-configure}: Use search-input-file.
{install-logo}: Likewise, and use #$output.
{install-placeholder-desktop-entry}: use search-input-directory.
{link-autostart-files}: Use this-package-input, $output.
[native-inputs]: Remove labels and sort in lexicographical order.
This commit is contained in:
Maxim Cournoyer 2022-08-20 19:48:39 -04:00
parent 97313b9b0c
commit 603a8e729e
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -8400,9 +8400,10 @@ library.")
"gdm-pass-gdk-pixbuf-loader-env.patch"))))
(build-system meson-build-system)
(arguments
`(#:glib-or-gtk? #t
(list
#:glib-or-gtk? #t
#:configure-flags
,#~(list
#~(list
"-Dplymouth=disabled"
"-Dsystemd-journal=false"
@ -8432,10 +8433,9 @@ library.")
;; XDG_DATA_DIRS so that it finds its schemas.
"--sbindir" (string-append #$output "/bin"))
#:phases
(modify-phases %standard-phases
(add-before
'configure 'pre-configure
(lambda* (#:key inputs outputs #:allow-other-keys)
#~(modify-phases %standard-phases
(add-before 'configure 'pre-configure
(lambda* (#:key inputs #:allow-other-keys)
;; We don't have <systemd/sd-daemon.h>.
(substitute* '("common/gdm-log.c"
"daemon/gdm-server.c"
@ -8499,27 +8499,23 @@ library.")
;; Use an absolute path for GNOME Session.
(substitute* "daemon/gdm-launch-environment.c"
(("\"gnome-session\"")
(string-append "\"" (assoc-ref inputs "gnome-session")
"/bin/gnome-session\"")))
(format #f "~s"
(search-input-file inputs "bin/gnome-session"))))
;; Do not automatically select the placeholder session.
(substitute* "daemon/gdm-session.c"
(("!g_str_has_suffix [(]base_name, \"\\.desktop\"[)]")
(string-append "!g_str_has_suffix (base_name, \".desktop\") || "
"(g_strcmp0(search_dirs[i], \""
(assoc-ref outputs "out") "/share/gdm/BuiltInSessions/"
#$output "/share/gdm/BuiltInSessions/"
"\") == 0 && "
"g_strcmp0(base_name, \"fail.desktop\") == 0)"))
(("g_error [(]\"GdmSession: no session desktop files installed, aborting\\.\\.\\.\"[)];")
"{ self->fallback_session_name = g_strdup(\"fail\"); goto out; }"))))
(add-before 'install 'install-logo
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(guix-icons (assoc-ref inputs "guix-icons"))
(icon
(string-append guix-icons "/share/icons/hicolor/\
(lambda* (#:key inputs #:allow-other-keys)
(let ((icon (search-input-file inputs "share/icons/hicolor/\
scalable/apps/guix-white-icon.svg"))
(schema
(string-append out "/share/glib-2.0/schemas/\
(schema (string-append #$output "/share/glib-2.0/schemas/\
org.gnome.login-screen.gschema.override")))
(mkdir-p (dirname schema))
(with-output-to-file schema
@ -8533,9 +8529,9 @@ logo='~a'~%" icon))))))
;; '~/.xsession' script with no other desktop entry files.
;; See <https://bugs.gnu.org/35068>.
(add-after 'install 'install-placeholder-desktop-entry
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(sessions (string-append out "/share/gdm/BuiltInSessions"))
(lambda _
(let* ((sessions (string-append #$output
"/share/gdm/BuiltInSessions"))
(fail (string-append sessions "/fail.desktop")))
(mkdir-p sessions)
(with-output-to-file fail
@ -8556,11 +8552,10 @@ logo='~a'~%" icon))))))
;; XXX: GNOME Shell should be linked here too, but currently
;; GNOME Shell depends on GDM.
(add-after 'install 'link-autostart-files
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(autostart (string-append out "/share/gdm/"
(lambda* (#:key inputs #:allow-other-keys)
(let ((autostart (string-append #$output "/share/gdm/"
"greeter/autostart"))
(settings (assoc-ref inputs "gnome-settings-daemon")))
(settings #$(this-package-input "gnome-settings-daemon")))
(mkdir-p autostart)
(with-directory-excursion autostart
(for-each (lambda (desktop)
@ -8568,14 +8563,14 @@ logo='~a'~%" icon))))))
(find-files
(string-append settings "/etc/xdg"))))))))))
(native-inputs
`(("dconf" ,dconf)
("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
("gobject-introspection" ,gobject-introspection)
("guix-icons" ,guix-icons)
("intltool" ,intltool)
("itstool" ,itstool)
("pkg-config" ,pkg-config)
("xmllint" ,libxml2)))
(list `(,glib "bin") ;for glib-compile-schemas, etc.
dconf
gobject-introspection
guix-icons
intltool
itstool
libxml2
pkg-config))
(inputs
(list accountsservice
check ;for testing