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