all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#38670] [PATCH] Fix audio/video in icecat
@ 2019-12-19 13:59 Julien Lepiller
  2019-12-21 22:49 ` Ludovic Courtès
  2019-12-23 11:50 ` bug#38670: " Julien Lepiller
  0 siblings, 2 replies; 8+ messages in thread
From: Julien Lepiller @ 2019-12-19 13:59 UTC (permalink / raw)
  To: 38670

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

Hi guix,

since the update to icecat 68, mpeg decoding doesn't work in IceCat
(mp3/mp4 would not play, breaking a lot of online media players). This
patch addresses that issue, that was caused by IceCat not finding
ffmpeg's library. It was dlopening libavcodec.so, but could not find
it. I replaced it with an absolute reference to the library in the
store, which now allows IceCat to load the library at runtime. It also
adds ffmpeg to icecat's closure, ensuring it will always find it.

[-- Attachment #2: 0001-gnu-icecat-Fix-linking-with-ffmpeg.patch --]
[-- Type: text/x-patch, Size: 1424 bytes --]

From c144cf973235d2e633daeeedbac45fcf61da04a1 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Thu, 19 Dec 2019 13:02:34 +0100
Subject: [PATCH] gnu: icecat: Fix linking with ffmpeg.

* gnu/packages/gnuzilla.scm (icecat): Use absolute path for ffmpeg
library loading.
---
 gnu/packages/gnuzilla.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 2f15beecc7..ce63f6762e 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -950,7 +950,7 @@ from forcing GEXP-PROMISE."
                          ))
              #t))
          (add-after 'remove-bundled-libraries 'link-libxul-with-libraries
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
              ;; libxul.so dynamically opens libraries, so here we explicitly
              ;; link them into libxul.so instead.
              ;;
@@ -963,6 +963,9 @@ from forcing GEXP-PROMISE."
     'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
     'avcodec', 'avutil', 'pulse' ]\n\n"
                                all)))
