From 3c20057d0cbbbed453a692d4dd4589d865808024 Mon Sep 17 00:00:00 2001 From: Liliana Marie Prikler 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 . Bugs-added-by: Marius Bakke 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(fullName); + + if (library->IsLoaded()) + return library; + } +#endif + return {}; } }; 311a68'>root/etc/system-tests.scm
AgeCommit message (Expand)Author
2022-08-09build-system: Add 'channel-build-system'....* gnu/ci.scm (channel-build-system, channel-source->package): Remove. * gnu/packages/package-management.scm (channel-source->package): New procedure, moved from (gnu ci). * guix/build-system/channel.scm: New file, with code moved from (gnu ci). * doc/guix.texi (Build Systems): Document it. Ludovic Courtès
2022-07-10monads: Add 'mparameterize'....* etc/system-tests.scm (mparameterize): Move to... * guix/monads.scm (mparameterize): ... here. * tests/monads.scm ("mparameterize"): New test. * .dir-locals.el (c-mode): Add it. Ludovic Courtès
2022-04-11tests: System tests really parameterize 'current-guix-package'....Until now, 'current-guix-package' was parameterized in the wrong context. Thus, 'current-guix' would end up building a variant of the 'guix' package instead of the package returned by 'channel-source->package', which is much less expensive to build. * etc/system-tests.scm (mparameterize): New macro. (tests-for-current-guix): Change the 'value' field of each <system-test> record to parameterize 'current-guix-package' for good. Ludovic Courtès