From b3f96499c112618ec301a4852f24b8b8be123d3a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 13 Mar 2025 00:28:24 +0000 Subject: gentoo auto-resync : 13:03:2025 - 00:28:24 --- eclass/Manifest.gz | Bin 40356 -> 40351 bytes eclass/ffmpeg-compat.eclass | 24 +++++++++++++++++++++++- eclass/toolchain.eclass | 18 +++++++++--------- 3 files changed, 32 insertions(+), 10 deletions(-) (limited to 'eclass') diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz index c9a08dc1e62d..3b229ca674b7 100644 Binary files a/eclass/Manifest.gz and b/eclass/Manifest.gz differ diff --git a/eclass/ffmpeg-compat.eclass b/eclass/ffmpeg-compat.eclass index f91fe6eead31..1835a8c7e95a 100644 --- a/eclass/ffmpeg-compat.eclass +++ b/eclass/ffmpeg-compat.eclass @@ -12,7 +12,8 @@ # To use this, run ``ffmpeg_compat_setup `` before packages use # pkg-config, depend on media-video/ffmpeg-compat:=, and ensure # usage of both pkg-config --cflags and --libs (which adds -Wl,-rpath -# to find libraries at runtime). +# to find libraries at runtime). Always verify that it is linked with +# the right libraries after. # # This eclass is intended as a quick-to-setup alternative to setting # an upper bound on ffmpeg for packages broken with the latest version, @@ -41,6 +42,27 @@ esac if [[ -z ${_FFMPEG_COMPAT_ECLASS} ]]; then _FFMPEG_COMPAT_ECLASS=1 +inherit flag-o-matic toolchain-funcs + +# @FUNCTION: ffmpeg_compat_add_flags +# @DESCRIPTION: +# Append ``pkg-config --cflags libavcodec`` to CPPFLAGS and +# --libs-only-{L,other} to LDFLAGS for the current ABI. +# +# Must run ``ffmpeg_compat_setup `` first. +# +# Ideally this function should not be used, but can be useful when +# packages do not use pkg-config properly or drop some flags (common +# with cmake). +# +# For multilib, ebuild should preserve previous flags by doing e.g. +# ``local -x CPPFLAGS=${CPPFLAGS} LDFLAGS=${LDFLAGS}`` first. +ffmpeg_compat_add_flags() { + # should be no real need to check anything but libavcodec's flags + append-cppflags $($(tc-getPKG_CONFIG) --cflags libavcodec || die) + append-ldflags $($(tc-getPKG_CONFIG) --libs-only-{L,other} libavcodec || die) +} + # @FUNCTION: ffmpeg_compat_get_prefix # @USAGE: # @DESCRIPTION: diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 2d479c9c7267..e365269d1c18 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -429,15 +429,15 @@ if [[ ${PN} != gnat-gpl ]] && tc_has_feature ada ; then ) " else - BDEPEND+=" - ada? ( - || ( - sys-devel/gcc:${SLOT}[ada] -