summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormally_js <normally_js@posteo.net>2024-03-21 21:37:57 +0000
committerGuix Patches Tester <>2024-04-17 13:58:34 +0200
commit55ae4e30eb1cfec983372d4a46721afbceb81909 (patch)
tree552e135db09fa03ec72852b1ddc8bd8b668f1d12
parent0a60e8969196afbb8467e24c9b935624ea72ed9c (diff)
downloadguix-patches-issue-69933.tar
guix-patches-issue-69933.tar.gz
gnu: emacs-nerd-icons: Patch out installer.issue-69933
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
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/packages/emacs-xyz.scm4
-rw-r--r--gnu/packages/patches/emacs-nerd-icons-remove-installer.patch59
3 files changed, 65 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index ccff8648be..44d0640c17 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -65,6 +65,7 @@
# Copyright © 2023 Herman Rimm <herman@rimm.ee>
# Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
# Copyright © 2024 David Elsing <david.elsing@posteo.net>
+# Copyright © 2024 normally_js <normally_js@posteo.net>
#
# This file is part of GNU Guix.
#
@@ -2003,6 +2004,7 @@ dist_patch_DATA = \
%D%/packages/patches/racket-backport-8.12-chez-configure.patch \
%D%/packages/patches/racket-rktio-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 5da3f28545..14e7eb3e2f 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -138,6 +138,7 @@
;;; Copyright © 2023 Ian Eure <ian@retrospec.tv>
;;; Copyright © 2024 Suhail Singh <suhail@bayesians.ca>
;;; Copyright © 2024 dan <i@dan.games>
+;;; Copyright © 2024 normally_js <normally_js@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -28986,12 +28987,15 @@ files are easily readable and they work nicely with version control systems.")
(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@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
+