From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 53591@debbugs.gnu.org
Subject: bug#53591: [PATCH] gnu: audacity: Add fallback to locate ffmpeg via pkg-config.
Date: Sat, 29 Jan 2022 18:54:54 +0100 [thread overview]
Message-ID: <febdceadf292d4565cafcbfec95817e52cf81572.camel@gmail.com> (raw)
In-Reply-To: <YfMnVq2mHSFFzVv0@jasmine.lan>
* 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.
---
gnu/local.mk | 1 +
gnu/packages/audio.scm | 2 +
.../patches/audacity-ffmpeg-fallback.patch | 61 +++++++++++++++++++
3 files changed, 64 insertions(+)
create mode 100644 gnu/packages/patches/audacity-ffmpeg-fallback.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 96e6cb08f4..898e8e92e3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -859,6 +859,7 @@ dist_patch_DATA = \
%D%/packages/patches/ath9k-htc-firmware-gcc-compat.patch \
%D%/packages/patches/ath9k-htc-firmware-objcopy.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 feccf662b0..22dd88ef0c 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -738,6 +738,7 @@ (define-public audacity
(sha256
(base32
"189agx11361k9j958s6q5bngnnfx0rwaf0dwbjxy6fwvsb1wv3px"))
+ (patches (search-patches "audacity-ffmpeg-fallback.patch"))
(modules '((guix build utils)))
(snippet
;; Remove bundled libraries.
@@ -768,6 +769,7 @@ (define-public audacity
lame
linux-libre-headers
flac
+ ffmpeg
libid3tag
libjpeg-turbo
libmad
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
--- /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.
+
+---
+ 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
+
--
2.34.0
next prev parent reply other threads:[~2022-01-29 18:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-27 23:14 bug#53591: Audacity can't find FFmpeg Leo Famulari
2022-01-27 23:43 ` Leo Famulari
2022-01-28 3:21 ` Leo Famulari
2022-01-29 17:54 ` Liliana Marie Prikler [this message]
2022-01-29 19:53 ` bug#53591: [PATCH] gnu: audacity: Add fallback to locate ffmpeg via pkg-config Leo Famulari
2022-01-30 7:18 ` Liliana Marie Prikler
[not found] ` <handler.53591.D53591.1643527130607.notifdone@debbugs.gnu.org>
2022-02-04 22:32 ` bug#53591: closed (Re: [PATCH] gnu: audacity: Add fallback to locate ffmpeg via pkg-config.) Leo Famulari
2022-02-04 23:49 ` Leo Famulari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=febdceadf292d4565cafcbfec95817e52cf81572.camel@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=53591@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).