projects/guix·blob javascript-team · refs

854 lines · 35.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Joshua Grant <[email protected]>
3;;; Copyright © 2014, 2018, 2022 Ludovic Courtès <[email protected]>
4;;; Copyright © 2014 Andreas Enge <[email protected]>
5;;; Copyright © 2017 Ricardo Wurmus <[email protected]>
6;;; Copyright © 2017 Sou Bunnbu <[email protected]>
7;;; Copyright © 2017 Marius Bakke <[email protected]>
8;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <[email protected]>
9;;; Copyright © 2020 L p R n d n <[email protected]>
10;;; Copyright © 2020, 2024 Fredrik Salomonsson <[email protected]>
11;;; Copyright © 2020 Vincent Legoll <[email protected]>
12;;; Copyright © 2021 Zheng Junjie <[email protected]>
13;;; Copyright © 2021-2023 Efraim Flashner <[email protected]>
14;;; Copyright © 2021 Petr Hodina <[email protected]>
15;;; Copyright © 2022-2023, 2026 Maxim Cournoyer <[email protected]>
16;;; Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
17;;; Copyright © 2026 Anderson Torres <[email protected]>
18;;;
19;;; This file is part of GNU Guix.
20;;;
21;;; GNU Guix is free software; you can redistribute it and/or modify it
22;;; under the terms of the GNU General Public License as published by
23;;; the Free Software Foundation; either version 3 of the License, or (at
24;;; your option) any later version.
25;;;
26;;; GNU Guix is distributed in the hope that it will be useful, but
27;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29;;; GNU General Public License for more details.
30;;;
31;;; You should have received a copy of the GNU General Public License
32;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34(define-module (gnu packages display-managers)
35 #:use-module (guix deprecation)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system copy)
42 #:use-module (guix build-system go)
43 #:use-module (guix build-system qt)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system glib-or-gtk)
46 #:use-module (guix build-system trivial)
47 #:use-module (guix packages)
48 #:use-module (guix utils)
49 #:use-module (guix gexp)
50 #:use-module (gnu packages)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages admin)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages crypto)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages freedesktop)
58 #:use-module (gnu packages gl)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages gnupg)
62 #:use-module (gnu packages golang-xyz)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages guile)
65 #:use-module (gnu packages image)
66 #:use-module (gnu packages kde-frameworks)
67 #:use-module (gnu packages linux)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages qt)
71 #:use-module (gnu packages xdisorg)
72 #:use-module (gnu packages xfce)
73 #:use-module (gnu packages xorg)
74 #:export (customize-lightdm-tiny-greeter))
75
76(define-public emptty
77 (package
78 (name "emptty")
79 (version "0.16.1")
80 (source
81 (origin
82 (method git-fetch)
83 (uri (git-reference
84 (url "https://github.com/tvrzna/emptty")
85 (commit (string-append "v" version))))
86 (file-name (git-file-name name version))
87 (sha256
88 (base32 "0rvqvgkjjxbcskczfmjlmlyn9y3xcrz4g0sg5v76hbqx7ilwc18k"))))
89 (build-system go-build-system)
90 (arguments
91 (list
92 #:install-source? #f
93 #:import-path "github.com/tvrzna/emptty"
94 #:phases
95 #~(modify-phases %standard-phases
96 (add-after 'unpack 'patch-paths
97 (lambda* (#:key inputs import-path #:allow-other-keys)
98 (with-directory-excursion (string-append "src/" import-path)
99 (substitute* "src/session_xorg.go"
100 (("/usr/bin/mcookie")
101 (search-input-file inputs "bin/mcookie"))
102 (("/usr/bin/xauth")
103 (search-input-file inputs "bin/xauth"))
104 (("/usr/bin/Xorg")
105 (search-input-file inputs "bin/Xorg")))))))))
106 (native-inputs
107 (list go-github-com-msteinert-pam-v2))
108 (inputs
109 (list libx11
110 linux-pam
111 util-linux
112 xauth
113 xorg-server))
114 (home-page "https://github.com/tvrzna/emptty")
115 (synopsis "@acronym{CLI, command line interface} display manager")
116 (description
117 "This package provides @code{emptty}, a dead simple @acronym{CLI, command
118line interface} Display Manager on the TTY.")
119 (license license:expat)))
120
121(define-public sddm
122 (package
123 (name "sddm")
124 (version "0.21.0")
125 (source (origin
126 (method git-fetch)
127 (uri (git-reference
128 (url "https://github.com/sddm/sddm")
129 (commit (string-append "v" version))))
130 (file-name (git-file-name name version))
131 (sha256
132 (base32
133 "0mxrh0z9x4r4bli25g746n66adwnf3r42lzq0yssc50v9y7fc1a1"))))
134 (build-system qt-build-system)
135 (native-inputs
136 (list extra-cmake-modules pkg-config qttools))
137 (inputs
138 (list elogind
139 glib
140 libxcb
141 libxkbcommon
142 linux-pam
143 qtdeclarative
144 qtsvg
145 shadow
146 wayland
147 qtwayland
148 qtbase
149 xsetroot))
150 (arguments
151 (let* ((qtbase (this-package-input "qtbase"))
152 (qt6? (string= "6" (version-major (package-version qtbase)))))
153 (list
154 #:qtbase qtbase
155 #:configure-flags
156 #~(list
157 #$@(if qt6?
158 #~("-DBUILD_WITH_QT6=ON")
159 #~())
160 "-DENABLE_WAYLAND=ON"
161 "-DENABLE_PAM=ON"
162 ;; PAM is configured by pam service.
163 "-DINSTALL_PAM_CONFIGURATION=OFF"
164 ;; Both flags are required for elogind support.
165 "-DNO_SYSTEMD=ON"
166 "-DUSE_ELOGIND=ON"
167 "-DCONFIG_FILE=/etc/sddm.conf"
168 ;; Set path to /etc/login.defs.
169 ;; An alternative would be to use -DUID_MIN and -DUID_MAX.
170 (string-append "-DLOGIN_DEFS_PATH="
171 #$(this-package-input "shadow")
172 "/etc/login.defs")
173 (string-append
174 "-DCMAKE_CXX_FLAGS=-I"
175 #$(this-package-input "qtdeclarative") "/include/qt" #$(if qt6? "6" "5"))
176 (string-append "-DQT_IMPORTS_DIR="
177 #$output "/lib/qt" #$(if qt6? "6" "5") "/qml")
178 (string-append "-DCMAKE_INSTALL_SYSCONFDIR="
179 #$output "/etc"))
180 #:phases
181 #~(modify-phases %standard-phases
182 (add-after 'unpack 'embed-loginctl-reference
183 (lambda _
184 (substitute* "CMakeLists.txt"
185 (("/usr/bin/loginctl")
186 (which "loginctl")))))
187 (add-after 'unpack 'embed-xsetroot-reference
188 (lambda* (#:key inputs #:allow-other-keys)
189 (substitute* '("src/daemon/XorgDisplayServer.cpp"
190 "src/helper/xorguserhelper.cpp")
191 (("xsetroot")
192 (search-input-file inputs "/bin/xsetroot")))))
193 #$@(if qt6?
194 #~((add-after 'unpack 'fix-QML_IMPORT_PATH
195 (lambda _
196 (substitute* "src/daemon/Greeter.cpp"
197 (("QML2_IMPORT_PATH")
198 "QML_IMPORT_PATH")))))
199 #~())))))
200 (synopsis "QML based X11 and Wayland display manager")
201 (description "SDDM is a display manager for X11 and Wayland aiming to be
202fast, simple and beautiful. SDDM is themeable and puts no restrictions on the
203user interface design. It uses QtQuick which gives the designer the ability
204to create smooth, animated user interfaces.")
205 (home-page "https://github.com/sddm/sddm")
206 ;; QML files are MIT licensed and images are CC BY 3.0.
207 (license (list license:gpl2+ license:expat license:cc-by3.0))))
208
209(define-public sddm-qt5
210 (package
211 (inherit sddm)
212 (name "sddm-qt5")
213 (native-inputs (modify-inputs native-inputs
214 (replace "qttools" qttools-5)))
215 (inputs (modify-inputs inputs
216 (replace "qtbase" qtbase-5)
217 (replace "qtsvg" qtsvg-5)
218 (replace "qtdeclarative" qtdeclarative-5)
219 (replace "qtwayland" qtwayland-5)
220 (append qtgraphicaleffects qtquickcontrols-5 qtquickcontrols2-5)))))
221
222(define-public abstractdark-sddm-theme-qt5
223 (let ((commit "e817d4b27981080cd3b398fe928619ffa16c52e7")
224 (revision "0"))
225 (package
226 (name "abstractdark-sddm-theme-qt5")
227 (version (git-version "0.0.0" revision commit))
228 (source (origin
229 (method git-fetch)
230 (uri (git-reference
231 (url "https://github.com/3ximus/abstractdark-sddm-theme")
232 (commit commit)))
233 (file-name (git-file-name name version))
234 (sha256
235 (base32
236 "1si141hnp4lr43q36mbl3anlx0a81r8nqlahz3n3l7zmrxb56s2y"))))
237 (build-system copy-build-system)
238 (arguments
239 `(#:install-plan '(("." "/share/sddm/themes/abstractdark"))))
240 (home-page "https://github.com/3ximus/abstractdark-sddm-theme")
241 (synopsis "Abstract Dark theme for SDDM")
242 (description
243 "This package provides a minimalistic dark theme for SDDM, black
244background with abstract shapes. Inspired by solarized-sddm-theme.")
245 (license license:gpl3+))))
246
247;; TODO: Remove after 2027-01.
248(define-deprecated-package abstractdark-sddm-theme abstractdark-sddm-theme-qt5)
249
250(define-public dexy-color-sddm-theme-qt5
251 ;; No upstream releases or tags
252 (let ((commit "4785d3b80d725cf55cecd7b27181f77151c4e3e2")
253 (revision "0"))
254 (package
255 (name "dexy-color-sddm-theme-qt5")
256 (version (git-version "0.0.0" revision commit))
257 (source (origin
258 (method git-fetch)
259 (uri (git-reference
260 (url "https://github.com/L4ki/Dexy-Plasma-Themes")
261 (commit commit)))
262 (file-name (git-file-name name version))
263 (sha256
264 (base32
265 "14fzc4kq50ii1qmmvnp9gxig504zfx1rsfsp0wq9bay7d72j282c"))))
266 (build-system copy-build-system)
267 (arguments
268 `(#:install-plan '(("Dexy-Color-SDDM"
269 "/share/sddm/themes/dexy-color-sddm"))))
270 (home-page "https://github.com/L4ki/Dexy-Plasma-Themes")
271 (synopsis "Dexy Color theme for SDDM")
272 (description
273 "This package provides a minimalistic and modern SDDM theme with a
274blurred background.")
275 (license license:gpl3+))))
276
277;; TODO: Remove after 2027-01.
278(define-deprecated-package dexy-color-sddm-theme dexy-color-sddm-theme-qt5)
279
280(define-public guix-simplyblack-sddm-theme
281 (package
282 (name "guix-simplyblack-sddm-theme")
283 (version "0.2")
284 (source
285 (origin
286 (method git-fetch)
287 (uri (git-reference
288 (url "https://github.com/plattfot/guix-simplyblack-sddm")
289 (commit version)))
290 (file-name (git-file-name name version))
291 (sha256
292 (base32 "09vb9b0pmyhj6fh0b6by59bykszbkdayhz678pnb4pyrdmlvv1am"))))
293 (build-system trivial-build-system)
294 (arguments
295 `(#:modules ((guix build utils))
296 #:builder (begin
297 (use-modules (guix build utils)
298 (srfi srfi-26))
299 (let* ((out (assoc-ref %outputs "out"))
300 (themes-dir (string-append out
301 "/share/sddm/themes/guix-simplyblack-sddm/")))
302 (mkdir-p themes-dir)
303 (copy-recursively (assoc-ref %build-inputs "source")
304 themes-dir)
305 (substitute* (map (cut string-append themes-dir <>)
306 '("Main.qml" "theme.conf"))
307 (("file:")
308 themes-dir))))))
309 (home-page "https://github.com/plattfot/guix-simplyblack-sddm")
310 (synopsis "Guix based theme for SDDM")
311 (description
312 "This package provides a simple theme for SDDM, black background with
313Guix's logo. Based on Arch linux's archlinux-simplyblack theme.")
314 ;; Theme under cc-by-sa3.0, guix logo under license:cc-by-sa4.0
315 (license (list license:cc-by-sa3.0 license:cc-by-sa4.0))))
316
317(define-public guix-simplyblack-sddm-theme-qt5
318 (package
319 (inherit guix-simplyblack-sddm-theme)
320 (name "guix-simplyblack-sddm-theme-qt5")
321 (source
322 (origin
323 (inherit (package-source guix-simplyblack-sddm-theme))
324 (modules '((guix build utils)))
325 (snippet '(begin
326 (substitute* "metadata.desktop"
327 (("QtVersion=6")
328 "QtVersion=5"))))))))
329
330(define-public chili-sddm-theme-qt5
331 (package
332 (name "chili-sddm-theme-qt5")
333 (version "0.1.5")
334 (source (origin
335 (method git-fetch)
336 (uri (git-reference
337 (url "https://github.com/MarianArlt/sddm-chili")
338 (commit version)))
339 (file-name (git-file-name name version))
340 (sha256
341 (base32
342 "036fxsa7m8ymmp3p40z671z163y6fcsa9a641lrxdrw225ssq5f3"))))
343 (build-system trivial-build-system)
344 (arguments
345 `(#:modules ((guix build utils))
346 #:builder
347 (begin
348 (use-modules (guix build utils))
349 (let* ((out (assoc-ref %outputs "out"))
350 (sddm-themes (string-append out "/share/sddm/themes")))
351 (mkdir-p sddm-themes)
352 (copy-recursively (assoc-ref %build-inputs "source")
353 (string-append sddm-themes "/chili"))))))
354 (home-page "https://github.com/MarianArlt/sddm-chili")
355 (synopsis "Chili theme for SDDM")
356 (description "Chili reduces all the clutter and leaves you with a clean,
357easy to use, login interface with a modern yet classy touch.")
358 (license license:gpl3+)))
359
360;; TODO: Remove after 2027-01.
361(define-deprecated-package chili-sddm-theme chili-sddm-theme-qt5)
362
363(define-public sugar-dark-sddm-theme-qt5
364 (package
365 (name "sugar-dark-sddm-theme-qt5")
366 (version "1.2")
367 (source (origin
368 (method git-fetch)
369 (uri (git-reference
370 (url "https://github.com/MarianArlt/sddm-sugar-dark")
371 (commit (string-append "v" version))))
372 (file-name (git-file-name name version))
373 (sha256
374 (base32
375 "0gx0am7vq1ywaw2rm1p015x90b75ccqxnb1sz3wy8yjl27v82yhb"))))
376 (build-system trivial-build-system)
377 (arguments
378 `(#:modules ((guix build utils))
379 #:builder
380 (begin
381 (use-modules (guix build utils))
382 (let* ((out (assoc-ref %outputs "out"))
383 (sddm-themes (string-append out "/share/sddm/themes")))
384 (mkdir-p sddm-themes)
385 (copy-recursively (assoc-ref %build-inputs "source")
386 (string-append sddm-themes "/sugar-dark"))))))
387 (home-page "https://github.com/MarianArlt/sddm-sugar-dark")
388 (synopsis "Sugar dark theme for SDDM")
389 (description "Sugar is extremely customizable and so sweet it will
390probably cause you diabetes just from looking at it. Sweeten the login
391experience for your users, your family and yourself")
392 (license license:gpl3+)))
393
394;; TODO: Remove after 2027-01.
395(define-deprecated-package sugar-dark-sddm-theme sugar-dark-sddm-theme-qt5)
396
397(define-public sugar-light-sddm-theme-qt5
398 (package
399 (name "sugar-light-sddm-theme-qt5")
400 (version "1.0")
401 (source (origin
402 (method git-fetch)
403 (uri (git-reference
404 (url "https://github.com/MarianArlt/sddm-sugar-light")
405 (commit (string-append "v" version))))
406 (file-name (git-file-name name version))
407 (sha256
408 (base32
409 "1sfd5bi5jcfz3hmvvr3smalywixa70g5j96qgx1220mp6rqf886k"))))
410 (build-system trivial-build-system)
411 (arguments
412 `(#:modules ((guix build utils))
413 #:builder
414 (begin
415 (use-modules (guix build utils))
416 (let* ((out (assoc-ref %outputs "out"))
417 (sddm-themes (string-append out "/share/sddm/themes")))
418 (mkdir-p sddm-themes)
419 (copy-recursively (assoc-ref %build-inputs "source")
420 (string-append sddm-themes "/sugar-light"))))))
421 (home-page "https://github.com/MarianArlt/sddm-sugar-light")
422 (synopsis "Sugar light theme for SDDM")
423 (description "Sugar is extremely customizable and so sweet it will
424probably cause you diabetes just from looking at it. Sweeten the login
425experience for your users, your family and yourself")
426 (license license:gpl3+)))
427
428;; TODO: Remove after 2027-01.
429(define-deprecated-package sugar-light-sddm-theme sugar-light-sddm-theme-qt5)
430
431(define-public where-is-my-sddm-theme
432 (package
433 (name "where-is-my-sddm-theme")
434 (version "1.12.0")
435 (source (origin
436 (method git-fetch)
437 (uri (git-reference
438 (url "https://github.com/stepanzubkov/where-is-my-sddm-theme")
439 (commit (string-append "v" version))))
440 (file-name (git-file-name name version))
441 (sha256
442 (base32
443 "0a30rlknxz855qsrc3ksyic4cj5axm6pwk5nya3nlbqjrrghy7gr"))))
444 (build-system copy-build-system)
445 (arguments
446 `(#:install-plan '(("where_is_my_sddm_theme" "/share/sddm/themes/")
447 ("where_is_my_sddm_theme_qt5" "/share/sddm/themes/"))))
448 (home-page "https://github.com/stepanzubkov/where-is-my-sddm-theme")
449 (synopsis "Minimal SDDM theme, simply a black screen and a password")
450 (description
451 "This package is a @emph{minimalist and highly customizable} SDDM theme.
452It's only a black screen and a password input field. Nothing extra, right?
453Even when you enter the wrong password it will only show a red border around
454the screen.")
455 (license license:gpl3+)))
456
457(define-public lightdm
458 (package
459 (name "lightdm")
460 (version "1.33.1")
461 (source (origin
462 (method git-fetch)
463 (uri (git-reference
464 (url "https://github.com/ubuntu/lightdm")
465 (commit version)))
466 (file-name (git-file-name name version))
467 (sha256
468 (base32
469 "1gayj1gasxfrr22njwyqs40k3w5dvkfjszzzf2sljildc9bpz7py"))))
470 (build-system gnu-build-system)
471 (arguments
472 (list
473 #:parallel-tests? #f ; fails when run in parallel
474 #:configure-flags
475 #~(list "--localstatedir=/var"
476 "--sysconfdir=/etc"
477 "--enable-gtk-doc")
478 #:phases
479 #~(modify-phases %standard-phases
480 (add-after 'unpack 'fix-paths
481 (lambda* (#:key inputs #:allow-other-keys)
482 (substitute* "src/shared-data-manager.c"
483 (("/bin/rm")
484 (search-input-file inputs "bin/rm")))
485 (substitute* '("data/users.conf"
486 "common/user-list.c")
487 (("/bin/false")
488 (search-input-file inputs "bin/false"))
489 (("/usr/sbin/nologin")
490 (search-input-file inputs "sbin/nologin")))
491 (substitute* "src/seat.c"
492 (("/bin/sh")
493 (search-input-file inputs "bin/sh")))))
494 ;; The check phase is re-ordered after the install phase, so the
495 ;; shared libraries referenced absolutely in the typelibs (that's
496 ;; thanks to 'gobject-introspection-absolute-shlib-path.patch') are
497 ;; found (recent pygobject raises an error otherwise).
498 (delete 'check) ;moved after install phase
499 (add-after 'install 'check
500 (assoc-ref %standard-phases 'check))
501 (add-before 'check 'pre-check
502 (lambda _
503 (wrap-program "tests/src/test-python-greeter"
504 #:sh (which "bash")
505 `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))
506 `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH"))))
507 ;; Avoid printing locale warnings, which trip up the text
508 ;; matching tests.
509 (unsetenv "LC_ALL")))
510 (replace 'install
511 (lambda* (#:key make-flags #:allow-other-keys #:rest args)
512 ;; Override the sysconfdir flag only for the installation phase,
513 ;; as it attempts to write the sample config files to /etc and
514 ;; fail otherwise.
515 (define make-flags*
516 (append make-flags (list (string-append "sysconfdir="
517 #$output "/etc"))))
518 (apply (assoc-ref %standard-phases 'install)
519 (append args (list #:make-flags make-flags*))))))))
520 (inputs
521 (list audit
522 bash-minimal ;for cross-compilation
523 coreutils-minimal ;ditto
524 linux-pam
525 shadow ;for sbin/nologin
526 libgcrypt
527 libxcb
528 libxdmcp))
529 (native-inputs
530 (list accountsservice
531 autoconf
532 automake
533 gobject-introspection
534 gtk-doc/stable
535 pkg-config
536 itstool
537 intltool
538 libtool
539 vala ;for Vala bindings
540 dbus
541 python-wrapper
542 python-pygobject ;<https://github.com/ubuntu/lightdm/issues/471>
543 which
544 yelp-tools))
545 ;; Required by liblightdm-gobject-1.pc.
546 (propagated-inputs
547 (list glib libx11 libxklavier))
548 (home-page "https://github.com/ubuntu/lightdm")
549 (synopsis "Lightweight display manager")
550 (description "The Light Display Manager (LightDM) is a cross-desktop
551display manager which supports different greeters.")
552 (license license:gpl3+)))
553
554(define-public lightdm-gtk-greeter
555 (package
556 (name "lightdm-gtk-greeter")
557 (version "2.0.9")
558 (source (origin
559 (method url-fetch)
560 (uri (string-append
561 "https://github.com/xubuntu/lightdm-gtk-greeter"
562 "/releases/download/lightdm-gtk-greeter-" version "/"
563 "lightdm-gtk-greeter-" version ".tar.gz"))
564 (sha256
565 (base32
566 "0pb43w4g342jjrigrz780y8vfxr27kidyj0bml6rsgwsmacg3zf8"))))
567 (build-system glib-or-gtk-build-system)
568 (arguments
569 (list
570 #:configure-flags
571 #~(list "--disable-indicator-services-command" ;requires upstart
572 ;; Put the binary under /bin rather than /sbin, so that it gets
573 ;; wrapped by the glib-or-gtk-wrap phase.
574 (string-append "--sbindir=" #$output "/bin")
575 (string-append "--with-libxklavier")
576 (string-append "--enable-at-spi-command="
577 (search-input-file
578 %build-inputs "libexec/at-spi-bus-launcher")
579 " --launch-immediately"))
580 #:phases
581 #~(modify-phases %standard-phases
582 (add-after 'unpack 'customize-default-config-path
583 (lambda _
584 (substitute* "src/Makefile.in"
585 ;; Have the default config directory sourced from
586 ;; /etc/lightdm/lightdm-gtk-greeter.conf, which is where the
587 ;; lightdm service writes it.
588 (("\\$\\(sysconfdir)/lightdm/lightdm-gtk-greeter.conf")
589 "/etc/lightdm/lightdm-gtk-greeter.conf"))))
590 (add-after 'install 'fix-.desktop-file
591 (lambda* (#:key outputs #:allow-other-keys)
592 (substitute* (search-input-file
593 outputs
594 "share/xgreeters/lightdm-gtk-greeter.desktop")
595 (("Exec=lightdm-gtk-greeter")
596 (string-append "Exec="
597 (search-input-file
598 outputs "bin/lightdm-gtk-greeter"))))))
599 (add-after 'glib-or-gtk-wrap 'custom-wrap
600 (lambda* (#:key outputs #:allow-other-keys)
601 (wrap-script (search-input-file
602 outputs "bin/lightdm-gtk-greeter")
603 ;; Wrap GDK_PIXBUF_MODULE_FILE, so that the SVG loader is
604 ;; available at all times even outside of profiles, such as
605 ;; when used in the lightdm-service-type. Otherwise, it
606 ;; wouldn't be able to display its own icons.
607 `("GDK_PIXBUF_MODULE_FILE" =
608 (,(search-input-file
609 outputs
610 "lib/gdk-pixbuf-2.0/2.10.0/loaders.cache")))
611 `("XDG_DATA_DIRS" ":" prefix
612 (,(string-append "/run/current-system/profile/share:"
613 (getenv "XDG_DATA_DIRS"))))
614 '("XCURSOR_PATH" ":" prefix
615 ("/run/current-system/profile/share/icons"))))))))
616 (native-inputs
617 (list exo
618 intltool
619 pkg-config
620 xfce4-dev-tools))
621 (inputs
622 (list at-spi2-core
623 bash-minimal ;for wrap-program
624 gtk+
625 guile-3.0
626 (librsvg-for-system)
627 libxklavier
628 lightdm
629 shared-mime-info))
630 (synopsis "GTK+ greeter for LightDM")
631 (home-page "https://github.com/xubuntu/lightdm-gtk-greeter")
632 (description "This package provides a LightDM greeter implementation using
633GTK+, lets you select a desktop session and log in to it.")
634 (license license:gpl3+)))
635
636(define-public lightdm-mini-greeter
637 (let ((commit "ead7936993b4e9e067d73fa49dec7edfb46c73a8")
638 (revision "0"))
639 (package
640 (name "lightdm-mini-greeter")
641 ;; Version 0.5.1 release in 2021, so we use a recent commit.
642 (version (git-version "0.5.1" revision commit))
643 (source (origin
644 (method git-fetch)
645 (uri (git-reference
646 (url "https://github.com/prikhi/lightdm-mini-greeter")
647 (commit commit)))
648 (file-name (git-file-name name version))
649 (sha256
650 (base32
651 "17iy1jkllmi2xc95csb18wcfvbk44gyva2in2k5f29fy362ppz25"))))
652 (build-system glib-or-gtk-build-system)
653 (arguments
654 (list
655 #:phases
656 #~(modify-phases %standard-phases
657 (add-after 'unpack 'customize-default-config-path
658 (lambda _
659 (substitute* "Makefile.am"
660 ;; Have the default config directory sourced from
661 ;; /etc/lightdm/lightdm-mini-greeter.conf, which is where the
662 ;; lightdm service writes it.
663 (("\\$\\(sysconfdir)/lightdm/lightdm-mini-greeter.conf")
664 "/etc/lightdm/lightdm-mini-greeter.conf"))))
665 (add-after 'install 'fix-.desktop-file
666 (lambda* (#:key outputs #:allow-other-keys)
667 (substitute* (search-input-file
668 outputs
669 "share/xgreeters/lightdm-mini-greeter.desktop")
670 (("Exec=lightdm-mini-greeter")
671 (string-append "Exec="
672 (search-input-file
673 outputs "bin/lightdm-mini-greeter")))))))))
674 (native-inputs
675 (list autoconf automake pkg-config))
676 (inputs
677 (list gtk+ lightdm))
678 (synopsis "Mini Greeter for LightDM")
679 (home-page "https://github.com/prikhi/lightdm-mini-greeter")
680 (description "This package provide a minimal but highly configurable
681single-user GTK3 greeter for LightDM, this greeter is inspired by the SLiM
682Display Manager and LightDM GTK3 Greeter.")
683 (license license:gpl3))))
684
685(define-public lightdm-tiny-greeter
686 (let ((commit "6717c5853315ebd8164b1ddf85b9483f92cbcae8")
687 (revision "0"))
688 (package
689 (name "lightdm-tiny-greeter")
690 ;; Version 1.2 release in 2021, so we use a recent commit.
691 (version (git-version "1.2" revision commit))
692 (source (origin
693 (method git-fetch)
694 (uri (git-reference
695 (url "https://github.com/tobiohlala/lightdm-tiny-greeter")
696 (commit commit)))
697 (file-name (git-file-name name version))
698 (sha256
699 (base32
700 "1n970d6525fd918i1j09akxiacqbpxni8apkfi542bq5zg5crjbs"))))
701 (build-system glib-or-gtk-build-system)
702 (arguments
703 (list
704 #:tests? #f ; No test target.
705 #:phases
706 #~(modify-phases %standard-phases
707 (delete 'configure)
708 (add-after 'unpack 'patch-hardcoded-paths
709 (lambda _
710 (substitute* "Makefile"
711 (("PREFIX = /usr")
712 (string-append "PREFIX = " #$output))
713 (("/usr/share/xgreeters")
714 (string-append #$output "/share/xgreeters"))
715 (("cp lightdm-tiny-greeter")
716 "mkdir -p $(PREFIX)/bin; cp lightdm-tiny-greeter"))))
717 (add-after 'glib-or-gtk-wrap 'custom-wrap
718 (lambda _
719 (wrap-script (string-append #$output "/bin/lightdm-tiny-greeter")
720 ;; Wrap GDK_PIXBUF_MODULE_FILE, so that the SVG loader is
721 ;; available at all times even outside of profiles, such as
722 ;; when used in the lightdm-service-type. Otherwise, it
723 ;; wouldn't be able to display its own icons.
724 `("GDK_PIXBUF_MODULE_FILE" =
725 (,(string-append
726 #$output
727 "/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache")))
728 `("XDG_DATA_DIRS" ":" prefix
729 (,(string-append "/run/current-system/profile/share:"
730 (getenv "XDG_DATA_DIRS"))))
731 '("XCURSOR_PATH" ":" prefix
732 ("/run/current-system/profile/share/icons")))))
733 (add-after 'install 'fix-.desktop-file
734 (lambda _
735 (substitute* (string-append
736 #$output "/share/xgreeters/lightdm-tiny-greeter.desktop")
737 (("Exec=lightdm-tiny-greeter")
738 (string-append "Exec="
739 (string-append
740 #$output "/bin/lightdm-tiny-greeter")))))))))
741 (native-inputs
742 (list pkg-config))
743 (inputs
744 (list gtk+ lightdm))
745 (synopsis "Tiny Greeter for LightDM")
746 (home-page "https://github.com/tobiohlala/lightdm-tiny-greeter")
747 (description "This package provides a tiny yet customizable GTK3 LightDM
748Greeter with focus on code and minimalism.")
749 (license license:bsd-3))))
750
751(define* (customize-lightdm-tiny-greeter #:key name session
752 user_text pass_text
753 fontname fontsize)
754 "Make a customized lightdm-tiny-greeter package which name is NAME.
755
756This function will change SESSION, USER_TEXT, PASS_TEXT, FONTNAME and FONTSIZE
757in config.h of lightdm-tiny-greeter."
758 (package
759 (inherit lightdm-tiny-greeter)
760 (name (or name (string-append
761 (package-name lightdm-tiny-greeter)
762 "-" (or session "default"))))
763 (arguments
764 (substitute-keyword-arguments
765 (package-arguments lightdm-tiny-greeter)
766 ((#:phases phases)
767 #~(modify-phases #$phases
768 (add-after 'unpack 'patch-config-h
769 (lambda _
770 (when #$user_text
771 (substitute* "config.h"
772 (("\\*user_text = .*;")
773 (string-append "*user_text = \"" #$user_text "\";"))))
774 (when #$pass_text
775 (substitute* "config.h"
776 (("\\*pass_text = .*;")
777 (string-append "*pass_text = \"" #$pass_text "\";"))))
778 (when #$session
779 (substitute* "config.h"
780 (("\\*session = .*;")
781 (string-append "*session = \"" #$session "\";"))))
782 (when #$fontname
783 (substitute* "config.h"
784 (("font: .*px .*;")
785 (string-append "font: 16px \\\"" #$fontname "\\\";"))))
786 (when #$fontsize
787 (substitute* "config.h"
788 (("font: .*px")
789 (string-append "font: " #$fontsize "px"))))))))))))
790
791(define-public slim
792 (package
793 (name "slim")
794 (version "1.4.1")
795 (source
796 (origin
797 (method url-fetch)
798 (uri (string-append "mirror://sourceforge/slim-fork/slim-" version
799 ".tar.gz"))
800 (sha256
801 (base32 "06r47ypf9lsy76jikrvihw8ka9j2wbrnn8g3sbxp819hcbqxg22z"))
802 (patches (search-patches "slim-config.patch"
803 "slim-login.patch"
804 "slim-display.patch"
805 "slim-gcc-14.patch"))))
806 (build-system cmake-build-system)
807 (inputs (list fontconfig
808 freeglut
809 freetype
810 libjpeg-turbo
811 libpng
812 libx11
813 libxcrypt
814 libxft
815 libxmu
816 libxrandr
817 libxrender
818 linux-pam
819 xauth))
820 (native-inputs (list pkg-config))
821 (arguments
822 (list
823 #:phases
824 #~(modify-phases %standard-phases
825 (add-before 'configure 'set-new-etc-location
826 (lambda _
827 (substitute* "CMakeLists.txt"
828 (("/etc")
829 (string-append #$output "/etc"))
830 (("install.*SYSTEMDDIR.*")
831 ;; The build system's logic here is: if "Linux", then
832 ;; "systemd". Strip that.
833 "")))))
834 #:configure-flags
835 #~(list "-DUSE_PAM=yes" "-DUSE_CONSOLEKIT=no")
836 #:tests? #f))
837 ;; The original project (https://github.com/iwamatsu/slim) has not been
838 ;; maintained since 2013, so we use slim-fork instead.
839 (home-page "https://slim-fork.sourceforge.io/")
840 (synopsis "Desktop-independent graphical login manager for X11")
841 (description
842 "SLiM is a Desktop-independent graphical login manager for X11, derived
843from Login.app. It aims to be light and simple, although completely
844configurable through themes and an option file; is suitable for machines on
845which remote login functionalities are not needed.
846
847Features included: PNG and XFT support for alpha transparency and antialiased
848fonts, External themes support, Configurable runtime options: X server --
849login / shutdown / reboot commands, Single (GDM-like) or double (XDM-like)
850input control, Can load predefined user at startup, Configurable welcome /
851shutdown messages, Random theme selection.")
852 (license license:gpl2)))
853
854;;; display-managers.scm ends here