summaryrefslogtreecommitdiff
path: root/nongnu/packages/mozilla.scm
diff options
context:
space:
mode:
authorTomas Volf <wolf@wolfsden.cz>2023-10-07 21:05:59 +0200
committerJonathan Brielmaier <jonathan.brielmaier@web.de>2023-10-09 11:27:58 +0200
commitd08096e25f7e6c77f8d463f64dab40b269215154 (patch)
treed18be2eb144c944695403ae663292477e00429e0 /nongnu/packages/mozilla.scm
parent5e5167168efbdaf561a53edd5622531f411a051b (diff)
nongnu: firefox-esr: Fix Web Speech API.
Firefox loads libspeechd.so.2 during runtime using PR_LoadLibrary and it fails to locate the library in the store. Fix is to add extra phase that patches the file to load the library using an absolute path. * nongnu/packages/mozilla.scm (firefox-esr) [phases]{'patch-SpeechDispatcherService.cpp}: New phase. [inputs]: Add `speech-dispatcher`. Fixes: https://gitlab.com/nonguix/nonguix/-/issues/284 Tested-by: Jonathan Brielmaier <jonathan.brielmaier@web.de>
Diffstat (limited to 'nongnu/packages/mozilla.scm')
-rw-r--r--nongnu/packages/mozilla.scm22
1 files changed, 21 insertions, 1 deletions
diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm
index 1e067fc..aa981a7 100644
--- a/nongnu/packages/mozilla.scm
+++ b/nongnu/packages/mozilla.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2021, 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2023 Tomas Volf <wolf@wolfsden.cz>
(define-module (nongnu packages mozilla)
#:use-module (guix build-system gnu)
@@ -64,6 +65,7 @@
#:use-module (gnu packages python)
#:use-module (gnu packages rust)
#:use-module (gnu packages rust-apps)
+ #:use-module (gnu packages speech)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages video)
#:use-module (nongnu packages wasm)
@@ -154,6 +156,7 @@
"--disable-elf-hack"))
#:imported-modules %cargo-utils-modules
#:modules `((ice-9 regex)
+ (ice-9 string-fun)
(ice-9 ftw)
(srfi srfi-1)
(srfi srfi-26)
@@ -230,6 +233,22 @@
(substitute* "build/RunCbindgen.py"
(("\"--frozen\",") ""))))
(delete 'bootstrap)
+ (add-before 'configure 'patch-SpeechDispatcherService.cpp
+ (lambda _
+ (let* ((lib "libspeechd.so.2")
+ (file "dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp")
+ (old-content (call-with-input-file file get-string-all)))
+ (substitute
+ file
+ `((,(format #f "~s" lib)
+ . ,(λ (line _)
+ (string-replace-substring
+ line
+ lib
+ (string-append #$speech-dispatcher "/lib/" lib))))))
+ (if (string=? old-content
+ (call-with-input-file file get-string-all))
+ (error "substitute did nothing, phase requires an update")))))
(add-before 'configure 'set-build-id
;; Firefox will write the timestamp to output, which is harmful
;; for reproducibility, so change it to a fixed date. Use a
@@ -442,8 +461,9 @@
pipewire
pixman
pulseaudio
- startup-notification
+ speech-dispatcher
sqlite
+ startup-notification
eudev
unzip
zip