Subject: Re: bug#77415: Native Messaging in librewolf doesn't work

From: Clément Lassieur <[email-masked]>
Date: Tue, 08 Apr 2025 13:22:22 +0200

On Tue, Apr 08 2025, Rutherther via Bug reports for GNU Guix wrote:

>>> Okay, I was wrong. The problem is only when ICECAT_SYSTEM_DIR is unset.
>>> When it's set to anywhere, like /, it works fine for me as well.
>>
>> Great!
>>
>> Closing :)
>
> Should this really be closed? I think it's a bug that ought to be fixed.
> Or at least the user's should get to know somehow they have to set it.
> If user is not using any extensions via Guix, they won't be able to use
> native messaging unless they know about this culprit.

Oh right, I reopen.

Would the attached patch fix your issue?  (Can't test it right now.)

Thanks,
Clément

>From 6bd1435258dc2a3a745918df052d603eebaa5cf5 Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= <[email-masked]>
Date: Tue, 8 Apr 2025 12:27:07 +0200
Subject: [PATCH] gnu: librewolf: Create lib/icecat so that ICECAT_SYSTEM_DIR
 is set.

This avoids issues with Native Messaging and non-guix add-ons:
<https://issues.guix.gnu.org/77415>.

* gnu/packages/librewolf.scm (librewolf):[arguments]: Add an
'mkdir-lib-icecat' phase.

Change-Id: I2e5dc8f599708c414c9266ee3453a6beac08ee66
---
 gnu/packages/librewolf.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/librewolf.scm b/gnu/packages/librewolf.scm
index 1cb7084f231d..a98b93ba3aae 100644
--- a/gnu/packages/librewolf.scm
+++ b/gnu/packages/librewolf.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2015 Sou Bunnbu <[email-masked]>
 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2016 Alex Griffin <[email-masked]>
-;;; Copyright © 2017 Clément Lassieur <[email-masked]>
+;;; Copyright © 2017, 2025 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2017, 2018 Nikita <[email-masked]>
 ;;; Copyright © 2017, 2018 ng0 <[email-masked]>
 ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <[email-masked]>
@@ -665,7 +665,12 @@ (define-public librewolf
                                                       "/default" size ".png")
                                        (string-append dest
                                                       "/librewolf.png"))))
-                          '("16" "32" "48" "64" "128"))))))
+                          '("16" "32" "48" "64" "128")))))
+          ;; Make sure ICECAT_SYSTEM_DIR is set to avoid issues with Native
+          ;; Messaging and non-guix add-ons.
+          (add-after 'install-icons 'mkdir-lib-icecat
+            (lambda _
+              (mkdir-p (string-append #$output "/lib/icecat")))))
 
       ;; Test will significantly increase build time but with little rewards.
       #:tests? #f

base-commit: f61281317fa73717854ec15337db850734ea2878
-- 
2.49.0