unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#43628] Request for patch evaluation/review
@ 2020-09-26  6:15 Prafulla Giri
  2020-09-26  6:36 ` [bug#43628] Further Info Prafulla Giri
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Prafulla Giri @ 2020-09-26  6:15 UTC (permalink / raw)
  To: 43628


[-- Attachment #1.1: Type: text/plain, Size: 2456 bytes --]

Esteemed maintainers (and contributors),

Attached is a patch which, as far as I can see, should work. But it does
not. I would like to submit it here for review. Please tell me what I am
doing wrong or what I am failing to do, so that I might clean up this patch
and submit a proper one.

1. The problem this patch is trying to solve:
Aegisub (guix install aegisub), as it currently is, does not give any sound
(at least on foreign distros). The terminal output reads as follows, when a
video file (with audio) is added into the program and an attempt is made at
playing it: (Video is added to aegisub by using 'Video > Open Video...')
```
ALSA lib conf.c:3683:(snd_config_hooks_call) Cannot open shared library
libasound_module_conf_pulse.so
(/gnu/store/zcjdb23gbhl0pcnvvm8rnlprkfl43cv5-alsa-lib-1.2.2/lib/alsa-lib/libasound_module_conf_pulse.so:
libasound_module_conf_pulse.so: cannot open shared object file: No such
file or directory)
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
```
The complaint being that it can't find libasound_module_conf_pulse.so. This
.so comes from the guix package `alsa-plugins:pulseaudio`. The /gnu/store
directory for it is something like
/gnu/store/...-alsa-plugins-1.2.2-pulseaudio/lib/alsa-lib/libasound_module_conf_pulse.so.
However, the .so file is being looked for inside of the /gnu/store path to
alsa-lib
(/gnu/store/...-alsa-lib-1.2.2/lib/alsa-lib/libasound_module_conf_pulse.so.

2. The Natural Solution:
Since libasound_module_conf_pulse.so is supplied by
`alsa-plugins:pulseaudio`, and the program is looking for it inside the
path to alsa-lib (supplied by `alsa-lib`), union-build is a logical
solution. This is what the patch implements.

3. Problem:
Despite this patch being applied, it continues to look for the .so file
inside the path to alsa-lib and not the union-alsa. What is more, alsa-lib
is not even in the inputs. Only union-alsa is. And yet, it seems to be
trying to use alsa-lib's /gnu/store path, which, the way I see it, violates
guix's functional package management.

4. It's not guix, it's me:
I'm sure this is some mistake on my part. Hence, I submit the diff here for
review.

P. S: The diff has changed a bit because I got this idea of moving
out/lib/alsa-lib/* into out/lib/ just to see if that makes any difference.
Only to realize a little too late that it doesn't. But I send the diff with
those changes included because I didn't stash the previous (cleaner) one.

[-- Attachment #1.2: Type: text/html, Size: 2771 bytes --]

[-- Attachment #2: aegisub_alsa_pulseaudio.diff --]
[-- Type: text/x-patch, Size: 1623 bytes --]

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 0f727a6e9e..0e037fb24b 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -3836,7 +3836,41 @@ programmers to access a standard API to open and decompress media files.")
        ("hunspell" ,hunspell)
        ("mesa" ,mesa)
        ("libass" ,libass)
-       ("alsa-lib" ,alsa-lib)
+       ("alsa-lib-with-pulseaudio-plugin"
+        ,(package
+           (inherit alsa-lib)
+           (name "alsa-lib-with-pulseaudio-plugin")
+           (source #f)
+           (build-system trivial-build-system)
+           (arguments
+            `(#:modules ((guix build union)
+		         (guix build utils))
+              #:builder
+              (begin
+	        (use-modules (ice-9 match)
+		             (guix build union)
+		             (guix build utils))
+	        (let ((out (assoc-ref %outputs "out")))
+	          (match %build-inputs
+	            (((names . directories) ...)
+	             (union-build out
+			          directories
+			          #:create-all-directories? #f)
+	             #t))
+	          ;; do stuff here
+	          (find-files (string-append out "/lib/alsa-lib/")
+		              (lambda (found stat)
+			        (symlink-relative
+			         found
+			         (string-append
+			          out
+			          "/lib/"
+			          (basename found)))
+			        #t)))
+	        #t)))
+           (inputs
+            `(("alsa-lib" ,alsa-lib)
+              ("alsa-plugins:pulseaudio" ,alsa-plugins "pulseaudio")))))
        ("pulseaudio" ,pulseaudio)
        ("libx11" ,libx11)
        ("freetype" ,freetype)

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

end of thread, other threads:[~2020-09-28 17:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26  6:15 [bug#43628] Request for patch evaluation/review Prafulla Giri
2020-09-26  6:36 ` [bug#43628] Further Info Prafulla Giri
2020-09-26  7:31   ` Prafulla Giri
2020-09-26  9:43     ` Julien Lepiller
2020-09-26  9:57       ` Prafulla Giri
2020-09-26 12:07         ` Prafulla Giri
2020-09-26 14:35           ` Julien Lepiller
2020-09-26 20:46             ` Prafulla Giri
2020-09-26 21:15               ` Julien Lepiller
2020-09-27  5:56                 ` Prafulla Giri
2020-09-27 11:09                   ` Julien Lepiller
2020-09-28 14:43                     ` Prafulla Giri
2020-09-28 15:20                       ` Julien Lepiller
2020-09-26  9:51 ` [bug#43628] Progress (?) Prafulla Giri
2020-09-28 17:02 ` [bug#43628] Request for patch evaluation/review Leo Famulari

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).