summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2022-01-29 18:54:54 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2022-01-30 08:11:00 +0100
commit6589966b976764e2a197e2bf2b847592dc8715a7 (patch)
treefd3c26ad1e3d308569cde5b0aee4a3c07b38e707 /gnu/packages/patches
parent090e92581611bab97cfdc0b45cc224a3b3736beb (diff)
downloadguix-patches-6589966b976764e2a197e2bf2b847592dc8715a7.tar
guix-patches-6589966b976764e2a197e2bf2b847592dc8715a7.tar.gz
gnu: audacity: Add fallback to locate ffmpeg via pkg-config.base-for-series-11189
* 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. [inputs]: Add back ffmpeg.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/audacity-ffmpeg-fallback.patch66
1 files changed, 66 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..d570d8f605
--- /dev/null
+++ b/gnu/packages/patches/audacity-ffmpeg-fallback.patch
@@ -0,0 +1,66 @@
+From 3c20057d0cbbbed453a692d4dd4589d865808024 Mon Sep 17 00:00:00 2001
+From: Liliana Marie Prikler <liliana.prikler@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>.
+---
+ libraries/lib-ffmpeg-support/CMakeLists.txt | 8 ++++++++
+ libraries/lib-ffmpeg-support/FFmpegFunctions.cpp | 12 ++++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/libraries/lib-ffmpeg-support/CMakeLists.txt b/libraries/lib-ffmpeg-support/CMakeLists.txt
+index 8c5f06d7c..00810e4d0 100644
+--- a/libraries/lib-ffmpeg-support/CMakeLists.txt
++++ b/libraries/lib-ffmpeg-support/CMakeLists.txt
+@@ -1,5 +1,7 @@
+
+ if (${_OPT}use_ffmpeg)
++ pkg_check_modules(FFMPEG libavcodec libavformat libavutil)
++
+ set( SOURCES
+ FFmpegTypes.h
+
+@@ -100,6 +102,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=L\"${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 66d085a0b..4eeb4aed3 100644
+--- a/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp
++++ b/libraries/lib-ffmpeg-support/FFmpegFunctions.cpp
+@@ -238,6 +238,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
++
+ // Loading has failed.
+ // wxLogSysError doesn't report errors correctly on *NIX
+ #if defined(_WIN32)
+--
+2.34.0
+