unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: Tanguy Le Carrour <tanguy@bioneland.org>
Cc: 44275@debbugs.gnu.org
Subject: [bug#44275] [PATCH] gnu: Add python-pydub.
Date: Thu, 29 Oct 2020 17:50:53 -0400	[thread overview]
Message-ID: <20201029215053.GA11109@jasmine.lan> (raw)
In-Reply-To: <20201029141427.GB8956@jasmine.lan>

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

On Thu, Oct 29, 2020 at 10:14:27AM -0400, Leo Famulari wrote:
> Okay, I will take a look at the scipy thing today.

I decided to let scipy be propagated since it's normal for Python things
to be propagated. But I still think we should hard-code the reference to
ffmpeg.

I looked at the code, and it finds ffmpeg-related programs in
'pydub/utils.py', in the functions get_encoder_name(),
get_player_name(), and get_prober_name().

I think it should be sufficient to substitute any mention of the words
"ffmpeg", "ffplay", and "ffprobe" with the full store-path of those
programs.

I included a diff on your patch. You can see exactly what it does by
adding (error "Stopping...") after the substitute*, building with
--keep-failed, and then looking at the 'pydub/utils.py' file.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3c2d882003e..47ec542e6d1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16696,9 +16696,24 @@ ignoring formatting changes.")
          "0sfwfq7yjv4bl3yqbmizszscafvwf4zr40hzbsy7rclvzyznh333"))))
     (build-system python-build-system)
     (home-page "http://pydub.com")
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-ffmpeg-references
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((ffmpeg-store-item (assoc-ref inputs "ffmpeg"))
+                    (ffmpeg (string-append ffmpeg-store-item "/bin/ffmpeg"))
+                    (ffplay (string-append ffmpeg-store-item "/bin/ffplay"))
+                    (ffprobe (string-append ffmpeg-store-item "/bin/ffprobe")))
+               (substitute* "pydub/utils.py"
+                 (("ffmpeg") ffmpeg)
+                 (("ffplay") ffplay)
+                 (("ffprobe") ffprobe))
+               #t))))))
+    (inputs
+     `(("ffmpeg" ,ffmpeg)))
     (propagated-inputs
-     `(("ffmpeg" ,ffmpeg)
-       ("python-scipy" ,python-scipy)))
+     `(("python-scipy" ,python-scipy)))
     (synopsis "Manipulate audio with an simple and easy high level interface")
     (description
      "@code{pydub} makes it easy to manipulate audio.  It relies on

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2020-10-29 21:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  8:56 [bug#44275] [PATCH] gnu: Add python-pydub Tanguy Le Carrour
2020-10-28 16:34 ` Leo Famulari
2020-10-29  8:26   ` Tanguy Le Carrour
2020-10-29 14:14     ` Leo Famulari
2020-10-29 14:39       ` Tanguy Le Carrour
2020-10-29 21:50       ` Leo Famulari [this message]
2020-10-30  9:19         ` Tanguy Le Carrour
2020-10-30 20:42           ` Leo Famulari
2020-10-29  9:09 ` [bug#44275] [PATCH v2] " Tanguy Le Carrour
2020-10-30 20:40   ` bug#44275: " Leo Famulari
2020-10-30 21:10     ` [bug#44275] " Tanguy LE CARROUR

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201029215053.GA11109@jasmine.lan \
    --to=leo@famulari.name \
    --cc=44275@debbugs.gnu.org \
    --cc=tanguy@bioneland.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).