From patchwork Tue Mar 25 14:36:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rutherther X-Patchwork-Id: 40822 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 31B8027BBEA; Tue, 25 Mar 2025 14:38:22 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ADDB227BBE2 for ; Tue, 25 Mar 2025 14:38:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tx5Ps-00071I-EG; Tue, 25 Mar 2025 10:38:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tx5Po-00070i-Db for guix-patches@gnu.org; Tue, 25 Mar 2025 10:38:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tx5Po-00036V-47; Tue, 25 Mar 2025 10:38:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=vFyGYDhlNsK1pKjc192qOnXf0mHiXlExJvlSqDQTqeE=; b=bEVQm52pHvuuI7jpxuRrZcP6ownbW+eLcf/e3RrfFEvMu8PXiwUsyFR4e+SZl7dboWD8ItYXd5yTcfgZgaHlswT0Z2M3hbc4fb+Bc+LJP6QmqiNQlvw19xnjs+hQv3enP68dRPnCTqfWXWC14R380cCzCNp0V682q/ZHL1qjmmjZQ8/HIuWdJwIwGpWldcJWgcUiZ8STdGA+2OapSZbJzA0C3/Erl/VceafcNOs7yU91hEFMhL/S5fF2rD81kMF1Uz2EeKbKWEoxO7R3ga4mrclr6XTnOkVBIl8x7hBzY5uwiNOjUkVaM4NpGAvZgEXWyyyM2rIi3RbtO3SUgJtWEw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tx5Pm-0007ou-PO; Tue, 25 Mar 2025 10:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77251] [PATCH] guix: gtk-icon-themes: produce only cache in output Resent-From: Rutherther Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 25 Mar 2025 14:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77251 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77251@debbugs.gnu.org Cc: Rutherther , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?b?Q291cnTDg8Kocw==?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?b?Q291cnTDg8Kocw==?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.174291343429972 (code B ref -1); Tue, 25 Mar 2025 14:38:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Mar 2025 14:37:14 +0000 Received: from localhost ([127.0.0.1]:39537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tx5Oz-0007nL-Ly for submit@debbugs.gnu.org; Tue, 25 Mar 2025 10:37:13 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47608) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tx5Ow-0007mu-MD for submit@debbugs.gnu.org; Tue, 25 Mar 2025 10:37:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tx5Oo-0006nI-Tb for guix-patches@gnu.org; Tue, 25 Mar 2025 10:37:03 -0400 Received: from ditigal.xyz ([2a01:4f8:1c1b:6a1c::] helo=mail.ditigal.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1tx5On-00031k-7F for guix-patches@gnu.org; Tue, 25 Mar 2025 10:37:02 -0400 Received: by cerebrum (OpenSMTPD) with ESMTPSA id 1a32f836 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 25 Mar 2025 14:36:56 +0000 (UTC) Date: Tue, 25 Mar 2025 15:36:53 +0100 Message-ID: <10f30ed116239fcdbfe9db9e98b01fd36471c9e7.1742838314.git.rutherther@ditigal.xyz> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ditigal.xyz; i=@ditigal.xyz; q=dns/txt; s=20240917; t=1742913416; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : from; bh=ertbxQu6PDXwATy9yWQJVjeXFbHnA5tqdWzIBt0erqI=; b=KH8DEAk9lbUNJLL2+szVx89ERydNkFPn0rn3Pqm+W86bjS7Zpdoz2WNUQgD10xjrfAx0J AHiCXHg3WWBNXi7cKpNDtASV0Ud1Sl2wp2HyAvN/mTst7HUhPl9WyWF8fZrCycQq5zZIXzU vUUYJNwAFKTOIfRs19IUcRPFYZ+ohyI= Received-SPF: pass client-ip=2a01:4f8:1c1b:6a1c::; envelope-from=rutherther@ditigal.xyz; helo=mail.ditigal.xyz X-Spam_score_int: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.179, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Rutherther X-ACL-Warn: , Rutherther via Guix-patches X-Patchwork-Original-From: Rutherther via Guix-patches via From: Rutherther Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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(-) base-commit: fbfd2b93831978aadbb96f32cafdab997b04c6c6 -- 2.49.0 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+