GNU bug report logs - #71246
[PATCH] gnu: audacity: Re-add fallback to locate ffmpeg via pkg-config.

Previous Next

Package: guix-patches;

Reported by: Kaelyn Takata <kaelyn.alexi <at> protonmail.com>

Date: Tue, 28 May 2024 17:35:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71246 in the body.
You can then email your comments to 71246 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#71246; Package guix-patches. (Tue, 28 May 2024 17:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kaelyn Takata <kaelyn.alexi <at> protonmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 28 May 2024 17:35:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kaelyn Takata <kaelyn.alexi <at> protonmail.com>
To: guix-patches <at> gnu.org
Cc: Kaelyn Takata <kaelyn.alexi <at> protonmail.com>
Subject: [PATCH] gnu: audacity: Re-add fallback to locate ffmpeg via
 pkg-config.
Date: Tue, 28 May 2024 17:33:44 +0000
* gnu/packages/patches/audacity-ffmpeg-fallback.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it here.
* gnu/packages/audio.scm (audacity)[patches]: Use it here.

Change-Id: I848df8a9762216eb2b02afc3843e0e9806db14be
---
 gnu/local.mk                                  |  1 +
 gnu/packages/audio.scm                        |  1 +
 .../patches/audacity-ffmpeg-fallback.patch    | 61 +++++++++++++++++++
 3 files changed, 63 insertions(+)
 create mode 100644 gnu/packages/patches/audacity-ffmpeg-fallback.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7e9e1ebcf0..a5f2b9ee9e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -960,6 +960,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ath9k-htc-firmware-gcc.patch		\
   %D%/packages/patches/ath9k-htc-firmware-gcc-compat.patch	\
   %D%/packages/patches/atlas-gfortran-compat.patch		\
