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