gnu: sddm: Fix FTBFS after Qt paths change.
[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>
16686a90 3;;; Copyright © 2014 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>
4aa0891c
JG
8;;;
9;;; This file is part of GNU Guix.
10;;;
11;;; GNU Guix is free software; you can redistribute it and/or modify it
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
16;;; GNU Guix is distributed in the hope that it will be useful, but
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
5fd66a37 24(define-module (gnu packages display-managers)
99c53e22 25 #:use-module ((guix licenses) #:prefix license:)
4aa0891c
JG
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system cmake)
4606f3a3 29 #:use-module (guix build-system gnu)
4aa0891c 30 #:use-module (guix packages)
4606f3a3 31 #:use-module (guix utils)
16686a90 32 #:use-module (gnu packages)
15791fa5 33 #:use-module (gnu packages admin)
901385ca
DC
34 #:use-module (gnu packages fontutils)
35 #:use-module (gnu packages freedesktop)
4aa0891c 36 #:use-module (gnu packages gl)
901385ca 37 #:use-module (gnu packages glib)
4606f3a3
RW
38 #:use-module (gnu packages gnome)
39 #:use-module (gnu packages gnupg)
c0326ebc 40 #:use-module (gnu packages gtk)
e55354b8 41 #:use-module (gnu packages image)
901385ca
DC
42 #:use-module (gnu packages kde-frameworks)
43 #:use-module (gnu packages linux)
4aa0891c 44 #:use-module (gnu packages pkg-config)
4606f3a3 45 #:use-module (gnu packages python)
901385ca
DC
46 #:use-module (gnu packages qt)
47 #:use-module (gnu packages xdisorg)
c0326ebc 48 #:use-module (gnu packages xfce)
901385ca
DC
49 #:use-module (gnu packages xorg))
50
51(define-public greenisland
52 (package
53 (name "greenisland")
d3d92ec2 54 (version "0.9.0.1")
901385ca
DC
55 (source (origin
56 (method url-fetch)
57 (uri (string-append
58 "https://github.com/greenisland/greenisland"
59 "/releases/download/v" version "/"
60 "greenisland-" version ".tar.xz"))
61 (sha256
62 (base32
d3d92ec2 63 "1flmha31hmii6m2mdvmn1q5dc0fhnvgc4lp1b4wgkz20y7x4f1fm"))))
901385ca
DC
64 (build-system cmake-build-system)
65 (native-inputs
66 `(("extra-cmake-modules" ,extra-cmake-modules)
67 ("dbus" ,dbus)
68 ("glib:bin" ,glib "bin")
69 ("pkg-config" ,pkg-config)
70 ("xorg-server" ,xorg-server)))
71 (inputs
72 `(("elogind" ,elogind)
73 ("eudev" ,eudev)
74 ("fontconfig" ,fontconfig)
75 ("freetype" ,freetype)
76 ("glib" ,glib)
77 ("libdrm" ,libdrm)
78 ("libinput" ,libinput-minimal)
79 ("libxcursor" ,libxcursor)
80 ("libxkbcommon" ,libxkbcommon)
81 ("libx11" ,libx11)
82 ("mesa" ,mesa)
83 ("qtbase" ,qtbase)
84 ("qtdeclarative" ,qtdeclarative)
85 ("wayland" ,wayland)
86 ("wayland-protocols" ,wayland-protocols)
87 ("xcb-util-cursor" ,xcb-util-cursor)))
88 (arguments
89 `(#:configure-flags
90 (list (string-append "-DPLUGIN_INSTALL_DIR="
91 (assoc-ref %outputs "out") "/plugins")
92 (string-append "-DQML_INSTALL_DIR="
93 (assoc-ref %outputs "out") "/qml"))
94 #:modules ((guix build cmake-build-system)
95 (guix build qt-utils)
96 (guix build utils))
97 #:imported-modules (,@%cmake-build-system-modules
98 (guix build qt-utils))
99 #:phases
100 (modify-phases %standard-phases
101 (add-after 'unpack 'disable-udev-tests
102 (lambda _ ; FIXME: Build env doesn't contain /dev/sda
103 (substitute* "tests/auto/platform/tst_udev.cpp"
104 (("QVERIFY") "// QVERIFY")
105 (("QCOMPARE") "// QCOMPARE"))))
106 (replace 'check
107 (lambda _
108 (setenv "DBUS_FATAL_WARNINGS" "0")
109 (zero? (system* "dbus-launch" "ctest" "."))))
110 (add-before 'check 'check-setup
111 (lambda _
112 (setenv "CTEST_OUTPUT_ON_FAILURE" "1") ; Enable debug output
94e24d81 113 ;; make Qt render "offscreen", required for tests
901385ca
DC
114 (setenv "QT_QPA_PLATFORM" "offscreen")
115 (setenv "XDG_RUNTIME_DIR" (getcwd))
116 #t))
117 (add-after 'install 'wrap-programs
118 (lambda* (#:key outputs #:allow-other-keys)
119 (let ((out (assoc-ref outputs "out")))
120 (wrap-qt-program out "greenisland")
121 (wrap-qt-program out "greenisland-launcher")
122 (wrap-qt-program out "greenisland-screencaster")
123 (wrap-qt-program out "greenisland-wayland-scanner")
124 #t))))))
125 (synopsis "QtQuick Wayland compositor and shell for desktop and mobile")
126 (description "Green Island provides a full blown Wayland compositor for
127QtQuick as well as pluggable hardware abstraction, extensions, tools and a
128Qt-style API for Wayland clients.")
129 (home-page "http://hawaiios.org")
130 ;; Choice of license at the user's opinion.
131 (license (list license:gpl2 license:gpl3 license:lgpl2.1 license:lgpl3))))
4aa0891c 132
15791fa5
DC
133(define-public sddm
134 (package
135 (name "sddm")
bd6d0eba 136 (version "0.16.0")
15791fa5
DC
137 (source (origin
138 (method url-fetch)
139 (uri (string-append
140 "https://github.com/sddm/sddm"
141 "/releases/download/v" version "/"
bd6d0eba 142 "sddm-" version ".tar.xz"))
15791fa5
DC
143 (sha256
144 (base32
bd6d0eba 145 "0fwf1wsdak5yglykfyq4wbx9g9gi079n8ncjrdynz17hwwiql4z9"))))
15791fa5
DC
146 (build-system cmake-build-system)
147 (native-inputs
148 `(("extra-cmake-modules" ,extra-cmake-modules)
149 ("pkg-config" ,pkg-config)
150 ("qttools" ,qttools)))
151 (inputs
fa9f5222
MB
152 `(("elogind" ,elogind)
153 ("glib" ,glib)
15791fa5
DC
154 ("libxcb" ,libxcb)
155 ("libxkbcommon" ,libxkbcommon)
156 ("linux-pam" ,linux-pam)
157 ("qtbase" ,qtbase)
158 ("qtdeclarative" ,qtdeclarative)
159 ("shadow" ,shadow)
160 ("wayland" ,wayland)))
161 (arguments
162 `(#:configure-flags
163 (list
164 ;; Currently doesn't do anything
165 ;; Option added by enable wayland greeters PR
166 "-DENABLE_WAYLAND=ON"
167 "-DENABLE_PAM=ON"
fa9f5222
MB
168 ;; Both flags are required for elogind support.
169 "-DNO_SYSTEMD=ON" "-DUSE_ELOGIND=ON"
15791fa5
DC
170 "-DCONFIG_FILE=/etc/sddm.conf"
171 ;; Set path to /etc/login.defs
172 ;; Alternatively use -DUID_MIN and -DUID_MAX
173 (string-append "-DLOGIN_DEFS_PATH="
174 (assoc-ref %build-inputs "shadow")
175 "/etc/login.defs")
176 (string-append "-DQT_IMPORTS_DIR="
177 (assoc-ref %outputs "out") "/qml")
178 (string-append "-DCMAKE_INSTALL_SYSCONFDIR="
179 (assoc-ref %outputs "out") "/etc"))
180 #:modules ((guix build cmake-build-system)
181 (guix build qt-utils)
182 (guix build utils))
183 #:imported-modules (,@%cmake-build-system-modules
184 (guix build qt-utils))
185 #:phases
186 (modify-phases %standard-phases
fa9f5222
MB
187 (add-after 'unpack 'embed-loginctl-reference
188 (lambda _
189 (substitute* "CMakeLists.txt"
190 (("/usr/bin/loginctl") (which "loginctl")))
191 #t))
58f0a19c
MB
192 (add-before 'configure 'fix-qml-include
193 (lambda _
194 ;; Make sure QtQml is found when building the helper.
195 ;; See <https://github.com/sddm/sddm/pull/918>.
196 (substitute* "src/helper/CMakeLists.txt"
197 (("target_link_libraries\\(sddm-helper")
198 "target_link_libraries(sddm-helper Qt5::Qml"))
199 #t))
15791fa5
DC
200 (add-after 'install 'wrap-programs
201 (lambda* (#:key outputs #:allow-other-keys)
202 (let ((out (assoc-ref outputs "out")))
203 (wrap-qt-program out "sddm")
204 (wrap-qt-program out "sddm-greeter")
205 #t))))))
206 (synopsis "QML based X11 and Wayland display manager")
207 (description "SDDM is a display manager for X11 and Wayland aiming to be
208fast, simple and beautiful. SDDM is themeable and puts no restrictions on the
209user interface design. It uses QtQuick which gives the designer the ability to
210create smooth, animated user interfaces.")
211 (home-page "https://github.com/sddm/sddm")
212 ;; QML files are MIT licensed and images are CC BY 3.0.
213 (license (list license:gpl2+ license:expat license:cc-by3.0))))
214
4606f3a3
RW
215(define-public lightdm
216 (package
217 (name "lightdm")
218 (version "1.22.0")
219 (source (origin
220 (method url-fetch)
221 (uri (string-append "https://launchpad.net/lightdm/"
222 (version-major+minor version) "/"
223 version "/+download/lightdm-"
224 version ".tar.xz"))
225 (sha256
226 (base32
227 "0a5bvfl2h7r873al6q7c819h0kg564k9fh51rl6489z6lyvazfg4"))))
228 (build-system gnu-build-system)
229 (arguments
230 '(#:parallel-tests? #f ; fails when run in parallel
231 #:configure-flags
232 (list "--localstatedir=/var")
233 #:phases
234 (modify-phases %standard-phases
235 (add-after 'unpack 'fix-paths
236 (lambda _
237 (substitute* "src/shared-data-manager.c"
238 (("/bin/rm") (which "rm")))
239 (substitute* '("data/users.conf"
240 "common/user-list.c")
241 (("/bin/false") (which "false"))
242 (("/usr/sbin/nologin") (which "nologin")))
243 (substitute* "src/seat.c"
244 (("/bin/sh") (which "sh")))
245 #t))
246 (add-after 'unpack 'disable-broken-tests
247 (lambda _
248 (substitute* "tests/Makefile.in"
249 (("test-sessions-gobject ") "")
250 ((" test-sessions-python ") " "))
251 #t))
252 (add-before 'check 'pre-check
253 ;; Run test-suite under a dbus session.
254 (lambda* (#:key inputs #:allow-other-keys)
255 (wrap-program "tests/src/test-python-greeter"
256 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
257 `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH"))))
258
259 ;; Avoid printing locale warnings, which trip up the text
260 ;; matching tests.
261 (unsetenv "LC_ALL")
262 #t)))))
263 (inputs
264 `(("audit" ,audit)
265 ("linux-pam" ,linux-pam)
266 ("util-linux" ,util-linux) ; for sbin/nologin
267 ("libgcrypt" ,libgcrypt)
268 ("libxcb" ,libxcb)))
269 (native-inputs
270 `(("gobject-introspection" ,gobject-introspection)
271 ("pkg-config" ,pkg-config)
272 ("itstool" ,itstool)
273 ("intltool" ,intltool)
274 ;; For tests
275 ("dbus" ,dbus)
276 ("python" ,python-2)
277 ("python-pygobject" ,python2-pygobject)))
278 ;; Required by liblightdm-gobject-1.pc.
279 (propagated-inputs
280 `(("glib" ,glib)
281 ("libx11" ,libx11)
282 ("libxklavier" ,libxklavier)))
283 (home-page "https://www.freedesktop.org/wiki/Software/LightDM/")
284 (synopsis "Lightweight display manager")
285 (description "The Light Display Manager (LightDM) is a cross-desktop
286display manager which supports different greeters.")
287 (license license:gpl3+)))
288
c0326ebc
SB
289(define-public lightdm-gtk-greeter
290 (package
291 (name "lightdm-gtk-greeter")
292 (version "2.0.2")
293 (source (origin
294 (method url-fetch)
295 (uri (string-append
296 "https://launchpad.net/lightdm-gtk-greeter/"
297 (version-major+minor version) "/" version
298 "/+download/lightdm-gtk-greeter-" version ".tar.gz"))
299 (sha256
300 (base32
301 "1436sdm83xqhxyr1rzqxhsl8if2xmidlvb341xcv6dv83lyxkrlf"))))
302 (build-system gnu-build-system)
303 (native-inputs
304 `(("exo" ,exo)
305 ("intltool" ,intltool)
306 ("pkg-config" ,pkg-config)))
307 (inputs
308 `(("lightdm" ,lightdm)
309 ("gtk+" ,gtk+)))
310 (synopsis "GTK+ greeter for LightDM")
311 (home-page "https://launchpad.net/lightdm-gtk-greeter")
312 (description "This package provides a LightDM greeter implementation using
313GTK+, lets you select a desktop session and log in to it.")
314 (license license:gpl3+)))
315
4aa0891c
JG
316(define-public slim
317 (package
318 (name "slim")
16686a90 319 (version "1.3.6")
4aa0891c
JG
320 (source (origin
321 (method url-fetch)
d8c19441
LC
322 ;; Used to be available from download.berlios.de.
323 (uri (string-append
0f971a04 324 "mirror://sourceforge/slim.berlios/slim-"
d8c19441 325 version ".tar.gz"))
4aa0891c 326 (sha256
16686a90 327 (base32 "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1"))
fc1adab1 328 (patches (search-patches "slim-config.patch"
0b71c15c 329 "slim-reset.patch"
17d50dfd 330 "slim-login.patch"
fc1adab1
AK
331 "slim-session.patch"
332 "slim-sigusr1.patch"))))
4aa0891c
JG
333 (build-system cmake-build-system)
334 (inputs `(("linux-pam" ,linux-pam)
335 ("libpng" ,libpng)
336 ("libjpeg" ,libjpeg)
337 ("freeglut" ,freeglut)
338 ("libxrandr" ,libxrandr)
339 ("libxrender" ,libxrender)
340 ("freetype" ,freetype)
341 ("fontconfig" ,fontconfig)
c4c4cc05 342 ("libx11" ,libx11)
4aa0891c
JG
343 ("libxft" ,libxft)
344 ("libxmu" ,libxmu)
345 ("xauth" ,xauth)))
c4c4cc05
JD
346 (native-inputs
347 `(("pkg-config" ,pkg-config)))
4aa0891c 348 (arguments
dc1d3cde
KK
349 '(#:phases
350 (modify-phases %standard-phases
351 (add-before 'configure 'set-new-etc-location
352 (lambda _
353 (substitute* "CMakeLists.txt"
354 (("/etc")
355 (string-append (assoc-ref %outputs "out") "/etc"))
356 (("install.*systemd.*")
357 ;; The build system's logic here is: if "Linux", then
358 ;; "systemd". Strip that.
359 ""))
360 #t)))
06ed5982
AE
361 #:configure-flags '("-DUSE_PAM=yes"
362 "-DUSE_CONSOLEKIT=no")
4aa0891c 363 #:tests? #f))
d8c19441
LC
364
365 ;; This used to be at <http://slim.berlios.de/>.
3b3b60d0 366 (home-page "https://sourceforge.net/projects/slim.berlios/")
ae133b89 367 (synopsis "Desktop-independent graphical login manager for X11")
4aa0891c
JG
368 (description
369 "SLiM is a Desktop-independent graphical login manager for X11, derived
ae133b89
EB
370from Login.app. It aims to be light and simple, although completely
371configurable through themes and an option file; is suitable for machines on
372which remote login functionalities are not needed.
4aa0891c 373
ae133b89
EB
374Features included: PNG and XFT support for alpha transparency and antialiased
375fonts, External themes support, Configurable runtime options: X server --
376login / shutdown / reboot commands, Single (GDM-like) or double (XDM-like)
377input control, Can load predefined user at startup, Configurable welcome /
e881752c 378shutdown messages, Random theme selection.")
99c53e22 379 (license license:gpl2)))