+             (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
+               (("libavcodec.so.[0-9]*")
+                (string-append (assoc-ref inputs "ffmpeg") "/lib/libavcodec.so")))
              #t))
          (replace 'bootstrap
            (lambda _
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#38670] [PATCH] Fix audio/video in icecat
  2019-12-19 13:59 [bug#38670] [PATCH] Fix audio/video in icecat Julien Lepiller
@ 2019-12-21 22:49 ` Ludovic Courtès
  2019-12-22  4:52   ` Mark H Weaver
  2019-12-23 11:50 ` bug#38670: " Julien Lepiller
  1 sibling, 1 reply; 8+ messages in thread
From: Ludovic Courtès @ 2019-12-21 22:49 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: Mark H Weaver, 38670

Hi Julien,

Julien Lepiller <julien@lepiller.eu> skribis:

> since the update to icecat 68, mpeg decoding doesn't work in IceCat
> (mp3/mp4 would not play, breaking a lot of online media players). This
> patch addresses that issue, that was caused by IceCat not finding
> ffmpeg's library. It was dlopening libavcodec.so, but could not find
> it. I replaced it with an absolute reference to the library in the
> store, which now allows IceCat to load the library at runtime. It also
> adds ffmpeg to icecat's closure, ensuring it will always find it.

Great that you found out!

>>From c144cf973235d2e633daeeedbac45fcf61da04a1 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Thu, 19 Dec 2019 13:02:34 +0100
> Subject: [PATCH] gnu: icecat: Fix linking with ffmpeg.
>
> * gnu/packages/gnuzilla.scm (icecat): Use absolute path for ffmpeg
> library loading.

LGTM!  (Cc’ing Mark for a heads-up.)

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#38670] [PATCH] Fix audio/video in icecat
  2019-12-21 22:49 ` Ludovic Courtès
@ 2019-12-22  4:52   ` Mark H Weaver
  2019-12-22  7:07     ` Brett Gilio
  2019-12-22 10:00     ` Julien Lepiller
  0 siblings, 2 replies; 8+ messages in thread
From: Mark H Weaver @ 2019-12-22  4:52 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: Ludovic Courtès, 38670

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

Hi Julien,

Thanks very much for investigating and producing a working fix for this
issue!  It is a great relief to remove this item from my TODO list :)

I have a few minor nits, and am currently testing a slight variant of
your proposed patch, attached below.  I made the following changes:

* I added a new phase instead of augmenting the existing
  'link-libxul-with-libraries' phase, since the name of the existing
  phase doesn't match what's being done here.

* I leave the numeric suffixes (version number) of the shared library
  names unchanged, instead of stripping them as you did.

* I used "\\." in the regexp to strictly match that character.

* I moved the rationale comment from the commit log into the code.

What do you think?

   Thanks again!
       Mark



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] gnu: icecat: Fix linking with ffmpeg --]
[-- Type: text/x-patch, Size: 1303 bytes --]

From eed217b25cea8926680308c8e21522417fe13cf4 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Thu, 19 Dec 2019 13:02:07 +0100
Subject: [PATCH] gnu: icecat: Fix linking with ffmpeg.

* gnu/packages/gnuzilla.scm (icecat)[arguments]: Add
'fix-ffmpeg-runtime-linker' phase.

Co-authored-by: Mark H Weaver <mhw@netris.org>.
---
 gnu/packages/gnuzilla.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 8bfa6c2a55..46fc7928a0 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -968,6 +968,13 @@ from forcing GEXP-PROMISE."
     'avcodec', 'avutil', 'pulse' ]\n\n"
                                all)))
              #t))
+         (add-after 'link-libxul-with-libraries 'fix-ffmpeg-runtime-linker
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Arrange to load libavcodec.so by its absolute file name.
+             (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp"
+               (("libavcodec\\.so")
+                (string-append (assoc-ref inputs "ffmpeg") "/lib/libavcodec.so")))
+             #t))
          (replace 'bootstrap
            (lambda _
              (invoke "sh" "-c" "autoconf old-configure.in > old-configure")
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#38670] [PATCH] Fix audio/video in icecat
  2019-12-22  4:52   ` Mark H Weaver
@ 2019-12-22  7:07     ` Brett Gilio
  2019-12-22 10:00     ` Julien Lepiller
  1 sibling, 0 replies; 8+ messages in thread
From: Brett Gilio @ 2019-12-22  7:07 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Julien Lepiller, Ludovic Courtès, 38670



Dec 21, 2019 10:54:14 PM Mark H Weaver :

> Hi Julien,
>
> Thanks very much for investigating and producing a working fix for this
> issue! It is a great relief to remove this item from my TODO list :)
>
> I have a few minor nits, and am currently testing a slight variant of
> your proposed patch, attached below. I made the following changes:
>
> * I added a new phase instead of augmenting the existing
> 'link-libxul-with-libraries' phase, since the name of the existing
> phase doesn't match what's being done here.
>
> * I leave the numeric suffixes (version number) of the shared library
> names unchanged, instead of stripping them as you did.
>
> * I used "\\." in the regexp to strictly match that character.
>
> * I moved the rationale comment from the commit log into the code.
>
> What do you think?
>
> Thanks again!
> Mark
>


I think with Mark's changes this is looking pretty much perfect.


--
Brett M. Gilio
GNU Guix, Contributor | GNU Project, Webmaster
[DFC0 C7F7 9EE6 0CA7 AE55 5E19 6722 43C4 A03F 0EEE]
<brettg@gnu.org> <brettg@posteo.net>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#38670] [PATCH] Fix audio/video in icecat
  2019-12-22  4:52   ` Mark H Weaver
  2019-12-22  7:07     ` Brett Gilio
@ 2019-12-22 10:00     ` Julien Lepiller
  2019-12-22 20:33       ` Mark H Weaver
  1 sibling, 1 reply; 8+ messages in thread
From: Julien Lepiller @ 2019-12-22 10:00 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 38670

Le Sat, 21 Dec 2019 23:52:08 -0500,
Mark H Weaver <mhw@netris.org> a écrit :

> Hi Julien,
> 
> Thanks very much for investigating and producing a working fix for
> this issue!  It is a great relief to remove this item from my TODO
> list :)
> 
> I have a few minor nits, and am currently testing a slight variant of
> your proposed patch, attached below.  I made the following changes:
> 
> * I added a new phase instead of augmenting the existing
>   'link-libxul-with-libraries' phase, since the name of the existing
>   phase doesn't match what's being done here.
> 
> * I leave the numeric suffixes (version number) of the shared library
>   names unchanged, instead of stripping them as you did.
> 
> * I used "\\." in the regexp to strictly match that character.
> 
> * I moved the rationale comment from the commit log into the code.
> 
> What do you think?

Looks very good! Can you push it, or should I do it?

> 
>    Thanks again!
>        Mark
> 
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#38670] [PATCH] Fix audio/video in icecat
  2019-12-22 10:00     ` Julien Lepiller
@ 2019-12-22 20:33       ` Mark H Weaver
  2019-12-22 23:04         ` Julien Lepiller
  0 siblings, 1 reply; 8+ messages in thread
From: Mark H Weaver @ 2019-12-22 20:33 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 38670

Hi Julien,

Julien Lepiller <julien@lepiller.eu> wrote:
> Looks very good! Can you push it, or should I do it?

Would you be willing to try building IceCat with my variant of your
patch and confirm that it works for you?  If it does, please push it.

The reason I ask is because although I built it myself, I'm not sure
that it's working for me.  It might be that the specific sites I tried
are failing to work for other reasons, e.g. the privacy enhancements in
IceCat's default configuration.  Or, it might be that my decision to
keep the shared library version numbers intact somehow broke it.

    Thank you!
       Mark

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#38670] [PATCH] Fix audio/video in icecat
  2019-12-22 20:33       ` Mark H Weaver
@ 2019-12-22 23:04         ` Julien Lepiller
  0 siblings, 0 replies; 8+ messages in thread
From: Julien Lepiller @ 2019-12-22 23:04 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 38670

Le 22 décembre 2019 21:33:13 GMT+01:00, Mark H Weaver <mhw@netris.org> a écrit :
>Hi Julien,
>
>Julien Lepiller <julien@lepiller.eu> wrote:
>> Looks very good! Can you push it, or should I do it?
>
>Would you be willing to try building IceCat with my variant of your
>patch and confirm that it works for you?  If it does, please push it.
>
>The reason I ask is because although I built it myself, I'm not sure
>that it's working for me.  It might be that the specific sites I tried
>are failing to work for other reasons, e.g. the privacy enhancements in
>IceCat's default configuration.  Or, it might be that my decision to
>keep the shared library version numbers intact somehow broke it.
>
>    Thank you!
>       Mark

Sure, I'jl do that tomorrow morning. I have ajready tried a few variants of my own patch, and it worked well both with anl without the version number. However, I'll build and check your patch before pushing.

I'm basically testing the default html5 player on an mp3 file, which didn't work before (you can see in the browser console it says mpeg is unsupported) and worked after applying the patch (and no more erron in the console).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#38670: [PATCH] Fix audio/video in icecat
  2019-12-19 13:59 [bug#38670] [PATCH] Fix audio/video in icecat Julien Lepiller
  2019-12-21 22:49 ` Ludovic Courtès
@ 2019-12-23 11:50 ` Julien Lepiller
  1 sibling, 0 replies; 8+ messages in thread
From: Julien Lepiller @ 2019-12-23 11:50 UTC (permalink / raw)
  To: 38670-done

Pushed Mark's version as 8e5567195f5d29301d571612085b5afdb460619d.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-12-23 11:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-19 13:59 [bug#38670] [PATCH] Fix audio/video in icecat Julien Lepiller
2019-12-21 22:49 ` Ludovic Courtès
2019-12-22  4:52   ` Mark H Weaver
2019-12-22  7:07     ` Brett Gilio
2019-12-22 10:00     ` Julien Lepiller
2019-12-22 20:33       ` Mark H Weaver
2019-12-22 23:04         ` Julien Lepiller
2019-12-23 11:50 ` bug#38670: " Julien Lepiller

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.