From aed385e18ec7b68a0bc1bb4b173aeadc9cd97245 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 29 Jan 2023 01:00:00 +0100 Subject: [PATCH] gnu: papirus-icon-theme: Reduce inode consumption. * gnu/packages/gnome-xyz.scm (papirus-icon-theme)[arguments]: Add a new 'halve-inode-consumption phase. --- gnu/packages/gnome-xyz.scm | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm index 84b46fe89f..0cb4adac76 100644 --- a/gnu/packages/gnome-xyz.scm +++ b/gnu/packages/gnome-xyz.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2020 Jack Hill ;;; Copyright © 2020 Kei Kebreau ;;; Copyright © 2020 Ekaitz Zarraga -;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2020, 2023 Tobias Geerinckx-Rice ;;; Copyright © 2020 Ryan Prior ;;; Copyright © 2020 Ellis Kenyo ;;; Copyright © 2020 Stefan Reichör @@ -216,7 +216,23 @@ (define-public papirus-icon-theme (modify-phases %standard-phases (delete 'bootstrap) (delete 'configure) - (delete 'build)))) + (delete 'build) + (add-after 'install 'halve-inode-consumption + ;; This package uses over 100K inodes, which is a lot. We can easily + ;; halve that number by using (hard) links, to no ill effect. + ;; See . + ;; However, the source checkout will still use the full amount! + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (symlink? (lambda (_ stat) + (eq? 'symlink (stat:type stat))))) + (for-each (lambda (file) + (with-directory-excursion (dirname file) + (let ((target (readlink file))) + (when (eq? 'regular (stat:type (stat target))) + (delete-file file) + (link target file))))) + (find-files out symlink?)))))))) (native-inputs (list `(,gtk+ "bin"))) (home-page "https://git.io/papirus-icon-theme")