GNU bug report logs - #69933
[PATCH emacs-team 0/2] gnu: emacs-nerd-icons: Patch out installer.

Previous Next

Package: guix-patches;

Reported by: normally_js <normally_js <at> posteo.net>

Date: Thu, 21 Mar 2024 21:38:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 69933 AT debbugs.gnu.org.

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

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


Report forwarded to andrew <at> trop.in, cox.katherine.e+guix <at> gmail.com, liliana.prikler <at> gmail.com, guix-patches <at> gnu.org:
bug#69933; Package guix-patches. (Thu, 21 Mar 2024 21:38:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to normally_js <normally_js <at> posteo.net>:
New bug report received and forwarded. Copy sent to andrew <at> trop.in, cox.katherine.e+guix <at> gmail.com, liliana.prikler <at> gmail.com, guix-patches <at> gnu.org. (Thu, 21 Mar 2024 21:38:01 GMT) Full text and rfc822 format available.

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

From: normally_js <normally_js <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: normally_js <normally_js <at> posteo.net>
Subject: [PATCH emacs-team 0/2] gnu: emacs-nerd-icons: Patch out installer.
Date: Thu, 21 Mar 2024 21:36:10 +0000
Related to #67983, this patchset removes the unstable install script from the
`emacs-nerd-icons' package to instead propagate the symbols nerd font from
Guix itself.

normally_js (2):
  gnu: Add font-symbols-nerd.
  gnu: emacs-nerd-icons: Patch out installer.

 gnu/local.mk                                  |  2 +
 gnu/packages/emacs-xyz.scm                    |  4 ++
 gnu/packages/fonts.scm                        | 24 ++++++++
 .../emacs-nerd-icons-remove-installer.patch   | 59 +++++++++++++++++++
 4 files changed, 89 insertions(+)
 create mode 100644 gnu/packages/patches/emacs-nerd-icons-remove-installer.patch


base-commit: d67e4f0f9b10c7ddac8fb0ca68cbf1d6ad0a6e5d
--
2.41.0




Information forwarded to andrew <at> trop.in, cox.katherine.e+guix <at> gmail.com, liliana.prikler <at> gmail.com, guix-patches <at> gnu.org:
bug#69933; Package guix-patches. (Thu, 21 Mar 2024 21:40:02 GMT) Full text and rfc822 format available.

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

From: normally_js <normally_js <at> posteo.net>
To: 69933 <at> debbugs.gnu.org
Cc: normally_js <normally_js <at> posteo.net>
Subject: [PATCH 2/2] gnu: emacs-nerd-icons: Patch out installer.
Date: Thu, 21 Mar 2024 21:37:57 +0000
Instead of relying on the built-in installer script to collect the nerd font
icons files (which is unstable since it downloads a blob from the master
branch of the same repository), we can propagate the `font-symbols-nerd'
package.

* gnu/packages/patches/emacs-nerd-icons-remove-installer.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register emacs-nerd-icons-remove-installer.patch.
* gnu/packages/emacs-xyz.scm (emacs-nerd-icons)
[source]: Apply emacs-nerd-icons-remove-installer.patch.
[propagated-inputs]: Add font-symbols-nerd.

Change-Id: I712fcfe67512837fa7db59546d7492c3a7755561
---
 gnu/local.mk                                  |  2 +
 gnu/packages/emacs-xyz.scm                    |  4 ++
 .../emacs-nerd-icons-remove-installer.patch   | 59 +++++++++++++++++++
 3 files changed, 65 insertions(+)
 create mode 100644 gnu/packages/patches/emacs-nerd-icons-remove-installer.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7f1006010b..0f99730a68 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -64,6 +64,7 @@
 # Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
 # Copyright © 2023 Troy Figiel <troy <at> troyfigiel.com>
 # Copyright © 2024 David Elsing <david.elsing <at> posteo.net>
+# Copyright © 2024 normally_js <normally_js <at> posteo.net>
 #
 # This file is part of GNU Guix.
 #
@@ -1985,6 +1986,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/racket-rktio-bin-sh.patch		\
   %D%/packages/patches/racket-zuo-bin-sh.patch			\
   %D%/packages/patches/remake-impure-dirs.patch			\
+  %D%/packages/patches/emacs-nerd-icons-remove-installer.patch	\
   %D%/packages/patches/restartd-update-robust.patch             \
   %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch	\
   %D%/packages/patches/rng-tools-revert-build-randstat.patch	\
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index eadc8eeb67..4c0a7d815f 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -138,6 +138,7 @@
 ;;; Copyright © 2023 Ian Eure <ian <at> retrospec.tv>
 ;;; Copyright © 2024 Suhail Singh <suhail <at> bayesians.ca>
 ;;; Copyright © 2024 dan <i <at> dan.games>
