From patchwork Sat Sep 26 06:15:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prafulla Giri X-Patchwork-Id: 24308 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5F25A27BBE9; Sat, 26 Sep 2020 07:16:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8DEE127BBE8 for ; Sat, 26 Sep 2020 07:16:09 +0100 (BST) Received: from localhost ([::1]:35972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kM3VA-0007Pq-P1 for patchwork@mira.cbaines.net; Sat, 26 Sep 2020 02:16:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kM3V4-0007Pj-RZ for guix-patches@gnu.org; Sat, 26 Sep 2020 02:16:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kM3V4-0006Bv-It for guix-patches@gnu.org; Sat, 26 Sep 2020 02:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kM3V4-0005mE-E8 for guix-patches@gnu.org; Sat, 26 Sep 2020 02:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43628] Request for patch evaluation/review Resent-From: Prafulla Giri Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 Sep 2020 06:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43628 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 43628@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160110095922193 (code B ref -1); Sat, 26 Sep 2020 06:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Sep 2020 06:15:59 +0000 Received: from localhost ([127.0.0.1]:45662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kM3V1-0005lt-Bu for submit@debbugs.gnu.org; Sat, 26 Sep 2020 02:15:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:58868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kM3Uy-0005lk-Q5 for submit@debbugs.gnu.org; Sat, 26 Sep 2020 02:15:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kM3Uy-0007PX-Jc for guix-patches@gnu.org; Sat, 26 Sep 2020 02:15:56 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:46410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kM3Uw-00065y-GB for guix-patches@gnu.org; Sat, 26 Sep 2020 02:15:56 -0400 Received: by mail-pl1-x635.google.com with SMTP id f1so407859plo.13 for ; Fri, 25 Sep 2020 23:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=3pvOTPmUec0m1v3XpXB0EGphDNi0LV0CvjpckLo5g6o=; b=nvEdFLuUh6CqkKmXo2TJv7YO54uD2Za1toMIRKKVXZQAYU9DG9IfikbLJut0/RnLqe Mykr9NbPr2bxydcoR1nHD8O1mRbR/L6FckKMFtkJqV1hi1jGFIhSMM8AT5m3pEI/n32e usuJ6pEMCmzF0RFbs2ksUHk7M4b6KkLKrAR+ZZfuEyWhnWqrZsNPMYVOFdzN4S39FP5M z2n/YDMzk0NkBSfdYdOR30RP1mRKVlMkTuKHv4F7SvbvDQixJwL5nM5vQZlQ+33RHF5s yskdWK2elKyGL/JhuuVNux1b8Qps/obmSxsMJRL2alJ5Jcg8WUH0Mnp6dy+h/7G24SMH vNsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3pvOTPmUec0m1v3XpXB0EGphDNi0LV0CvjpckLo5g6o=; b=mEQgv04H1mVwb3CLBUn1rqWv/UwVCgOUxdrgKEI17kvpQBMrc84gb3EEB+sGZQGc/R SmmJXm+P4E5B0GlrYmIqxJVH4nXbGJC3FUUYpQU4kbskng6q+8zGvrLLPL24OfAaCRex qvym7z4RbADoTf2o41Yup3LRM3ohlJE+wFwH5lZZTY0gc47CUYAAAlZCoy7D/rp+f1CJ j3dM12emEFLvCQyX9WXC46kLDhXKXd3e5sfcWpztJA2z8YAtQpVAQHnO0bU+eKDGuY+H PtqfSV59kj0440HW4lRrEiQvhnNXIOQFCCd+ywV4CTBm9fcrwXAKvXfyM0gw9amsvM8+ yi5Q== X-Gm-Message-State: AOAM532dK9TJmpAFes1olkp4vg4aXTchVQq8OTvhjoWf5seSOG0OQuwB hkhas3I+yie9I25CDeRO2bUSg8/X/TqIq3xTn/awpt/08NM= X-Google-Smtp-Source: ABdhPJwnDh6h/HQC7r8ECN2kMl1A5naXWXmteATCWcZRI+ld3ICYDNnUX3sodUvtiMJLICUSdUkrxnhG4N/NM+JxvfA= X-Received: by 2002:a17:90a:d3cd:: with SMTP id d13mr1018700pjw.70.1601100952079; Fri, 25 Sep 2020 23:15:52 -0700 (PDT) MIME-Version: 1.0 From: Prafulla Giri Date: Sat, 26 Sep 2020 12:00:40 +0545 Message-ID: Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=pratheblackdiamond@gmail.com; helo=mail-pl1-x635.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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. 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)