summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2023-07-09 08:15:28 +0200
committerMatt Turner <mattst88@gentoo.org>2023-07-12 10:54:29 -0400
commitb1d8ae959172390d0bd3a7646e9596efca080388 (patch)
tree0ad2cf1991d866867f60a8b620fc821bd7ccdb4d /media-libs/libepoxy
parentx11-wm/mutter: Version bump to 45_alpha (diff)
downloadgentoo-b1d8ae959172390d0bd3a7646e9596efca080388.tar.gz
gentoo-b1d8ae959172390d0bd3a7646e9596efca080388.tar.bz2
gentoo-b1d8ae959172390d0bd3a7646e9596efca080388.zip
media-libs/libepoxy: Correctly fallback to libOpenGL
Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Closes: https://github.com/gentoo/gentoo/pull/31808 Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'media-libs/libepoxy')
-rw-r--r--media-libs/libepoxy/files/libepoxy-1.5.10-libopengl-fallback.patch42
-rw-r--r--media-libs/libepoxy/libepoxy-1.5.10-r2.ebuild48
2 files changed, 90 insertions, 0 deletions
diff --git a/media-libs/libepoxy/files/libepoxy-1.5.10-libopengl-fallback.patch b/media-libs/libepoxy/files/libepoxy-1.5.10-libopengl-fallback.patch
new file mode 100644
index 000000000000..b36512631d03
--- /dev/null
+++ b/media-libs/libepoxy/files/libepoxy-1.5.10-libopengl-fallback.patch
@@ -0,0 +1,42 @@
+From 702a0e6639affa64881b9486bb8c866b9134a5cd Mon Sep 17 00:00:00 2001
+From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
+To: https://github.com/anholt/libepoxy/pull/259
+Date: Fri, 4 Jun 2021 06:35:23 +0200
+Subject: [PATCH] meson.build: Fallback from libGL to libOpenGL when GLX is
+ disabled
+
+---
+ meson.build | 3 +++
+ src/meson.build | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index e0228d1..95b5144 100644
+--- a/meson.build
++++ b/meson.build
+@@ -164,6 +164,9 @@ endif
+ # Dependencies
+ dl_dep = cc.find_library('dl', required: false)
+ gl_dep = dependency('gl', required: false)
++if not gl_dep.found() and not build_glx
++ gl_dep = dependency('opengl', required: false)
++endif
+ egl_dep = dependency('egl', required: false)
+
+ # Optional dependencies for tests
+diff --git a/src/meson.build b/src/meson.build
+index 37e28f0..11c4b54 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -93,7 +93,7 @@ libepoxy_dep = declare_dependency(
+ # pkg-config file, for consumers of Epoxy
+ gl_reqs = []
+ if gl_dep.found() and gl_dep.type_name() == 'pkgconfig'
+- gl_reqs += 'gl'
++ gl_reqs += gl_dep.name()
+ endif
+ if build_egl and egl_dep.found() and egl_dep.type_name() == 'pkgconfig'
+ gl_reqs += 'egl'
+--
+2.35.1
+
diff --git a/media-libs/libepoxy/libepoxy-1.5.10-r2.ebuild b/media-libs/libepoxy/libepoxy-1.5.10-r2.ebuild
new file mode 100644
index 000000000000..2bb7e5c4c156
--- /dev/null
+++ b/media-libs/libepoxy/libepoxy-1.5.10-r2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_REQ_USE='xml(+)'
+inherit meson-multilib python-any-r1 virtualx
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="https://github.com/anholt/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/anholt/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+DESCRIPTION="Library for handling OpenGL function pointer management"
+HOMEPAGE="https://github.com/anholt/libepoxy"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="+egl test +X"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ egl? ( media-libs/mesa[egl(+),${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ X? ( x11-libs/libX11[${MULTILIB_USEDEP}] )"
+BDEPEND="${PYTHON_DEPS}
+ virtual/pkgconfig"
+
+PATCHES=( "${FILESDIR}"/libepoxy-1.5.10-libopengl-fallback.patch )
+
+multilib_src_configure() {
+ local emesonargs=(
+ -Degl=$(usex egl)
+ -Dglx=$(usex X)
+ $(meson_use X x11)
+ $(meson_use test tests)
+ )
+ meson_src_configure
+}
+
+multilib_src_test() {
+ virtx meson_src_test
+}