Subject: [PATCH 2/2] gnu: qutebrowser: Warn about missing .bdic files and ignore version.

From: Herman Rimm <[email-masked]>
Date: Sat, 11 May 2024 21:57:53 +0200

* gnu/packages/web.browsers.scm (qutebrowser): Add build phase.

Change-Id: Ib33c69ca4c95329c82edf9c7a6436ec9a1a0f7a7
---
 gnu/packages/web-browsers.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu/packages/web-browsers.scm b/gnu/packages/web-browsers.scm
index 78227a84fb..fe28f0c149 100644
--- a/gnu/packages/web-browsers.scm
+++ b/gnu/packages/web-browsers.scm
@@ -511,6 +511,22 @@ (define-public qutebrowser
                 (string-append "os.path.join(\""
                                (assoc-ref outputs "out")
                                "\", \"share\", \"qutebrowser\"")))))
+         (add-after 'unpack 'adjust-dictionary-warning-and-parsing
+           (lambda _
+             (substitute* "qutebrowser/browser/webengine/webenginesettings.py"
+               (("- see")
+                "- install hunspell-bdic-{} package files to")
+               (("scripts/dictcli.py in qutebrowser's ")
+                "{}/qutebrowser/qtwebengine_dictionaries")
+               (("\"sources\".format\\(code")
+                ".format(code, code.lower(), os.getenv('XDG_DATA_HOME')"))
+             (substitute* "qutebrowser/browser/webengine/spell.py"
+               (("for matching_dict in matching_dicts")
+                "if False")
+               (("filename for version, filename")
+                "os.path.basename(dict) for dict")
+               (("in sorted\\(versioned_dicts.*")
+                "in matching_dicts]"))))
          (add-before 'check 'set-env-offscreen
            (lambda _
              (setenv "QT_QPA_PLATFORM" "offscreen")))
-- 
2.41.0