unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#75449] [PATCH] gnu: Add pi-greeter.
@ 2025-01-09  3:00 tumashu
  0 siblings, 0 replies; only message in thread
From: tumashu @ 2025-01-09  3:00 UTC (permalink / raw)
  To: 75449; +Cc: Feng Shu

From: Feng Shu <tumashu@163.com>

* gnu/packages/display-managers.scm (pi-greeter): New variable.

Change-Id: I852019a88a75c06d5e8a215a013b5a6a5c65c57f
---
 gnu/packages/display-managers.scm | 89 +++++++++++++++++++++++++++++++
 1 file changed, 89 insertions(+)

diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index cddd3f494f..6e62230db7 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -592,6 +592,95 @@ (define-public lightdm-mini-greeter
 Display Manager and LightDM GTK3 Greeter.")
       (license license:gpl3))))
 
+(define-public pi-greeter
+  (let ((commit "4acc867b4807000fbd31bafbd33fe35ef1eda39d")
+        (revision "0"))
+    (package
+      (name "pi-greeter")
+      ;; No git release tag, get version from debian/changelog file.
+      (version (git-version "0.25" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/raspberrypi-ui/pi-greeter.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0g67211zk57k32wphika72vr3sxiqp0j0z5d7pr9gapddslf4xay"))))
+      (build-system glib-or-gtk-build-system)
+      (arguments
+       (list
+        #:configure-flags
+        #~(list
+           ;; Put the binary under /bin rather than /sbin, so that it gets
+           ;; wrapped by the glib-or-gtk-wrap phase.
+           (string-append "--sbindir=" #$output "/bin")
+           (string-append "--enable-libindicator")
+           (string-append "--enable-indicator-services"))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'customize-default-config-path
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "configure.ac"
+                  (("INDICATOR_PKG=indicator-")
+                   "INDICATOR_PKG=indicator3-"))
+                (substitute* "src/Makefile.am"
+                  ;; Have the default config directory sourced from
+                  ;; /etc/lightdm/pi-greeter.conf, which is where the
+                  ;; lightdm service writes it.
+                  (("\\$\\(sysconfdir)/lightdm/pi-greeter.conf")
+                   "/etc/lightdm/pi-greeter.conf"))
+                (substitute* "src/pi-greeter.c"
+                  (("/usr/lib/at-spi2-core/at-spi-bus-launcher")
+                   (search-input-file inputs "/libexec/at-spi-bus-launcher")))))
+            (add-after 'glib-or-gtk-wrap 'custom-wrap
+              (lambda _
+                (wrap-script (string-append #$output "/bin/pi-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/pi-greeter.desktop")
+                  (("Exec=pi-greeter")
+                   (string-append "Exec="
+                                  (string-append
+                                   #$output "/bin/pi-greeter")))))))))
+      (native-inputs
+       (list autoconf
+             automake
+             gnome-common
+             intltool
+             pkg-config
+             which))
+      (inputs
+       (list at-spi2-core
+             gtk+
+             gtk-layer-shell
+             guile-3.0
+             gobject-introspection
+             libindicator
+             lightdm))
+      (synopsis "GTK greeter for Raspberry Pi")
+      (home-page "https://github.com/raspberrypi-ui/pi-greeter")
+      (description "A simple GTK-based greeter for the Raspbian LXDE desktop.
+This greeter have no session menu, so user should set user-session option in
+lightdm config file.")
+      (license license:gpl2+))))
+
 (define-public slim
   (package
     (name "slim")
-- 
2.45.2





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-09  3:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-09  3:00 [bug#75449] [PATCH] gnu: Add pi-greeter tumashu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).