;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 David Thompson ;;; Copyright © 2015 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages man) #:use-module (guix licenses) #:use-module (guix download) #:use-module (guix packages) #:use-module (guix build-system gnu) #:use-module (gnu packages flex) #:use-module (gnu packages gawk) #:use-module (gnu packages gdbm) #:use-module (gnu packages groff) #:use-module (gnu packages less) #:use-module (gnu packages lynx) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config)) (define-public libpipeline (package (name "libpipeline") (version "1.3.0") (source (origin (method url-fetch) (uri (string-append "mirror://savannah/libpipeline/libpipeline-" version ".tar.gz")) (sha256 (base32 "12d6ldcj7kv2nv832b23v97g7035d0ybq0ig7h0yr7xk9czd3z7i")))) (build-system gnu-build-system) (home-page "http://libpipeline.nongnu.org/") (synopsis "C library for manipulating pipelines of subprocesses") (description "libpipeline is a C
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Joshua Grant <tadni@riseup.net>
;;; Copyright © 2014, 2018, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 L  p R n  d n <guix@lprndn.info>
;;; Copyright © 2020 Fredrik Salomonsson <plattfot@gmail.com>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2021-2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages display-managers)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system qt)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system glib-or-gtk)
  #:use-module (guix build-system trivial)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (guix gexp)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages image)
  #:use-module (gnu packages kde-frameworks)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xfce)
  #:use-module (gnu packages xorg))

(define-public sddm
  (package
    (name "sddm")
    (version "0.21.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/sddm/sddm")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0mxrh0z9x4r4bli25g746n66adwnf3r42lzq0yssc50v9y7fc1a1"))))
    (build-system qt-build-system)
    (native-inputs
     (list extra-cmake-modules pkg-config qttools))
    (inputs
     (list elogind
           glib
           libxcb
           libxkbcommon
           linux-pam
           qtdeclarative
           qtsvg
           shadow
           wayland
           qtwayland
           qtbase
           xsetroot))
    (arguments
     (let* ((qtbase (this-package-input "qtbase"))
            (qt6? (string= "6" (version-major (package-version qtbase)))))
       (list
        #:qtbase qtbase
        #:configure-flags
        #~(list
           #$@(if qt6?
                  #~("-DBUILD_WITH_QT6=ON")
                  #~())
           "-DENABLE_WAYLAND=ON"
           "-DENABLE_PAM=ON"
           ;; PAM is configured by pam service.
           "-DINSTALL_PAM_CONFIGURATION=OFF"
           ;; Both flags are required for elogind support.
           "-DNO_SYSTEMD=ON"
           "-DUSE_ELOGIND=ON"
           "-DCONFIG_FILE=/etc/sddm.conf"
           ;; Set path to /etc/login.defs.
           ;; An alternative would be to use -DUID_MIN and -DUID_MAX.
           (string-append "-DLOGIN_DEFS_PATH="
                          #$(this-package-input "shadow")
                          "/etc/login.defs")
           (string-append
            "-DCMAKE_CXX_FLAGS=-I"
            #$(this-package-input "qtdeclarative") "/include/qt" #$(if qt6? "6" "5"))
           (string-append "-DQT_IMPORTS_DIR="
                          #$output "/lib/qt" #$(if qt6? "6" "5") "/qml")
           (string-append "-DCMAKE_INSTALL_SYSCONFDIR="
                          #$output "/etc"))
        #:phases
        #~(modify-phases %standard-phases
            (add-after 'unpack 'embed-loginctl-reference
              (lambda _
                (substitute* "CMakeLists.txt"
                  (("/usr/bin/loginctl")
                   (which "loginctl")))))
            (add-after 'unpack 'embed-xsetroot-reference
              (lambda* (#:key inputs #:allow-other-keys)
                (substitute* '("src/daemon/XorgD