summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/audacity-ffmpeg-fallback.patch
diff options
context:
space:
mode:
authorLeo Famulari <[email protected]>2025-03-02 12:47:32 -0500
committerLeo Famulari <[email protected]>2025-03-02 12:53:58 -0500
commit56a374aa79fd93a90373417b9a33b27dda633449 (patch)
tree00227027dcf53fefea4cef81285c4da5348af657 /gnu/packages/patches/audacity-ffmpeg-fallback.patch
parent48f5a666b540cc35c0922b0dde0588f85f573cab (diff)
gnu: Audacity: Downgrade to 3.5.1.
The update to Audacity 3.6.0 broke the ability to lookup FFmpeg and open a variety of file types This problem was raised in the patch ticket but ignored for some reason. See further discussion in the patch ticket: https://issues.guix.gnu.org/75200 This reverts commits 8a4d05501fc4f69c12af3ee324c627501a6a1507 and af85cfa45e806d9ed3cea9c3d30ac782d3914e1d. Change-Id: Iff388431180874db198154b2e8b126e473b757b0
Diffstat (limited to 'gnu/packages/patches/audacity-ffmpeg-fallback.patch')
-rw-r--r--gnu/packages/patches/audacity-ffmpeg-fallback.patch61
1 files changed, 61 insertions, 0 deletions
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 <[email protected]>
+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 <[email protected]>
+
+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 {};
+ }
+ };