Subject: bug#75417: closed (Re: [bug#75417] [PATCH v2] gnu: Add lightdm-tiny-greeter.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 13 Jan 2025 00:20:02 +0000

Your bug report

#75417: [PATCH] gnu: Add lightdm-tiny-greeter.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
75417: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75417
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#75417] [PATCH v2] gnu: Add lightdm-tiny-greeter.
From: 宋文武 <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Mon, 13 Jan 2025 08:22:26 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

[email-masked] writes:

> From: Feng Shu <[email-masked]>
>
> * gnu/packages/display-managers.scm (lightdm-tiny-greeter): New variable.
> (customize-lightdm-tiny-greeter): New variable.
> (gnu): Export customize-lightdm-tiny-greeter.

Pushed to master, with some unnecessary inputs removed.  Thank you!

Subject: [PATCH] gnu: Add lightdm-tiny-greeter.
From: [email-masked]
To: [email-masked]
Cc: Feng Shu <[email-masked]>
Date: Tue, 7 Jan 2025 13:16:56 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

From: Feng Shu <[email-masked]>

* gnu/packages/display-managers.scm (lightdm-tiny-greeter): New variable.
(customize-lightdm-tiny-greeter): New variable.
(gnu): Export customize-lightdm-tiny-greeter.

Change-Id: I4c6d9df0fcc33179692c016bea5a45eaae3b029b
---
 gnu/packages/display-managers.scm | 69 ++++++++++++++++++++++++++++++-
 1 file changed, 68 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index cddd3f494f..a7578f0a8b 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -65,7 +65,8 @@ (define-module (gnu packages display-managers)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xfce)
-  #:use-module (gnu packages xorg))
+  #:use-module (gnu packages xorg)
+  #:export (customize-lightdm-tiny-greeter))
 
 (define-public sddm
   (package
@@ -592,6 +593,72 @@ (define-public lightdm-mini-greeter
 Display Manager and LightDM GTK3 Greeter.")
       (license license:gpl3))))
 
+(define-public lightdm-tiny-greeter
+  (let ((commit "6717c5853315ebd8164b1ddf85b9483f92cbcae8")
+        (revision "0"))
+    (package
+      (name "lightdm-tiny-greeter")
+      ;; Version 1.2 release in 2021, so we use a recent commit.
+      (version (git-version "1.2" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/tobiohlala/lightdm-tiny-greeter")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "1n970d6525fd918i1j09akxiacqbpxni8apkfi542bq5zg5crjbs"))))
+      (build-system glib-or-gtk-build-system)
+      (arguments
+       (list
+        #:tests? #f ; No test target.
+        #:phases
+        #~(modify-phases %standard-phases
+            (delete 'configure)
+            (add-after 'unpack 'patch-hardcoded-paths
+              (lambda _
+                (substitute* "Makefile"
+                  (("PREFIX = /usr")
+                   (string-append "PREFIX = " #$output))
+                  (("/usr/share/xgreeters")
+                   (string-append #$output "/share/xgreeters"))
+                  (("cp lightdm-tiny-greeter")
+                   "mkdir -p $(PREFIX)/bin; cp lightdm-tiny-greeter"))))
+            (add-after 'install 'fix-.desktop-file
+              (lambda _
+                (substitute* (string-append
+                              #$output "/share/xgreeters/lightdm-tiny-greeter.desktop")
+                  (("Exec=lightdm-tiny-greeter")
+                   (string-append "Exec="
+                                  (string-append
+                                   #$output "/bin/lightdm-tiny-greeter")))))))))
+      (native-inputs
+       (list autoconf automake pkg-config))
+      (inputs
+       (list gtk+ lightdm))
+      (synopsis "Tiny Greeter for LightDM")
+      (home-page "https://github.com/prikhi/lightdm-tiny-greeter")
+      (description "A tiny yet customizable GTK3 LightDM Greeter with focus on code and
+minimalism.")
+      (license license:bsd-3))))
+
+(define* (customize-lightdm-tiny-greeter #:key (session "default"))
+  "Make a customized lightdm-tiny-greeter package with SESSION."
+  (package
+    (inherit lightdm-tiny-greeter)
+    (name (string-append (package-name lightdm-tiny-greeter) "-" session))
+    (arguments
+     (substitute-keyword-arguments
+         (package-arguments lightdm-tiny-greeter)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'patch-config-h
+              (lambda _
+                (substitute* "config.h"
+                  (("\\*session = \"default\";")
+                   (string-append "*session = \"" #$session "\";")))))))))))
+
 (define-public slim
   (package
     (name "slim")
-- 
2.45.2