GNU bug report logs -
#77251
[PATCH] guix: gtk-icon-themes: produce only cache in output
Previous Next
Reported by: Rutherther <rutherther <at> ditigal.xyz>
Date: Tue, 25 Mar 2025 14:38:02 UTC
Severity: normal
Tags: patch
Done: 宋文武 <iyzsong <at> envs.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sun, 27 Apr 2025 10:40:22 +0800
with message-id <87v7qqjpih.fsf <at> envs.net>
and subject line Re: [bug#77251] [PATCH] guix: gtk-icon-themes: produce only cache in output
has caused the debbugs.gnu.org bug report #77251,
regarding [PATCH] guix: gtk-icon-themes: produce only cache in output
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
77251: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77251
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
This patch changes the behavior of gtk-icon-themes to produce only the
icon-theme.cache cache files, instead of producing the whole union.
The reason for this is that by producing the whole union, the icons are put to
the profile twice. This throws off the union build of the profile and symlinks
all the individual files instead of symlinking folders. This means
unnecessarily high numbers of symlinks are produced.
* guix/profiles.scm (gtk-icon-themes): Produce only caches
Change-Id: Ia452565768753b8a60baf4fc075f6fe5ebb4fa39
---
guix/profiles.scm | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index fb4dbc5bd0..2dda574e03 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1382,23 +1382,32 @@ (define* (gtk-icon-themes manifest #:optional system)
(let* ((destdir (string-append #$output "/share/icons"))
(icondirs (filter file-exists?
(map (cut string-append <> "/share/icons")
- '#$(manifest-inputs manifest)))))
+ '#$(manifest-inputs manifest))))
+ (cache-file-name "icon-theme.cache")
+ (scratchdir (string-append (getcwd) "/icons")))
+
+ (mkdir-p destdir)
;; Union all the icons.
- (mkdir-p (string-append #$output "/share"))
- (union-build destdir icondirs
+ (union-build scratchdir icondirs
#:log-port (%make-void-port "w"))
;; Update the 'icon-theme.cache' file for each icon theme.
(for-each
(lambda (theme)
- (let ((dir (string-append destdir "/" theme)))
- ;; Occasionally DESTDIR contains plain files, such as
+ (let* ((dir (string-append scratchdir "/" theme))
+ (cache-file (string-append dir "/" cache-file-name)))
+ ;; Occasionally SCRATCHDIR contains plain files, such as
;; "abiword_48.png". Ignore these.
(when (file-is-directory? dir)
(ensure-writable-directory dir)
- (system* #+gtk-update-icon-cache "-t" dir "--quiet"))))
- (scandir destdir (negate (cut member <> '("." "..")))))))))
+ (system* #+gtk-update-icon-cache "-t" dir "--quiet")
+ (when (file-exists? cache-file)
+ (mkdir-p (string-append destdir "/" theme))
+ (copy-file
+ cache-file
+ (string-append destdir "/" theme "/" cache-file-name))))))
+ (scandir scratchdir (negate (cut member <> '("." "..")))))))))
;; Don't run the hook when there's nothing to do.
(if %gtk+
base-commit: fbfd2b93831978aadbb96f32cafdab997b04c6c6
--
2.49.0
[Message part 3 (message/rfc822, inline)]
Rutherther <rutherther <at> ditigal.xyz> writes:
> This patch changes the behavior of gtk-icon-themes to produce only the
> icon-theme.cache cache files, instead of producing the whole union.
> The reason for this is that by producing the whole union, the icons are put to
> the profile twice. This throws off the union build of the profile and symlinks
> all the individual files instead of symlinking folders. This means
> unnecessarily high numbers of symlinks are produced.
>
> * guix/profiles.scm (gtk-icon-themes): Produce only caches
Pushed to master as commit 32575294, with simplified commit message.
Thank you!
This bug report was last modified 22 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.