+;;; Copyright © 2024 normally_js <normally_js <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28906,12 +28907,15 @@ (define-public emacs-nerd-icons
        (method git-fetch)
        (uri (git-reference (url home-page) (commit version)))
        (file-name (git-file-name name version))
+       (patches
+        (search-patches "emacs-nerd-icons-remove-installer.patch"))
        (sha256
         (base32
          "0ggj6lm02m7nb5gxnqs2v2lkxsclml6kq176vam9qyg1fsm7yvdw"))))
     (build-system emacs-build-system)
     (arguments
      (list #:include #~(cons "^data\\/" %default-include)))
+    (propagated-inputs (list font-symbols-nerd))
     (synopsis "Library for easily using nerd font icons inside Emacs")
     (description "Nerd-icons an alternative to all-the-icons.  It works on both
 GUI and terminal, and requires a nerd font installed on your system.")
diff --git a/gnu/packages/patches/emacs-nerd-icons-remove-installer.patch b/gnu/packages/patches/emacs-nerd-icons-remove-installer.patch
new file mode 100644
index 0000000000..1edc1fcd91
--- /dev/null
+++ b/gnu/packages/patches/emacs-nerd-icons-remove-installer.patch
@@ -0,0 +1,59 @@
+From d6e6f3bda3f7267e54be153d985f48accc8b21ae Mon Sep 17 00:00:00 2001
+From: normally_js <normally_js <at> posteo.net>
+Date: Thu, 21 Mar 2024 16:47:34 -0400
+Subject: [PATCH] Remove nerd-icons-install-fonts procedure.
+
+---
+ nerd-icons.el | 36 ------------------------------------
+ 1 file changed, 36 deletions(-)
+
+diff --git a/nerd-icons.el b/nerd-icons.el
+index 0b7b02d..a5e3d49 100644
+--- a/nerd-icons.el
++++ b/nerd-icons.el
+@@ -963,42 +963,6 @@ string."
+          (cons candidate-name candidate-icon)))
+      data)))
+ 
+-;;;###autoload
+-(defun nerd-icons-install-fonts (&optional pfx)
+-  "Helper function to download and install the latests fonts based on OS.
+-The provided Nerd Font is Symbols Nerd Font Mono.
+-When PFX is non-nil, ignore the prompt and just install"
+-  (interactive "P")
+-  (when (or pfx (yes-or-no-p "This will download and install fonts, are you sure you want to do this?"))
+-    (let* ((url-format "https://raw.githubusercontent.com/rainstormstudio/nerd-icons.el/main/fonts/%s")
+-           (font-dest (cond
+-                       ;; Default Linux install directories
+-                       ((member system-type '(gnu gnu/linux gnu/kfreebsd))
+-                        (concat (or (getenv "XDG_DATA_HOME")
+-                                    (concat (getenv "HOME") "/.local/share"))
+-                                "/fonts/"
+-                                nerd-icons-fonts-subdirectory))
+-                       ;; Default MacOS install directory
+-                       ((eq system-type 'darwin)
+-                        (concat (getenv "HOME")
+-                                "/Library/Fonts/"
+-                                nerd-icons-fonts-subdirectory))))
+-           (known-dest? (stringp font-dest))
+-           (font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
+-
+-      (unless (file-directory-p font-dest) (mkdir font-dest t))
+-
+-      (mapc (lambda (font)
+-              (url-copy-file (format url-format font) (expand-file-name font font-dest) t))
+-            nerd-icons-font-names)
+-      (when known-dest?
+-        (message "Fonts downloaded, updating font cache... <fc-cache -f -v> ")
+-        (shell-command-to-string (format "fc-cache -f -v")))
+-      (message "%s Successfully %s `nerd-icons' fonts to `%s'!"
+-               (nerd-icons-wicon "nf-weather-stars" :v-adjust 0.0)
+-               (if known-dest? "installed" "downloaded")
+-               font-dest))))
+-
+ ;;;###autoload
+ (defun nerd-icons-insert (&optional arg glyph-set)
+   "Interactive icon insertion function.
+-- 
+2.41.0
+
-- 
2.41.0





Information forwarded to all_but_last <at> 163.com, iyzsong <at> envs.net, guix-patches <at> gnu.org:
bug#69933; Package guix-patches. (Thu, 21 Mar 2024 21:41:02 GMT) Full text and rfc822 format available.

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

From: normally_js <normally_js <at> posteo.net>
To: 69933 <at> debbugs.gnu.org
Cc: normally_js <normally_js <at> posteo.net>
Subject: [PATCH 1/2] gnu: Add font-symbols-nerd.
Date: Thu, 21 Mar 2024 21:37:56 +0000
* gnu/packages/fonts.scm (font-symbols-nerd): New variable.

Change-Id: I9ce3b60a775bffeff8ca3a9ebbd90f66ebf614ff
---
 gnu/packages/fonts.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/fonts.scm b/gnu/packages/fonts.scm
index 9ec722c19c..7ab576b506 100644
--- a/gnu/packages/fonts.scm
+++ b/gnu/packages/fonts.scm
@@ -60,6 +60,7 @@
 ;;; Copyright © 2023 chris <chris <at> bumblehead.com>
 ;;; Copyright © 2023, 2024 Luis Felipe López Acevedo <sirgazil <at> zoho.com>
 ;;; Copyright © 2024 Christina O'Donnell <cdo <at> mutix.org>
+;;; Copyright © 2024 normally_js <normally_js <at> posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3578,6 +3579,29 @@ (define-public font-scientifica
 Most characters are just 4px wide, which is brilliant for low dpi(90-120) displays.")
     (license license:silofl1.1)))
 
+(define-public font-symbols-nerd
+  (package
+    (name "font-symbols-nerd")
+    (version "3.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/ryanoasis/nerd-fonts/releases/download/v"
+             version
+             "/NerdFontsSymbolsOnly.zip"))
+       (sha256
+        (base32 "0xka49qk3r5m3jgpk3fi9b7j593fflg287ck99k12p8czqz62r4c"))))
+    (build-system font-build-system)
+    (home-page "https://www.nerdfonts.com/")
+    (synopsis "Nerd Font symbols standalone package")
+    (description
+     "This package provides just the Nerd Font icons that can be used to patch
+fonts for icon support or provide glyph support to user interfaces.  It
+provides a high number of glyphs in addition to those found in 'iconic' fonts
+like Font Awesome.")
+    (license license:expat)))
+
 (define-public font-tuffy
   (package
     (name "font-tuffy")
-- 
2.41.0





This bug report was last modified 43 days ago.

Previous Next


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