unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
blob 9e889732415e26b2710a2c4de1f859cfc356afc3 2047 bytes (raw)
name: gnu/packages/patches/audacity-ffmpeg-fallback.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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.

---
 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


debug log:

solving 9e88973241 ...
found 9e88973241 in https://yhetil.org/guix-bugs/febdceadf292d4565cafcbfec95817e52cf81572.camel@gmail.com/

applying [1/1] https://yhetil.org/guix-bugs/febdceadf292d4565cafcbfec95817e52cf81572.camel@gmail.com/
diff --git a/gnu/packages/patches/audacity-ffmpeg-fallback.patch b/gnu/packages/patches/audacity-ffmpeg-fallback.patch
new file mode 100644
index 0000000000..9e88973241

1:22: trailing whitespace.
 
1:28: trailing whitespace.
 
1:32: trailing whitespace.
 
1:49: trailing whitespace.
 
1:65: trailing whitespace.
-- 
Checking patch gnu/packages/patches/audacity-ffmpeg-fallback.patch...
Applied patch gnu/packages/patches/audacity-ffmpeg-fallback.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

index at:
100644 9e889732415e26b2710a2c4de1f859cfc356afc3	gnu/packages/patches/audacity-ffmpeg-fallback.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).