+  %D%/packages/patches/audacity-ffmpeg-fallback.patch	\
   %D%/packages/patches/audiofile-fix-datatypes-in-tests.patch	\
   %D%/packages/patches/audiofile-fix-sign-conversion.patch	\
   %D%/packages/patches/audiofile-CVE-2015-7747.patch		\
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index d30d561d2f..f5c8dbd151 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -934,6 +934,7 @@ (define-public audacity
        (file-name (git-file-name name version))
        (sha256
         (base32 "11sjyz6hxsr5dnndkkkiq7arjxvjl1sycl151xq3a3ggakgql3y1"))
+       (patches (search-patches "audacity-ffmpeg-fallback.patch"))
        (modules '((guix build utils)))
        (snippet
         ;; Remove bundled libraries.
diff --git a/gnu/packages/patches/audacity-ffmpeg-fallback.patch b/gnu/packages/patches/audacity-ffmpeg-fallback.patch
new file mode 100644
index 0000000000..c845e10277
--- /dev/null
+++ b/gnu/packages/patches/audacity-ffmpeg-fallback.patch
@@ -0,0 +1,61 @@
+From 3c20057d0cbbbed453a692d4dd4589d865808024 Mon Sep 17 00:00:00 2001
+From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
+Date: Sat, 29 Jan 2022 10:44:44 +0100
+Subject: [PATCH] Add pkg-config fallback for locating ffmpeg.
+
+Audacity >=3.1.0 no longer links against ffmpeg, but instead dynamically loads
+it.  This dynamic loading mechanism fails to properly locate libraries outside
+of LD_LIBRARY_PATH.
+
+See <https://issues.guix.gnu.org/53591>.
+
+Bugs-added-by: Marius Bakke <marius <at> gnu.org>
+
+diff --git a/libraries/lib-ffmpeg-support/CMakeLists.txt b/libraries/lib-ffmpeg-support/CMakeLists.txt
+index b8803a1f5..f86559cca 100644
+--- a/modules/mod-ffmpeg/lib-ffmpeg-support/CMakeLists.txt
++++ b/modules/mod-ffmpeg/lib-ffmpeg-support/CMakeLists.txt
+@@ -1,5 +1,7 @@
+
+ if (${_OPT}use_ffmpeg)
++   pkg_check_modules(FFMPEG libavcodec libavformat libavutil)
++
+    set( SOURCES
+       FFmpegTypes.h
+
+@@ -107,6 +109,12 @@ if (${_OPT}use_ffmpeg)
+       list(APPEND DEFINITIONS PRIVATE _DARWIN_C_SOURCE )
+    endif()
+
++   if (FFMPEG_FOUND)
++      pkg_get_variable(LIBAVCODEC_LIBDIR libavcodec libdir)
++      list(APPEND DEFINITIONS PRIVATE
++                  "-DFFMPEG_PC_LIBDIR=\"${LIBAVCODEC_LIBDIR}\"")
++   endif()
++
+    audacity_library( lib-ffmpeg-support "${SOURCES}" "${LIBRARIES}"
+       "${DEFINITIONS}" ""
+    )
+diff --git a/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp b/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp
+index 55d6f676b..46640ef83 100644
+--- a/modules/mod-ffmpeg/lib-ffmpeg-support/FFmpegFunctions.cpp
++++ b/modules/mod-ffmpeg/lib-ffmpeg-support/FFmpegFunctions.cpp
+@@ -246,6 +246,18 @@ struct FFmpegFunctions::Private final
+       if (library->IsLoaded())
+          return library;
+
++#if defined(FFMPEG_PC_LIBDIR)
++      {
++         static const wxString libdir{FFMPEG_PC_LIBDIR};
++         const wxString fullName = wxFileName(libdir, libraryName).GetFullPath();
++
++         auto library = std::make_shared<wxDynamicLibrary>(fullName);
++
++         if (library->IsLoaded())
++            return library;
++      }
++#endif
++
+       return {};
+    }
+ };

base-commit: 542b18709a46e361de8f25e3fece29860532743c
-- 
2.41.0






Information forwarded to guix-patches <at> gnu.org:
bug#71246; Package guix-patches. (Tue, 28 May 2024 17:46:01 GMT) Full text and rfc822 format available.

Message #8 received at 71246 <at> debbugs.gnu.org (full text, mbox):

From: Kaelyn <kaelyn.alexi <at> protonmail.com>
To: "71246 <at> debbugs.gnu.org" <71246 <at> debbugs.gnu.org>,
 "atai <at> atai.org" <atai <at> atai.org>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [PATCH] gnu: audacity: Re-add fallback to locate ffmpeg via
 pkg-config.
Date: Tue, 28 May 2024 17:44:44 +0000
Hi,

This patch re-introduces the gnu/packages/patches/audacity-ffmpeg-fallback.patch that was deleted by commit cf5f7a8bf9ca2288700fcf351bbca0fc341ec969, which upgraded audacity to 3.5.1. The issue with it applying to the new audacity version is that the "lib-ffmpeg-support" folder moved from under "libraries/" to be under "modules/mod-ffmpeg/"; I have simply restored the existing patch and fixed the paths to the files.

Starting with the upgrade to audacity 3.5.1 with the patch dropped, any file that depended on ffmpeg to be loaded--such as the .m4a files produced by the recording app on an Android phone--fails to load. I also tried setting the path to the ffmpeg library through the GUI and had it consistently fail for me, and such files still could not be loaded (I have a few screenshots of the error messages). Restoring this patch has restored the ability to load .m4a and other files which depend on ffmpeg to be loaded, and without any special hoops needed to set up ffmpeg through the UI first.

Cheers,
Kaelyn




Information forwarded to guix-patches <at> gnu.org:
bug#71246; Package guix-patches. (Tue, 28 May 2024 19:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 71246 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: Kaelyn <kaelyn.alexi <at> protonmail.com>
Cc: "71246 <at> debbugs.gnu.org" <71246 <at> debbugs.gnu.org>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [PATCH] gnu: audacity: Re-add fallback to locate ffmpeg via
 pkg-config.
Date: Tue, 28 May 2024 11:58:23 -0700
Please go ahead and file Guix package definition patch to restore the
deleted ffmpeg patch

On Tue, May 28, 2024 at 10:44 AM Kaelyn <kaelyn.alexi <at> protonmail.com> wrote:
>
> Hi,
>
> This patch re-introduces the gnu/packages/patches/audacity-ffmpeg-fallback.patch that was deleted by commit cf5f7a8bf9ca2288700fcf351bbca0fc341ec969, which upgraded audacity to 3.5.1. The issue with it applying to the new audacity version is that the "lib-ffmpeg-support" folder moved from under "libraries/" to be under "modules/mod-ffmpeg/"; I have simply restored the existing patch and fixed the paths to the files.
>
> Starting with the upgrade to audacity 3.5.1 with the patch dropped, any file that depended on ffmpeg to be loaded--such as the .m4a files produced by the recording app on an Android phone--fails to load. I also tried setting the path to the ffmpeg library through the GUI and had it consistently fail for me, and such files still could not be loaded (I have a few screenshots of the error messages). Restoring this patch has restored the ability to load .m4a and other files which depend on ffmpeg to be loaded, and without any special hoops needed to set up ffmpeg through the UI first.
>
> Cheers,
> Kaelyn




Information forwarded to guix-patches <at> gnu.org:
bug#71246; Package guix-patches. (Tue, 28 May 2024 19:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 71246 <at> debbugs.gnu.org (full text, mbox):

From: Kaelyn <kaelyn.alexi <at> protonmail.com>
To: Andy Tai <atai <at> atai.org>
Cc: "71246 <at> debbugs.gnu.org" <71246 <at> debbugs.gnu.org>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [PATCH] gnu: audacity: Re-add fallback to locate ffmpeg via
 pkg-config.
Date: Tue, 28 May 2024 19:21:59 +0000
Hi,

On Tuesday, May 28th, 2024 at 11:58 AM, Andy Tai <atai <at> atai.org> wrote:

> 
> Please go ahead and file Guix package definition patch to restore the
> deleted ffmpeg patch

I apologize for not being clearer and including a proper reference; by "this patch", I meant https://issues.guix.gnu.org/71246.

Thanks,
Kaelyn

> On Tue, May 28, 2024 at 10:44 AM Kaelyn kaelyn.alexi <at> protonmail.com wrote:
> 
> > Hi,
> > 
> > This patch re-introduces the gnu/packages/patches/audacity-ffmpeg-fallback.patch that was deleted by commit cf5f7a8bf9ca2288700fcf351bbca0fc341ec969, which upgraded audacity to 3.5.1. The issue with it applying to the new audacity version is that the "lib-ffmpeg-support" folder moved from under "libraries/" to be under "modules/mod-ffmpeg/"; I have simply restored the existing patch and fixed the paths to the files.
> > 
> > Starting with the upgrade to audacity 3.5.1 with the patch dropped, any file that depended on ffmpeg to be loaded--such as the .m4a files produced by the recording app on an Android phone--fails to load. I also tried setting the path to the ffmpeg library through the GUI and had it consistently fail for me, and such files still could not be loaded (I have a few screenshots of the error messages). Restoring this patch has restored the ability to load .m4a and other files which depend on ffmpeg to be loaded, and without any special hoops needed to set up ffmpeg through the UI first.
> > 
> > Cheers,
> > Kaelyn




Information forwarded to guix-patches <at> gnu.org:
bug#71246; Package guix-patches. (Wed, 29 May 2024 06:05:01 GMT) Full text and rfc822 format available.

Message #17 received at 71246 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: 71246 <at> debbugs.gnu.org
Date: Tue, 28 May 2024 23:02:43 -0700
patch builds fine on x86-64




Information forwarded to guix-patches <at> gnu.org:
bug#71246; Package guix-patches. (Wed, 29 May 2024 20:33:01 GMT) Full text and rfc822 format available.

Message #20 received at 71246 <at> debbugs.gnu.org (full text, mbox):

From: Andy Tai <atai <at> atai.org>
To: 71246 <at> debbugs.gnu.org
Subject: Fwd:
Date: Wed, 29 May 2024 13:30:07 -0700
user guix
usertag 71246 + reviewed-looks-good
thanks

Guix QA review form submission:


Items marked as checked: Package builds, Commit messages




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 31 May 2024 11:39:01 GMT) Full text and rfc822 format available.

Notification sent to Kaelyn Takata <kaelyn.alexi <at> protonmail.com>:
bug acknowledged by developer. (Fri, 31 May 2024 11:39:01 GMT) Full text and rfc822 format available.

Message #25 received at 71246-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Kaelyn Takata <kaelyn.alexi <at> protonmail.com>
Cc: 71246-done <at> debbugs.gnu.org
Subject: Re: [bug#71246] [PATCH] gnu: audacity: Re-add fallback to locate
 ffmpeg via pkg-config.
Date: Fri, 31 May 2024 13:35:47 +0200
Kaelyn Takata <kaelyn.alexi <at> protonmail.com> skribis:

> * gnu/packages/patches/audacity-ffmpeg-fallback.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it here.
> * gnu/packages/audio.scm (audacity)[patches]: Use it here.
>
> Change-Id: I848df8a9762216eb2b02afc3843e0e9806db14be

Hi! I added some of the info from your second message to the commit log
and committed.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 29 Jun 2024 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.