From f58cbafc3d3108fcf5519f76929a1b6ce3bff21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Tue, 19 Oct 2021 11:07:09 +0200 Subject: [PATCH] eclass/bintron.eclass: enable use of system-ffmpeg and system-vulkan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maciej Barć --- eclass/bintron.eclass | 26 ++++++++++++++++++++++++++ profiles/use.desc | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 profiles/use.desc diff --git a/eclass/bintron.eclass b/eclass/bintron.eclass index 2abd4dc..8064d4c 100644 --- a/eclass/bintron.eclass +++ b/eclass/bintron.eclass @@ -111,9 +111,13 @@ BINTRON_DEPEND=" x11-libs/gtk+:3[X] x11-libs/libxkbcommon x11-libs/pango + system-ffmpeg? ( >=media-video/ffmpeg-4.3[chromium] ) + system-vulkan? ( media-libs/vulkan-loader ) " RDEPEND+="${BINTRON_DEPEND}" +IUSE+=" +system-ffmpeg +system-vulkan " + # The package will be already compiled, # also most likely the package will be pre-stripped too. @@ -167,12 +171,34 @@ function bintron_remove_language_paks() { } +# @FUNCTION: bintron_system_replace +# @DESCRIPTION: +# Replace bundled libraries with system libraries. +function bintron_system_replace() { + if use system-ffmpeg; then + echo "Replacing bundled libffmpeg" + rm ./libffmpeg.so || + die "Failed: remove bundled libffmpeg" + ln -s "${EROOT}"/usr/lib64/chromium/libffmpeg.so . || + die "Failed: link libffmpeg" + fi + if use system-vulkan; then + echo "Replacing bundled libvulkan" + rm ./libvulkan.so.1 || + die "Failed: remove bundled libvulkan" + ln -s "${EROOT}"/usr/lib64/libvulkan.so.1 . || + die "Failed: link libvulkan" + fi +} + + # @FUNCTION: bintron_src_prepare # @DESCRIPTION: # Default src_prepare. function bintron_src_prepare() { xdg_src_prepare bintron_remove_language_paks + bintron_system_replace } diff --git a/profiles/use.desc b/profiles/use.desc new file mode 100644 index 0000000..7e4bf38 --- /dev/null +++ b/profiles/use.desc @@ -0,0 +1,6 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + + +system-ffmpeg - Use the system-wide media-video/ffmpeg instead of bundled +system-vulkan - Use the system-wide media-libs/vulkan-loader instead of bundled