Subject: [PATCH 3/4] gnu: papirus-icon-theme: Preserve hardlinks to save inodes.

From: Timo Wilken <[email-masked]>
Date: Wed, 2 Apr 2025 13:16:21 +0200

Even though the package has a 'halve-inode-consumption phase, this only works
if the subsequent `cp' doesn't break the created hardlinks again.  Tell `cp'
to preserve them.

For me, this commit reduces the number of hardlinks under /share/icons inside
this package from 113886 to 58697 (compared to 116011 without the
'halve-inode-consumption phase).

* gnu/packages/gnome-xyz.scm (papirus-icon-theme) [arguments]:
  Preserve hardlinks during installation.

Change-Id: I594fb47ecd09754f6b3e13b74215826521db5cfa
---
 gnu/packages/gnome-xyz.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 2a9b50d9b4..2054cd9762 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -217,7 +217,8 @@ (define-public papirus-icon-theme
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f                      ; no test suite
-       #:make-flags ,#~(list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+       #:make-flags ,#~(list "CP_OPTS=--preserve=links"
+                             (string-append "PREFIX=" (assoc-ref %outputs "out")))
        #:phases
        ,#~(modify-phases %standard-phases
             (delete 'bootstrap)
-- 
2.49.0