mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: localed: Modernize.
* gnu/packages/freedesktop.scm (localed) [arguments]: Use gexps. [native-inputs, inputs]: Use modify-inputs and drop labels. Change-Id: I01f06685cd3b9d731dd36f27c32da8ecce0eb2c7
This commit is contained in:
parent
d262248c55
commit
383f7f5c89
1 changed files with 68 additions and 67 deletions
|
@ -1122,78 +1122,79 @@ This library provides just sd-bus (and the busctl utility).")
|
||||||
"idn"
|
"idn"
|
||||||
"nss-myhostname"
|
"nss-myhostname"
|
||||||
"nss-systemd")))
|
"nss-systemd")))
|
||||||
`(#:configure-flags ',(map (lambda (component)
|
(list
|
||||||
(string-append "-D" component "=false"))
|
#:configure-flags #~(list
|
||||||
(delete "localed" components))
|
#$@(map (lambda (component)
|
||||||
|
(string-append "-D" component "=false"))
|
||||||
|
(delete "localed" components)))
|
||||||
|
|
||||||
;; It doesn't make sense to test all of systemd.
|
;; It doesn't make sense to test all of systemd.
|
||||||
#:tests? #f
|
#:tests? #f
|
||||||
|
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'set-xkeyboard-config-file-name
|
(add-after 'unpack 'set-xkeyboard-config-file-name
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda _
|
||||||
;; Set the file name to xkeyboard-config and kbd.
|
;; Set the file name to xkeyboard-config and kbd.
|
||||||
;; This is used by 'localectl list-x11-keymap-layouts'
|
;; This is used by 'localectl list-x11-keymap-layouts'
|
||||||
;; and similar functions.
|
;; and similar functions.
|
||||||
(let ((xkb (assoc-ref inputs "xkeyboard-config"))
|
(let ((xkb #$(this-package-input "xkeyboard-config"))
|
||||||
(kbd (assoc-ref inputs "kbd")))
|
(kbd #$(this-package-input "kbd")))
|
||||||
(substitute* "src/locale/localectl.c"
|
(substitute* "src/locale/localectl.c"
|
||||||
(("/usr/share/X11/xkb/rules")
|
(("/usr/share/X11/xkb/rules")
|
||||||
(string-append xkb "/share/X11/xkb/rules")))
|
(string-append xkb "/share/X11/xkb/rules")))
|
||||||
(substitute* "src/basic/def.h"
|
(substitute* "src/basic/def.h"
|
||||||
(("/usr/share/keymaps")
|
(("/usr/share/keymaps")
|
||||||
(string-append kbd "/share/keymaps"))))))
|
(string-append kbd "/share/keymaps"))))))
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda _
|
||||||
;; Install 'localed', the D-Bus and polkit files, and
|
;; Install 'localed', the D-Bus and polkit files, and
|
||||||
;; 'localectl'.
|
;; 'localectl'.
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out #$output)
|
||||||
(libexec (string-append out "/libexec/localed"))
|
(libexec (string-append out "/libexec/localed"))
|
||||||
(bin (string-append out "/bin"))
|
(bin (string-append out "/bin"))
|
||||||
(lib (string-append out "/lib"))
|
(lib (string-append out "/lib"))
|
||||||
(dbus (string-append out
|
(dbus (string-append out
|
||||||
"/share/dbus-1/system-services"))
|
"/share/dbus-1/system-services"))
|
||||||
(conf (string-append out
|
(conf (string-append out
|
||||||
"/etc/dbus-1/system.d/"))
|
"/etc/dbus-1/system.d/"))
|
||||||
(polkit (string-append out
|
(polkit (string-append out
|
||||||
"/share/polkit-1/actions"))
|
"/share/polkit-1/actions"))
|
||||||
(data (string-append out "/share/systemd")))
|
(data (string-append out "/share/systemd")))
|
||||||
(define (source-file regexp)
|
(define (source-file regexp)
|
||||||
(car (find-files ".." regexp)))
|
(car (find-files ".." regexp)))
|
||||||
|
|
||||||
(mkdir-p libexec)
|
(mkdir-p libexec)
|
||||||
(copy-file "systemd-localed"
|
(copy-file "systemd-localed"
|
||||||
(string-append libexec "/localed"))
|
(string-append libexec "/localed"))
|
||||||
(install-file "localectl" bin)
|
(install-file "localectl" bin)
|
||||||
|
|
||||||
(let ((service-file (source-file
|
(let ((service-file (source-file "\\.locale1\\.service$")))
|
||||||
"\\.locale1\\.service$")))
|
(substitute* service-file
|
||||||
(substitute* service-file
|
(("^Exec=.*$")
|
||||||
(("^Exec=.*$")
|
(string-append "Exec=" libexec "/localed\n")))
|
||||||
(string-append "Exec=" libexec "/localed\n")))
|
(install-file service-file dbus))
|
||||||
(install-file service-file dbus))
|
(install-file (source-file "\\.locale1\\.policy$") polkit)
|
||||||
(install-file (source-file "\\.locale1\\.policy$")
|
(install-file (source-file "\\.locale1\\.conf$") conf)
|
||||||
polkit)
|
(for-each (lambda (file)
|
||||||
(install-file (source-file "\\.locale1\\.conf$")
|
(install-file file lib))
|
||||||
conf)
|
(find-files "src/shared"
|
||||||
(for-each (lambda (file)
|
"libsystemd-shared.*\\.so"))
|
||||||
(install-file file lib))
|
|
||||||
(find-files "src/shared"
|
|
||||||
"libsystemd-shared.*\\.so"))
|
|
||||||
|
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (map)
|
(lambda (map)
|
||||||
(install-file map data))
|
(install-file map data))
|
||||||
(find-files
|
(find-files
|
||||||
".."
|
".."
|
||||||
"^(kbd-model-map|language-fallback-map)$")))))))))
|
"^(kbd-model-map|language-fallback-map)$")))))))))
|
||||||
(native-inputs `(,@(package-native-inputs elogind)
|
(native-inputs
|
||||||
("rsync" ,rsync)))
|
(modify-inputs (package-native-inputs elogind)
|
||||||
(inputs `(("libmount" ,util-linux "lib")
|
(append rsync)))
|
||||||
("xkeyboard-config" ,xkeyboard-config)
|
(inputs
|
||||||
("kbd" ,kbd)
|
(modify-inputs (package-inputs elogind)
|
||||||
,@(package-inputs elogind)))
|
(prepend `(,util-linux "lib")
|
||||||
|
kbd
|
||||||
|
xkeyboard-config)))
|
||||||
(home-page "https://www.freedesktop.org/wiki/Software/systemd/localed/")
|
(home-page "https://www.freedesktop.org/wiki/Software/systemd/localed/")
|
||||||
(synopsis "Control the system locale and keyboard layout")
|
(synopsis "Control the system locale and keyboard layout")
|
||||||
(description
|
(description
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue