display-managers.scm 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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. ;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
  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. (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 (guix gexp)
  41. #:use-module (gnu packages)
  42. #:use-module (gnu packages admin)
  43. #:use-module (gnu packages fontutils)
  44. #:use-module (gnu packages freedesktop)
  45. #:use-module (gnu packages gl)
  46. #:use-module (gnu packages glib)
  47. #:use-module (gnu packages gnome)
  48. #:use-module (gnu packages gnupg)
  49. #:use-module (gnu packages gtk)
  50. #:use-module (gnu packages image)
  51. #:use-module (gnu packages kde-frameworks)
  52. #:use-module (gnu packages linux)
  53. #:use-module (gnu packages pkg-config)
  54. #:use-module (gnu packages python)
  55. #:use-module (gnu packages qt)
  56. #:use-module (gnu packages xdisorg)
  57. #:use-module (gnu packages xfce)
  58. #:use-module (gnu packages xorg))
  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-5)
  84. ("qtdeclarative" ,qtdeclarative)
  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. ("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. #$(this-package-input "shadow")
  108. "/etc/login.defs")
  109. (string-append "-DQT_IMPORTS_DIR="
  110. #$output "/lib/qt5/qml")
  111. (string-append "-DCMAKE_INSTALL_SYSCONFDIR="
  112. #$output "/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. (define-public guix-simplyblack-sddm-theme
  129. (package
  130. (name "guix-simplyblack-sddm-theme")
  131. (version "0.1")
  132. (source (origin
  133. (method git-fetch)
  134. (uri (git-reference
  135. (url "https://github.com/plattfot/guix-simplyblack-sddm")
  136. (commit version)))
  137. (file-name (git-file-name name version))
  138. (sha256
  139. (base32 "1fwny6b0xpjs8ad2b16pyxd27gf0sr0nillmhc2h5k0q7dva21vi"))))
  140. (build-system trivial-build-system)
  141. (arguments
  142. `(#:modules ((guix build utils))
  143. #:builder
  144. (begin
  145. (use-modules (guix build utils))
  146. (let* ((out (assoc-ref %outputs "out"))
  147. (sddm-themes (string-append out "/share/sddm/themes")))
  148. (mkdir-p sddm-themes)
  149. (copy-recursively (assoc-ref %build-inputs "source")
  150. (string-append sddm-themes "/guix-simplyblack-sddm"))))))
  151. (home-page "https://github.com/plattfot/guix-simplyblack-sddm")
  152. (synopsis "Guix based theme for SDDM")
  153. (description
  154. "This package provides a simple theme for SDDM, black background with
  155. Guix's logo. Based on Arch linux's archlinux-simplyblack theme.")
  156. ;; Theme under cc-by-sa3.0, guix logo under license:cc-by-sa4.0
  157. (license (list license:cc-by-sa3.0 license:cc-by-sa4.0))))
  158. (define-public chili-sddm-theme
  159. (package
  160. (name "chili-sddm-theme")
  161. (version "0.1.5")
  162. (source (origin
  163. (method git-fetch)
  164. (uri (git-reference
  165. (url "https://github.com/MarianArlt/sddm-chili")
  166. (commit version)))
  167. (file-name (git-file-name name version))
  168. (sha256
  169. (base32
  170. "036fxsa7m8ymmp3p40z671z163y6fcsa9a641lrxdrw225ssq5f3"))))
  171. (build-system trivial-build-system)
  172. (arguments
  173. `(#:modules ((guix build utils))
  174. #:builder
  175. (begin
  176. (use-modules (guix build utils))
  177. (let* ((out (assoc-ref %outputs "out"))
  178. (sddm-themes (string-append out "/share/sddm/themes")))
  179. (mkdir-p sddm-themes)
  180. (copy-recursively (assoc-ref %build-inputs "source")
  181. (string-append sddm-themes "/chili"))))))
  182. (home-page "https://github.com/MarianArlt/sddm-chili")
  183. (synopsis "Chili theme for SDDM")
  184. (description "Chili reduces all the clutter and leaves you with a clean,
  185. easy to use, login interface with a modern yet classy touch.")
  186. (license license:gpl3+)))
  187. (define-public lightdm
  188. (package
  189. (name "lightdm")
  190. (version "1.30.0")
  191. (source (origin
  192. (method url-fetch)
  193. (uri (string-append
  194. "https://github.com/CanonicalLtd/lightdm/releases/download/"
  195. version "/lightdm-" version ".tar.xz"))
  196. (sha256
  197. (base32
  198. "158zb2d0v1309a8v19hh32y4yj3v6yg4yg6m0l7v59d3a2b7f651"))))
  199. (build-system gnu-build-system)
  200. (arguments
  201. '(#:parallel-tests? #f ; fails when run in parallel
  202. #:configure-flags
  203. (list "--localstatedir=/var")
  204. #:phases
  205. (modify-phases %standard-phases
  206. (add-after 'unpack 'fix-paths
  207. (lambda _
  208. (substitute* "src/shared-data-manager.c"
  209. (("/bin/rm") (which "rm")))
  210. (substitute* '("data/users.conf"
  211. "common/user-list.c")
  212. (("/bin/false") (which "false"))
  213. (("/usr/sbin/nologin") (which "nologin")))
  214. (substitute* "src/seat.c"
  215. (("/bin/sh") (which "sh")))
  216. #t))
  217. (add-before 'check 'pre-check
  218. ;; Run test-suite under a dbus session.
  219. (lambda* (#:key inputs #:allow-other-keys)
  220. (wrap-program "tests/src/test-python-greeter"
  221. `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH")))
  222. `("GI_TYPELIB_PATH" ":" prefix (,(getenv "GI_TYPELIB_PATH"))))
  223. ;; Avoid printing locale warnings, which trip up the text
  224. ;; matching tests.
  225. (unsetenv "LC_ALL")
  226. #t)))))
  227. (inputs
  228. `(("audit" ,audit)
  229. ("linux-pam" ,linux-pam)
  230. ("shadow" ,shadow) ;for sbin/nologin
  231. ("libgcrypt" ,libgcrypt)
  232. ("libxcb" ,libxcb)))
  233. (native-inputs
  234. `(("gobject-introspection" ,gobject-introspection)
  235. ("pkg-config" ,pkg-config)
  236. ("itstool" ,itstool)
  237. ("intltool" ,intltool)
  238. ("vala" ,vala) ;for Vala bindings
  239. ;; For tests
  240. ("dbus" ,dbus)
  241. ("python" ,python-2)
  242. ("python-pygobject" ,python2-pygobject)))
  243. ;; Required by liblightdm-gobject-1.pc.
  244. (propagated-inputs
  245. `(("glib" ,glib)
  246. ("libx11" ,libx11)
  247. ("libxklavier" ,libxklavier)))
  248. (home-page "https://www.freedesktop.org/wiki/Software/LightDM/")
  249. (synopsis "Lightweight display manager")
  250. (description "The Light Display Manager (LightDM) is a cross-desktop
  251. display manager which supports different greeters.")
  252. (license license:gpl3+)))
  253. (define-public lightdm-gtk-greeter
  254. (package
  255. (name "lightdm-gtk-greeter")
  256. (version "2.0.7")
  257. (source (origin
  258. (method url-fetch)
  259. (uri (string-append
  260. "https://launchpad.net/lightdm-gtk-greeter/"
  261. (version-major+minor version) "/" version
  262. "/+download/lightdm-gtk-greeter-" version ".tar.gz"))
  263. (sha256
  264. (base32
  265. "1g7wc3d3vqfa7mrdhx1w9ywydgjbffla6rbrxq9k3sc62br97qms"))))
  266. (build-system gnu-build-system)
  267. (arguments
  268. `(#:configure-flags
  269. (list (string-append "--enable-at-spi-command="
  270. (assoc-ref %build-inputs "at-spi2-core")
  271. "/libexec/at-spi-bus-launcher"))
  272. #:phases
  273. (modify-phases %standard-phases
  274. (add-after 'install 'fix-.desktop-file
  275. (lambda* (#:key outputs #:allow-other-keys)
  276. (let ((out (assoc-ref outputs "out")))
  277. (substitute* (string-append
  278. out "/share/xgreeters/lightdm-gtk-greeter.desktop")
  279. (("Exec=lightdm-gtk-greeter")
  280. (string-append "Exec=" out "/sbin/lightdm-gtk-greeter")))
  281. #t)))
  282. (add-after 'fix-.desktop-file 'wrap-program
  283. ;; Mimic glib-or-gtk build system
  284. ;; which doesn't wrap files in /sbin
  285. (lambda* (#:key outputs inputs #:allow-other-keys)
  286. (let ((gtk (assoc-ref inputs "gtk+")))
  287. (wrap-program (string-append (assoc-ref outputs "out")
  288. "/sbin/lightdm-gtk-greeter")
  289. `("XDG_DATA_DIRS" ":" prefix
  290. ,(cons "/run/current-system/profile/share"
  291. (map (lambda (pkg)
  292. (string-append (assoc-ref inputs pkg) "/share"))
  293. '("gtk+" "shared-mime-info" "glib"))))
  294. `("GTK_PATH" ":" prefix (,gtk))
  295. `("GIO_EXTRA_MODULES" ":" prefix (,gtk))))
  296. #t)))))
  297. (native-inputs
  298. `(("exo" ,exo)
  299. ("intltool" ,intltool)
  300. ("pkg-config" ,pkg-config)))
  301. (inputs
  302. `(("lightdm" ,lightdm)
  303. ("shared-mime-info" ,shared-mime-info)
  304. ("at-spi2-core" ,at-spi2-core)
  305. ("gtk+" ,gtk+)))
  306. (synopsis "GTK+ greeter for LightDM")
  307. (home-page "https://launchpad.net/lightdm-gtk-greeter")
  308. (description "This package provides a LightDM greeter implementation using
  309. GTK+, lets you select a desktop session and log in to it.")
  310. (license license:gpl3+)))
  311. (define-public slim
  312. (package
  313. (name "slim")
  314. (version "1.3.6")
  315. (source (origin
  316. (method url-fetch)
  317. ;; Used to be available from download.berlios.de.
  318. (uri (string-append
  319. "mirror://sourceforge/slim.berlios/slim-"
  320. version ".tar.gz"))
  321. (sha256
  322. (base32 "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1"))
  323. (patches (search-patches "slim-config.patch"
  324. "slim-reset.patch"
  325. "slim-login.patch"
  326. "slim-session.patch"
  327. "slim-sigusr1.patch"
  328. "slim-display.patch"))))
  329. (build-system cmake-build-system)
  330. (inputs `(("linux-pam" ,linux-pam)
  331. ("libpng" ,libpng)
  332. ("libjpeg" ,libjpeg-turbo)
  333. ("freeglut" ,freeglut)
  334. ("libxrandr" ,libxrandr)
  335. ("libxrender" ,libxrender)
  336. ("freetype" ,freetype)
  337. ("fontconfig" ,fontconfig)
  338. ("libx11" ,libx11)
  339. ("libxft" ,libxft)
  340. ("libxmu" ,libxmu)
  341. ("xauth" ,xauth)))
  342. (native-inputs
  343. `(("pkg-config" ,pkg-config)))
  344. (arguments
  345. '(#:phases
  346. (modify-phases %standard-phases
  347. (add-before 'configure 'set-new-etc-location
  348. (lambda _
  349. (substitute* "CMakeLists.txt"
  350. (("/etc")
  351. (string-append (assoc-ref %outputs "out") "/etc"))
  352. (("install.*systemd.*")
  353. ;; The build system's logic here is: if "Linux", then
  354. ;; "systemd". Strip that.
  355. ""))
  356. #t)))
  357. #:configure-flags '("-DUSE_PAM=yes"
  358. "-DUSE_CONSOLEKIT=no")
  359. #:tests? #f))
  360. ;; This used to be at <http://slim.berlios.de/>.
  361. (home-page "https://sourceforge.net/projects/slim.berlios/")
  362. (synopsis "Desktop-independent graphical login manager for X11")
  363. (description
  364. "SLiM is a Desktop-independent graphical login manager for X11, derived
  365. from Login.app. It aims to be light and simple, although completely
  366. configurable through themes and an option file; is suitable for machines on
  367. which remote login functionalities are not needed.
  368. Features included: PNG and XFT support for alpha transparency and antialiased
  369. fonts, External themes support, Configurable runtime options: X server --
  370. login / shutdown / reboot commands, Single (GDM-like) or double (XDM-like)
  371. input control, Can load predefined user at startup, Configurable welcome /
  372. shutdown messages, Random theme selection.")
  373. (license license:gpl2)))