GNU bug report logs - #75417
[PATCH] gnu: Add lightdm-tiny-greeter.

Previous Next

Package: guix-patches;

Reported by: tumashu <at> 163.com

Date: Tue, 7 Jan 2025 05:18:02 UTC

Severity: normal

Tags: patch

Done: 宋文武 <iyzsong <at> envs.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75417 in the body.
You can then email your comments to 75417 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#75417; Package guix-patches. (Tue, 07 Jan 2025 05:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to tumashu <at> 163.com:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 07 Jan 2025 05:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: tumashu <at> 163.com
To: guix-patches <at> gnu.org
Cc: Feng Shu <tumashu <at> 163.com>
Subject: [PATCH] gnu: Add lightdm-tiny-greeter.
Date: Tue,  7 Jan 2025 13:16:56 +0800
From: Feng Shu <tumashu <at> 163.com>

* 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





Information forwarded to tumashu <at> 163.com, guix-patches <at> gnu.org:
bug#75417; Package guix-patches. (Wed, 08 Jan 2025 13:19:02 GMT) Full text and rfc822 format available.

Message #8 received at 75417 <at> debbugs.gnu.org (full text, mbox):

From: tumashu <at> 163.com
To: 75417 <at> debbugs.gnu.org
Cc: Feng Shu <tumashu <at> 163.com>
Subject: [PATCH v2] gnu: Add lightdm-tiny-greeter.
Date: Wed,  8 Jan 2025 21:18:03 +0800
From: Feng Shu <tumashu <at> 163.com>

* 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
Signed-off-by: Feng Shu <tumashu <at> 163.com>
---
 gnu/packages/display-managers.scm | 109 +++++++++++++++++++++++++++++-
 1 file changed, 108 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index cddd3f494f..b43f4ece28 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,112 @@ (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 'glib-or-gtk-wrap 'custom-wrap
+              (lambda _
+                (wrap-script (string-append #$output "/bin/lightdm-tiny-greeter")
+                  ;; Wrap GDK_PIXBUF_MODULE_FILE, so that the SVG loader is
+                  ;; available at all times even outside of profiles, such as
+                  ;; when used in the lightdm-service-type.  Otherwise, it
+                  ;; wouldn't be able to display its own icons.
+                  `("GDK_PIXBUF_MODULE_FILE" =
+                    (,(string-append
+                       #$output
+                       "/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache")))
+                  `("XDG_DATA_DIRS" ":" prefix
+                    (,(string-append "/run/current-system/profile/share:"
+                                     (getenv "XDG_DATA_DIRS"))))
+                  '("XCURSOR_PATH" ":" prefix
+                    ("/run/current-system/profile/share/icons")))))
+            (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+ guile-3.0 lightdm))
+      (synopsis "Tiny Greeter for LightDM")
+      (home-page "https://github.com/tobiohlala/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 name session
+                                         user_text pass_text
+                                         fontname fontsize)
+  "Make a customized lightdm-tiny-greeter package which name is NAME.
+
+This function will change SESSION, USER_TEXT, PASS_TEXT, FONTNAME and FONTSIZE
+in config.h of lightdm-tiny-greeter."
+  (package
+    (inherit lightdm-tiny-greeter)
+    (name (or name (string-append
+                    (package-name lightdm-tiny-greeter)
+                    "-" (or session "default"))))
+    (arguments
+     (substitute-keyword-arguments
+         (package-arguments lightdm-tiny-greeter)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'patch-config-h
+              (lambda _
+                (when #$user_text
+                  (substitute* "config.h"
+                    (("\\*user_text = .*;")
+                     (string-append "*user_text = \"" #$user_text "\";"))))
+                (when #$pass_text
+                  (substitute* "config.h"
+                    (("\\*pass_text = .*;")
+                     (string-append "*pass_text = \"" #$pass_text "\";"))))
+                (when #$session
+                  (substitute* "config.h"
+                    (("\\*session = .*;")
+                     (string-append "*session = \"" #$session "\";"))))
+                (when #$fontname
+                  (substitute* "config.h"
+                    (("font: .*px .*;")
+                     (string-append "font: 16px \\\"" #$fontname "\\\";"))))
+                (when #$fontsize
+                  (substitute* "config.h"
+                    (("font: .*px")
+                     (string-append "font: " #$fontsize "px"))))))))))))
+
 (define-public slim
   (package
     (name "slim")
-- 
2.47.1





Reply sent to 宋文武 <iyzsong <at> envs.net>:
You have taken responsibility. (Mon, 13 Jan 2025 00:20:01 GMT) Full text and rfc822 format available.

Notification sent to tumashu <at> 163.com:
bug acknowledged by developer. (Mon, 13 Jan 2025 00:20:02 GMT) Full text and rfc822 format available.

Message #13 received at 75417-done <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: tumashu <at> 163.com
Cc: 75417-done <at> debbugs.gnu.org
Subject: Re: [bug#75417] [PATCH v2] gnu: Add lightdm-tiny-greeter.
Date: Mon, 13 Jan 2025 08:22:26 +0800
tumashu <at> 163.com writes:

> From: Feng Shu <tumashu <at> 163.com>
>
> * 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!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 10 Feb 2025 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.