diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-11-06 05:54:40 -0500 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-11-07 14:27:56 -0500 |
commit | 9cdc7c96e725f66601c24233b332eeee68e1da84 (patch) | |
tree | 3faecfadba67e12994f595c8e70d0baf0967164e /media-libs/libplacebo | |
parent | media-libs/mesa: Version bump to 22.2.3 (diff) | |
download | gentoo-9cdc7c96e725f66601c24233b332eeee68e1da84.tar.gz gentoo-9cdc7c96e725f66601c24233b332eeee68e1da84.tar.bz2 gentoo-9cdc7c96e725f66601c24233b332eeee68e1da84.zip |
media-libs/libplacebo: add 5.229.1
With partly revamped ebuild, and:
* ensure use right python executble wrt bug #731728
* disable demos wrt bug #851927, there's little use in enabling
as only one of them gets installed by default and it's a very
barebone test video player
USE=glslang is now a no-op if shaderc is set, these provide
the same functionality and shaderc is the default pick upstream.
Previously, glslang would force disable shaderc even if set.
Alternatively could use REQUIRED_USE to prevent setting both
but feel this is mostly an annoyance.
Closes: https://bugs.gentoo.org/731728
Closes: https://bugs.gentoo.org/851927
Co-authored-by: Nick Sarnie <sarnex@gentoo.org>
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'media-libs/libplacebo')
5 files changed, 125 insertions, 0 deletions
diff --git a/media-libs/libplacebo/Manifest b/media-libs/libplacebo/Manifest index bee8111e1bb7..bb6d95b7a8aa 100644 --- a/media-libs/libplacebo/Manifest +++ b/media-libs/libplacebo/Manifest @@ -1 +1,3 @@ +DIST libplacebo-glad-2.0.2.tar.gz 581059 BLAKE2B ce7f63ac1f9a6263d3de3f9c56f4a47b8bbdd1ac7eba875c7ad807ae923c8a82d7f323725af8b64adbbc30c2e014c6a5ed8b3325b7f15984222075874a68c0cf SHA512 c719bcd7a0aaa56d89158c9f347410b9e66466fb957a5a5f201b4cce21a0c1589d6d2a866e12134ed43435a5567d842fbfd134559dea1ca59a34b079ff6f5d37 DIST libplacebo-v4.192.1.tar.gz 632762 BLAKE2B 19a3bee6f05632cde1739fe8c861c96035a7b1f5ed2af6bbc67776529551c88f5da63d49dede2d7ee2c8d96edd6faf733e0371714028b72eddcf4c4cf23b937f SHA512 780dff60a31a9c7fff47522385235077cc6b1a38be32bc0276c090d89ce25754dd0b910db5be631d0065337fe4700f68adabee06f48a4935d422f09f2e0e5525 +DIST libplacebo-v5.229.1.tar.gz 673121 BLAKE2B 0a59e16b4565b10b222c5a5a8e607670bd4010a2be9b99ebdc15638827fcaf21bbf3c16a3cd2b902bcef43041dec56441494a0f618094e14db8f99a9d314c621 SHA512 45efb252d5d44e5429790f9024b1b2a153051d6d604b07fcf3e4de7d49a2e91d20457be76e08b3b9ab43248c4a2e7268c9f8dc69837783e572f9b8735c955334 diff --git a/media-libs/libplacebo/files/libplacebo-5.229.1-llvm-libunwind.patch b/media-libs/libplacebo/files/libplacebo-5.229.1-llvm-libunwind.patch new file mode 100644 index 000000000000..a1f0aaa2b806 --- /dev/null +++ b/media-libs/libplacebo/files/libplacebo-5.229.1-llvm-libunwind.patch @@ -0,0 +1,9 @@ +llvm-libunwind does not have cmake nor pkg-config files, not great +but switch to cc.find for simplicity with meson feature-type options +--- a/src/meson.build ++++ b/src/meson.build +@@ -1,3 +1,3 @@ + ### Common dependencies +-unwind = dependency('libunwind', required: get_option('unwind')) ++unwind = cc.find_library('libunwind', required: get_option('unwind')) + libexecinfo = cc.find_library('execinfo', required: false) diff --git a/media-libs/libplacebo/files/libplacebo-5.229.1-python-executable.patch b/media-libs/libplacebo/files/libplacebo-5.229.1-python-executable.patch new file mode 100644 index 000000000000..35486262c992 --- /dev/null +++ b/media-libs/libplacebo/files/libplacebo-5.229.1-python-executable.patch @@ -0,0 +1,11 @@ +Upstream bundles python deps and uses same interpreter as meson, +but we don't and need this to use the eclass' python3 instead. + +https://bugs.gentoo.org/731728 +--- a/meson.build ++++ b/meson.build +@@ -323,3 +323,3 @@ + thirdparty = meson.project_source_root()/'3rdparty' +-python = import('python').find_installation() ++python = import('python').find_installation('python3') + python_env = environment() diff --git a/media-libs/libplacebo/files/libplacebo-5.229.1-shared-glslang.patch b/media-libs/libplacebo/files/libplacebo-5.229.1-shared-glslang.patch new file mode 100644 index 000000000000..14ce1f6972c0 --- /dev/null +++ b/media-libs/libplacebo/files/libplacebo-5.229.1-shared-glslang.patch @@ -0,0 +1,12 @@ +OSDependent and OGLCompiler are already included in the shared libglslang, +and glslang-1.3.231 normally does not install these with shared builds. +--- a/src/glsl/meson.build ++++ b/src/glsl/meson.build +@@ -21,5 +21,5 @@ + cxx.find_library('MachineIndependent', required: false), +- cxx.find_library('OSDependent', required: glslang_req), ++ cxx.find_library('OSDependent', required: false), + cxx.find_library('HLSL', required: glslang_req), +- cxx.find_library('OGLCompiler', required: glslang_req), ++ cxx.find_library('OGLCompiler', required: false), + cxx.find_library('GenericCodeGen', required: false), diff --git a/media-libs/libplacebo/libplacebo-5.229.1.ebuild b/media-libs/libplacebo/libplacebo-5.229.1.ebuild new file mode 100644 index 000000000000..305607263956 --- /dev/null +++ b/media-libs/libplacebo/libplacebo-5.229.1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +inherit meson-multilib python-any-r1 + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://code.videolan.org/videolan/libplacebo.git" + inherit git-r3 +else + GLAD_PV=2.0.2 + SRC_URI=" + https://code.videolan.org/videolan/libplacebo/-/archive/v${PV}/libplacebo-v${PV}.tar.gz + opengl? ( https://github.com/Dav1dde/glad/archive/refs/tags/v${GLAD_PV}.tar.gz -> ${PN}-glad-${GLAD_PV}.tar.gz )" + S="${WORKDIR}/${PN}-v${PV}" + KEYWORDS="~amd64 ~ppc64 ~x86" +fi + +DESCRIPTION="Reusable library for GPU-accelerated image processing primitives" +HOMEPAGE="https://code.videolan.org/videolan/libplacebo/" + +LICENSE="LGPL-2.1+ opengl? ( MIT )" +SLOT="0/$(ver_cut 2 ${PV}.9999)" # soname +IUSE="glslang lcms llvm-libunwind +opengl +shaderc test unwind +vulkan" +RESTRICT="!test? ( test )" +REQUIRED_USE="vulkan? ( || ( glslang shaderc ) )" + +# libglvnd is used with dlopen() through glad (inc. egl/gles) +RDEPEND=" + lcms? ( media-libs/lcms:2[${MULTILIB_USEDEP}] ) + opengl? ( media-libs/libglvnd[${MULTILIB_USEDEP}] ) + shaderc? ( media-libs/shaderc[${MULTILIB_USEDEP}] ) + !shaderc? ( glslang? ( dev-util/glslang:=[${MULTILIB_USEDEP}] ) ) + unwind? ( + llvm-libunwind? ( sys-libs/llvm-libunwind[${MULTILIB_USEDEP}] ) + !llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] ) + ) + vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )" +DEPEND=" + ${RDEPEND} + vulkan? ( dev-util/vulkan-headers )" +BDEPEND=" + virtual/pkgconfig + vulkan? ( $(python_gen_any_dep 'dev-python/jinja[${PYTHON_USEDEP}]') )" + +PATCHES=( + "${FILESDIR}"/${PN}-5.229.1-llvm-libunwind.patch + "${FILESDIR}"/${PN}-5.229.1-python-executable.patch + "${FILESDIR}"/${PN}-5.229.1-shared-glslang.patch +) + +python_check_deps() { + python_has_version "dev-python/jinja[${PYTHON_USEDEP}]" +} + +pkg_setup() { + use vulkan && python-any-r1_pkg_setup +} + +src_unpack() { + if [[ ${PV} == 9999 ]]; then + local EGIT_SUBMODULES=( $(usev opengl 3rdparty/glad) ) + git-r3_src_unpack + else + default + if use opengl; then + rmdir "${S}"/3rdparty/glad || die + mv glad-${GLAD_PV} "${S}"/3rdparty/glad || die + fi + fi +} + +multilib_src_configure() { + local emesonargs=( + -Ddemos=false #851927 + $(meson_use test tests) + $(meson_feature lcms) + $(meson_feature opengl) + $(meson_feature opengl gl-proc-addr) + $(meson_feature shaderc) + $(usex shaderc -Dglslang=disabled $(meson_feature glslang)) + $(meson_feature unwind) + $(meson_feature vulkan) + $(meson_feature vulkan vk-proc-addr) + -Dvulkan-registry="${ESYSROOT}"/usr/share/vulkan/registry/vk.xml + ) + + meson_src_configure +} |