WIP: bees service
[jackhill/guix/guix.git] / gnu / packages / display-managers.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Joshua Grant <tadni@riseup.net>
3 ;;; Copyright © 2014, 2018 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017 Sou Bunnbu <iyzsong@gmail.com>
7 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
8 ;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2020 L p R n d n <guix@lprndn.info>
10 ;;; Copyright © 2020 Fredrik Salomonsson <plattfot@gmail.com>
11 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
12 ;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages display-managers)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system qt)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system trivial)
38 #:use-module (guix packages)
39 #:use-module (guix utils)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages admin)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages freedesktop)
44 #:use-module (gnu packages gl)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gnome)
47 #:use-module (gnu packages gnupg)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages image)
50 #:use-module (gnu packages kde-frameworks)
51 #:use-module (gnu packages linux)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages qt)
55 #:use-module (gnu packages xdisorg)
56 #:use-module (gnu packages xfce)
57 #:use-module (gnu packages xorg))
58
59 (define-public sddm
60 (package
61 (name "sddm")
62 (version "0.19.0")
63 (source (origin
64 (method url-fetch)
65 (uri (string-append
66 "https://github.com/sddm/sddm"
67 "/releases/download/v" version "/"
68 "sddm-" version ".tar.xz"))
69 (sha256
70 (base32
71 "0hcdysw8ibr66vk8i7v56l0v5ijvhlq67v4460mc2xf2910g2m72"))))
72 (build-system qt-build-system)
73 (native-inputs
74 `(("extra-cmake-modules" ,extra-cmake-modules)
75 ("pkg-config" ,pkg-config)
76 ("qttools" ,qttools)))
77 (inputs
78 `(("elogind" ,elogind)
79 ("glib" ,glib)
80 ("libxcb" ,libxcb)
81 ("libxkbcommon" ,libxkbcommon)
82 ("linux-pam" ,linux-pam)
83 ("qtbase" ,qtbase)
84 ("qtdeclarative" ,qtdeclarative)
85
86 ;; Some user-defined themes use QtQuick components internally. Adding
87 ;; QtQuick & co. here; they end up in QML2_IMPORT_PATH thanks to
88 ;; 'wrap-qt-program'.
89 ("qtgraphicaleffects" ,qtgraphicaleffects)
90 ("qtquickcontrols" ,qtquickcontrols)
91 ("qtquickcontrols2" ,qtquickcontrols2)
92 ("qtsvg" ,qtsvg)
93
94 ("shadow" ,shadow)
95 ("wayland" ,wayland)))
96 (arguments
97 `(#:configure-flags
98 (list
99 ;; This option currently does nothing, but will presumably be enabled
100 ;; if/when <https://github.com/sddm/sddm/pull/616> is merged.
101 "-DENABLE_WAYLAND=ON"
102 "-DENABLE_PAM=ON"
103 ;; Both flags are required for elogind support.
104 "-DNO_SYSTEMD=ON" "-DUSE_ELOGIND=ON"
105 "-DCONFIG_FILE=/etc/sddm.conf"
106 ;; Set path to /etc/login.defs.
107 ;; An alternative would be to use -DUID_MIN and -DUID_MAX.
108 (string-append "-DLOGIN_DEFS_PATH="
109 (assoc-ref %build-inputs "shadow")
110 "/etc/login.defs")
111 (string-append "-DQT_IMPORTS_DIR="
112 (assoc-ref %outputs "out") "/lib/qt5/qml")
113 (string-append "-DCMAKE_INSTALL_SYSCONFDIR="
114 (assoc-ref %outputs "out") "/etc"))
115 #:phases
116 (modify-phases %standard-phases
117 (add-after 'unpack 'embed-loginctl-reference
118 (lambda _
119 (substitute* "CMakeLists.txt"
120 (("/usr/bin/loginctl") (which "loginctl")))
121 #t)))))
122 (synopsis "QML based X11 and Wayland display manager")
123 (description "SDDM is a display manager for X11 and Wayland aiming to be
124 fast, simple and beautiful. SDDM is themeable and puts no restrictions on the
125 user interface design. It uses QtQuick which gives the designer the ability to
126 create smooth, animated user interfaces.")
127 (home-page "https://github.com/sddm/sddm")
128 ;; QML files are MIT licensed and images are CC BY 3.0.
129 (license (list license:gpl2+ license:expat license:cc-by3.0))))
130
131 (define-public guix-simplyblack-sddm-theme
132 (package
133 (name "guix-simplyblack-sddm-theme")
134 (version "0.1")
135 (source (origin
136 (method git-fetch)
137 (uri (git-reference
138 (url "https://github.com/plattfot/guix-simplyblack-sddm")
139 (commit version)))
140 (file-name (git-file-name name version))
141 (sha256
142 (base32 "1fwny6b0xpjs8ad2b16pyxd27gf0sr0nillmhc2h5k0q7dva21vi"))))
143 (build-system trivial-build-system)
144 (arguments
145 `(#:modules ((guix build utils))
146 #:builder
147 (begin
148 (use-modules (guix build utils))
149 (let* ((out (assoc-ref %outputs "out"))
150 (sddm-themes (string-append out "/share/sddm/themes")))
151 (mkdir-p sddm-themes)
152 (copy-recursively (assoc-ref %build-inputs "source")
153 (string-append sddm-themes "/guix-simplyblack-sddm"))))))
154 (home-page "https://github.com/plattfot/guix-simplyblack-sddm")
155 (synopsis "Guix based theme for SDDM")
156 (description
157 "This package provides a simple theme for SDDM, black background with
158 Guix's logo. Based on Arch linux's archlinux-simplyblack theme.")
159 ;; Theme under cc-by-sa3.0, guix logo under license:cc-by-sa4.0
160 (license (list license:cc-by-sa3.0 license:cc-by-sa4.0))))
161
162 (define-public chili-sddm-theme
163 (package
164 (name "chili-sddm-theme")
165 (version "0.1.5")
166 (source (origin
167 (method git-fetch)
168 (uri (git-reference
169 (url "https://github.com/MarianArlt/sddm-chili")
170 (commit version)))
171 (file-name (git-file-name name version))
172 (sha256
173 (base32
174 "036fxsa7m8ymmp3p40z671z163y6fcsa9a641lrxdrw225ssq5f3"))))
175 (build-system trivial-build-system)
176 (arguments
177 `(#:modules ((guix build utils))
178 #:builder
179 (begin
180 (use-modules (guix build utils))
181 (let* ((out (assoc-ref %outputs "out"))
182 (sddm-themes (string-append out "/share/sddm/themes")))
183 (mkdir-p sddm-themes)
184 (copy-recursively (assoc-ref %build-inputs "source")
185 (string-append sddm-themes "/chili"))))))
186 (home-page "https://github.com/MarianArlt/sddm-chili")
187 (synopsis "Chili theme for SDDM")
188 (description "Chili reduces all the clutter and leaves you with a clean,
189 easy to use, login interface with a modern yet classy touch.")
190 (license license:gpl3+)))
191
192 (define-public lightdm
193 (package
194 (name "lightdm")
195 (version "1.30.0")
196 (source (origin
197 (method url-fetch)
198 (uri (string-append
199 "https://github.com/CanonicalLtd/lightdm/releases/download/"
200 version "/lightdm-" version ".tar.xz"))
201 (sha256
202 (base32
203 "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))))
204 (build-system gnu-build-system)
205 (arguments
206 '(#:parallel-tests? #f ; fails when run in parallel
207 #:configure-flags
208 (list "--localstatedir=/var")
209 #:phases
210 (modify-phases %standard-phases
211 (add-after 'unpack 'fix-paths
212 (lambda _
213 (substitute* "src/shared-data-manager.c"
214 (("/bin/rm") (which "rm")))
215 (substitute* '("data/users.conf"
216 "common/user-list.c")
217 (("/bin/false") (which "false"))
218 (("/usr/sbin/nologin") (which "nologin")))
219 (substitute* "src/seat.c"
220 (("/bin/sh") (which "sh")))
221 #t))
222 (add-before 'check 'pre-check
223 ;; Run test-suite under a dbus session.
224 (lambda* (#:key inputs #:allow-other-keys)
225 (wrap-program "tests/src/test-python-greeter"
226 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
227 `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH"))))
228
229 ;; Avoid printing locale warnings, which trip up the text
230 ;; matching tests.
231 (unsetenv "LC_ALL")
232 #t)))))
233 (inputs
234 `(("audit" ,audit)
235 ("linux-pam" ,linux-pam)
236 ("shadow" ,shadow) ;for sbin/nologin
237 ("libgcrypt" ,libgcrypt)
238 ("libxcb" ,libxcb)))
239 (native-inputs
240 `(("gobject-introspection" ,gobject-introspection)
241 ("pkg-config" ,pkg-config)
242 ("itstool" ,itstool)
243 ("intltool" ,intltool)
244 ("vala" ,vala) ;for Vala bindings
245 ;; For tests
246 ("dbus" ,dbus)
247 ("python" ,python-2)
248 ("python-pygobject" ,python2-pygobject)))
249 ;; Required by liblightdm-gobject-1.pc.
250 (propagated-inputs
251 `(("glib" ,glib)
252 ("libx11" ,libx11)
253 ("libxklavier" ,libxklavier)))
254 (home-page "https://www.freedesktop.org/wiki/Software/LightDM/")
255 (synopsis "Lightweight display manager")
256 (description "The Light Display Manager (LightDM) is a cross-desktop
257 display manager which supports different greeters.")
258 (license license:gpl3+)))
259
260 (define-public lightdm-gtk-greeter
261 (package
262 (name "lightdm-gtk-greeter")
263 (version "2.0.7")
264 (source (origin
265 (method url-fetch)
266 (uri (string-append
267 "https://launchpad.net/lightdm-gtk-greeter/"
268 (version-major+minor version) "/" version
269 "/+download/lightdm-gtk-greeter-" version ".tar.gz"))
270 (sha256
271 (base32
272 "1g7wc3d3vqfa7mrdhx1w9ywydgjbffla6rbrxq9k3sc62br97qms"))))
273 (build-system gnu-build-system)
274 (arguments
275 `(#:configure-flags
276 (list (string-append "--enable-at-spi-command="
277 (assoc-ref %build-inputs "at-spi2-core")
278 "/libexec/at-spi-bus-launcher"))
279 #:phases
280 (modify-phases %standard-phases
281 (add-after 'install 'fix-.desktop-file
282 (lambda* (#:key outputs #:allow-other-keys)
283 (let ((out (assoc-ref outputs "out")))
284 (substitute* (string-append
285 out "/share/xgreeters/lightdm-gtk-greeter.desktop")
286 (("Exec=lightdm-gtk-greeter")
287 (string-append "Exec=" out "/sbin/lightdm-gtk-greeter")))
288 #t)))
289 (add-after 'fix-.desktop-file 'wrap-program
290 ;; Mimic glib-or-gtk build system
291 ;; which doesn't wrap files in /sbin
292 (lambda* (#:key outputs inputs #:allow-other-keys)
293 (let ((gtk (assoc-ref inputs "gtk+")))
294 (wrap-program (string-append (assoc-ref outputs "out")
295 "/sbin/lightdm-gtk-greeter")
296 `("XDG_DATA_DIRS" ":" prefix
297 ,(cons "/run/current-system/profile/share"
298 (map (lambda (pkg)
299 (string-append (assoc-ref inputs pkg) "/share"))
300 '("gtk+" "shared-mime-info" "glib"))))
301 `("GTK_PATH" ":" prefix (,gtk))
302 `("GIO_EXTRA_MODULES" ":" prefix (,gtk))))
303 #t)))))
304 (native-inputs
305 `(("exo" ,exo)
306 ("intltool" ,intltool)
307 ("pkg-config" ,pkg-config)))
308 (inputs
309 `(("lightdm" ,lightdm)
310 ("shared-mime-info" ,shared-mime-info)
311 ("at-spi2-core" ,at-spi2-core)
312 ("gtk+" ,gtk+)))
313 (synopsis "GTK+ greeter for LightDM")
314 (home-page "https://launchpad.net/lightdm-gtk-greeter")
315 (description "This package provides a LightDM greeter implementation using
316 GTK+, lets you select a desktop session and log in to it.")
317 (license license:gpl3+)))
318
319 (define-public slim
320 (package
321 (name "slim")
322 (version "1.3.6")
323 (source (origin
324 (method url-fetch)
325 ;; Used to be available from download.berlios.de.
326 (uri (string-append
327 "mirror://sourceforge/slim.berlios/slim-"
328 version ".tar.gz"))
329 (sha256
330 (base32 "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1"))
331 (patches (search-patches "slim-config.patch"
332 "slim-reset.patch"
333 "slim-login.patch"
334 "slim-session.patch"
335 "slim-sigusr1.patch"
336 "slim-display.patch"))))
337 (build-system cmake-build-system)
338 (inputs `(("linux-pam" ,linux-pam)
339 ("libpng" ,libpng)
340 ("libjpeg" ,libjpeg-turbo)
341 ("freeglut" ,freeglut)
342 ("libxrandr" ,libxrandr)
343 ("libxrender" ,libxrender)
344 ("freetype" ,freetype)
345 ("fontconfig" ,fontconfig)
346 ("libx11" ,libx11)
347 ("libxft" ,libxft)
348 ("libxmu" ,libxmu)
349 ("xauth" ,xauth)))
350 (native-inputs
351 `(("pkg-config" ,pkg-config)))
352 (arguments
353 '(#:phases
354 (modify-phases %standard-phases
355 (add-before 'configure 'set-new-etc-location
356 (lambda _
357 (substitute* "CMakeLists.txt"
358 (("/etc")
359 (string-append (assoc-ref %outputs "out") "/etc"))
360 (("install.*systemd.*")
361 ;; The build system's logic here is: if "Linux", then
362 ;; "systemd". Strip that.
363 ""))
364 #t)))
365 #:configure-flags '("-DUSE_PAM=yes"
366 "-DUSE_CONSOLEKIT=no")
367 #:tests? #f))
368
369 ;; This used to be at <http://slim.berlios.de/>.
370 (home-page "https://sourceforge.net/projects/slim.berlios/")
371 (synopsis "Desktop-independent graphical login manager for X11")
372 (description
373 "SLiM is a Desktop-independent graphical login manager for X11, derived
374 from Login.app. It aims to be light and simple, although completely
375 configurable through themes and an option file; is suitable for machines on
376 which remote login functionalities are not needed.
377
378 Features included: PNG and XFT support for alpha transparency and antialiased
379 fonts, External themes support, Configurable runtime options: X server --
380 login / shutdown / reboot commands, Single (GDM-like) or double (XDM-like)
381 input control, Can load predefined user at startup, Configurable welcome /
382 shutdown messages, Random theme selection.")
383 (license license:gpl2)))