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