guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/10: gnu: audacity: Re-add fallback to locate ffmpeg via pkg-config.


From: guix-commits
Subject: 04/10: gnu: audacity: Re-add fallback to locate ffmpeg via pkg-config.
Date: Fri, 31 May 2024 07:57:47 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 0e5e032d1288923c67406036df975674d8487e9e
Author: Kaelyn Takata <kaelyn.alexi@protonmail.com>
AuthorDate: Tue May 28 17:33:44 2024 +0000

    gnu: audacity: Re-add fallback to locate ffmpeg via pkg-config.
    
    This reintroduces the patch that was deleted by
    cf5f7a8bf9ca2288700fcf351bbca0fc341ec969, adjusting file names.
    
    * 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
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/local.mk                                       |  1 +
 gnu/packages/audio.scm                             |  1 +
 .../patches/audacity-ffmpeg-fallback.patch         | 61 ++++++++++++++++++++++
 3 files changed, 63 insertions(+)

diff --git a/gnu/local.mk b/gnu/local.mk
index 7a33ade350..188b471f6c 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 @@ engineers, musicians, soundtrack editors and composers.")
        (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@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@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 {};
+    }
+ };



reply via email to

[Prev in Thread] Current Thread [Next in Thread]