summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2022-05-30 12:03:09 -0400
committerMatt Turner <mattst88@gentoo.org>2022-05-30 13:24:59 -0400
commit579a702668e5ce1e81586c7f5596814e89cb70b5 (patch)
treefc41b6396bdaf51141130fed8948b29a863f4d7f
parentapp-doc/halibut: version bump to 1.3 for security bug #847985 (diff)
downloadgentoo-579a702668e5ce1e81586c7f5596814e89cb70b5.tar.gz
gentoo-579a702668e5ce1e81586c7f5596814e89cb70b5.tar.bz2
gentoo-579a702668e5ce1e81586c7f5596814e89cb70b5.zip
x11-apps/mesa-progs: Switch to meson
Closes: https://bugs.gentoo.org/845072 Co-authored-by: Mike Lothian <mike@fireburn.co.uk> Signed-off-by: Matt Turner <mattst88@gentoo.org>
-rw-r--r--x11-apps/mesa-progs/files/8.5.0-Disable-things-we-don-t-want.patch254
-rw-r--r--x11-apps/mesa-progs/mesa-progs-9999.ebuild91
2 files changed, 304 insertions, 41 deletions
diff --git a/x11-apps/mesa-progs/files/8.5.0-Disable-things-we-don-t-want.patch b/x11-apps/mesa-progs/files/8.5.0-Disable-things-we-don-t-want.patch
new file mode 100644
index 000000000000..666f568e461f
--- /dev/null
+++ b/x11-apps/mesa-progs/files/8.5.0-Disable-things-we-don-t-want.patch
@@ -0,0 +1,254 @@
+From caa6f31f1032f21756ab327429702feb4381045e Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Mon, 30 May 2022 12:16:24 -0400
+Subject: [PATCH] Disable things we don't want
+
+---
+ meson.build | 11 +++--------
+ src/egl/opengl/meson.build | 29 ----------------------------
+ src/egl/opengles2/meson.build | 5 -----
+ src/glad/meson.build | 17 -----------------
+ src/meson.build | 2 --
+ src/util/gl_wrap.h | 2 --
+ src/util/meson.build | 20 -------------------
+ src/xdemos/meson.build | 36 -----------------------------------
+ 8 files changed, 3 insertions(+), 119 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index e1968fab..9d59c1ec 100644
+--- a/meson.build
++++ b/meson.build
+@@ -75,14 +75,7 @@ endif
+
+ dep_threads = dependency('threads')
+
+-dep_glu = dependency('glu', required : dep_x11.found())
+-if not dep_glu.found()
+- _glu_name = 'GLU'
+- if host_machine.system() == 'windows'
+- _glu_name = 'glu32'
+- endif
+- dep_glu = cc.find_library(_glu_name, has_headers: 'GL/glu.h')
+-endif
++dep_glu = disabler()
+
+ # GBM is needed for EGL on KMS
+ dep_gbm = dependency('gbm', required : false, disabler : true)
+@@ -117,6 +110,8 @@ else
+ )
+ endif
+
++dep_glut = disabler()
++
+ if dep_glut.found() and cc.has_function('glutInitContextProfile',
+ include_directories: glut_incdir,
+ prefix : '#include <GL/freeglut.h>')
+diff --git a/src/egl/opengl/meson.build b/src/egl/opengl/meson.build
+index ba7cadc3..789b25a5 100644
+--- a/src/egl/opengl/meson.build
++++ b/src/egl/opengl/meson.build
+@@ -4,41 +4,12 @@ executable(
+ 'eglgears_x11', files('eglgears.c'),
+ dependencies: [_deps, idep_eglut_x11]
+ )
+-executable(
+- 'egltri_x11', files('egltri.c'),
+- dependencies: [_deps, idep_eglut_x11]
+-)
+-executable(
+- 'xeglgears', files('xeglgears.c'),
+- dependencies: [_deps, dep_egl, dep_x11]
+-)
+-executable(
+- 'xeglthreads', files('xeglthreads.c'),
+- dependencies: [_deps, dep_x11]
+-)
+-
+ executable(
+ 'eglgears_wayland', files('eglgears.c'),
+ dependencies: [_deps, idep_eglut_wayland]
+ )
+-executable(
+- 'egltri_wayland', files('egltri.c'),
+- dependencies: [_deps, idep_eglut_wayland]
+-)
+-
+-executable(
+- 'eglkms', 'eglkms.c',
+- dependencies: [_deps, dep_drm, dep_gbm, dep_egl]
+-)
+-
+ executable(
+ 'eglinfo', 'eglinfo.c',
+ dependencies: [dep_egl],
+ install: true
+ )
+-
+-executable(
+- 'peglgears', 'peglgears.c',
+- dependencies: [dep_gl, dep_egl, dep_m, idep_util]
+-)
+-
+diff --git a/src/egl/opengles2/meson.build b/src/egl/opengles2/meson.build
+index 59f69ed7..7137a961 100644
+--- a/src/egl/opengles2/meson.build
++++ b/src/egl/opengles2/meson.build
+@@ -9,11 +9,6 @@ executable(
+ dependencies: [dep_gles2, idep_eglut_x11, dep_m],
+ install: true
+ )
+-executable(
+- 'es2tri', files('es2tri.c'),
+- dependencies: [_deps_x11, dep_m],
+- install: true
+-)
+ executable(
+ 'es2gears_wayland', files('es2gears.c'),
+ dependencies: [dep_gles2, idep_eglut_wayland, dep_m],
+diff --git a/src/glad/meson.build b/src/glad/meson.build
+index 2d107609..23dacd45 100644
+--- a/src/glad/meson.build
++++ b/src/glad/meson.build
+@@ -19,20 +19,3 @@
+ # SOFTWARE.
+
+ inc_glad = include_directories('include')
+-
+-_libglad_files = files('src/glad.c')
+-if host_machine.system() == 'windows'
+- _libglad_files += files('src/glad_wgl.c')
+-endif
+-
+-_libglad = static_library(
+- 'glad',
+- _libglad_files,
+- include_directories: inc_glad
+-)
+-
+-idep_glad = declare_dependency(
+- link_with: _libglad,
+- dependencies: dep_dl,
+- include_directories: inc_glad,
+-)
+diff --git a/src/meson.build b/src/meson.build
+index 39cac78d..4d4abbf8 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -55,5 +55,3 @@ endif
+ if host_machine.system() == 'windows'
+ subdir('wgl')
+ endif
+-
+-subdir('data')
+diff --git a/src/util/gl_wrap.h b/src/util/gl_wrap.h
+index b2ff9c8f..f482df5e 100644
+--- a/src/util/gl_wrap.h
++++ b/src/util/gl_wrap.h
+@@ -7,10 +7,8 @@
+
+ #ifdef __APPLE__
+ # include <OpenGL/gl.h>
+-# include <OpenGL/glu.h>
+ #else
+ # include <GL/gl.h>
+-# include <GL/glu.h>
+ #endif
+
+ #ifndef GLAPIENTRY
+diff --git a/src/util/meson.build b/src/util/meson.build
+index 9168aecf..066073cc 100644
+--- a/src/util/meson.build
++++ b/src/util/meson.build
+@@ -20,26 +20,6 @@
+
+ inc_util = include_directories('.')
+
+-files_libutil = files(
+- 'readtex.c',
+- 'showbuffer.c',
+- 'trackball.c',
+-)
+-
+-_deps = []
+-if dep_glut.found()
+- files_libutil += files('shaderutil.c')
+- _deps += dep_glut
+-endif
+-
+-_libutil = static_library(
+- 'util',
+- files_libutil,
+- include_directories: inc_glad,
+- dependencies: _deps,
+-)
+-
+ idep_util = declare_dependency(
+- link_with: _libutil,
+ include_directories: inc_util,
+ )
+diff --git a/src/xdemos/meson.build b/src/xdemos/meson.build
+index d6d5d5d5..ce26699f 100644
+--- a/src/xdemos/meson.build
++++ b/src/xdemos/meson.build
+@@ -21,25 +21,7 @@
+ glx_deps = [dep_gl, dep_x11, dep_m]
+
+ progs = [
+- 'glsync',
+- 'glxdemo',
+ 'glxgears',
+- 'glxgears_pixmap',
+- 'glxcontexts',
+- 'glxheads',
+- 'glxpixmap',
+- 'glxpbdemo',
+- 'glxsnoop',
+- 'glxswapcontrol',
+- 'manywin',
+- 'multictx',
+- 'offset',
+- 'overlay',
+- 'shape',
+- 'sharedtex',
+- 'texture_from_pixmap',
+- 'wincopy',
+- 'xfont',
+ ]
+ foreach p : progs
+ executable(
+@@ -56,23 +38,7 @@ executable(
+ install: true
+ )
+
+-executable(
+- 'xrotfontdemo',
+- files('xrotfontdemo.c', 'xuserotfont.c'),
+- dependencies: glx_deps,
+- install: true
+-)
+-
+-_libpbutil = static_library(
+- 'pbutil',
+- files('pbutil.c'),
+- dependencies: glx_deps
+-)
+-
+ pbutil_progs = [
+- 'glxgears_fbconfig',
+- 'pbinfo',
+- 'pbdemo',
+ ]
+ foreach p : pbutil_progs
+ executable(
+@@ -84,8 +50,6 @@ foreach p : pbutil_progs
+ endforeach
+
+ thread_progs = [
+- 'glthreads',
+- 'sharedtex_mt',
+ ]
+ foreach p : thread_progs
+ executable(
+--
+2.35.1
+
diff --git a/x11-apps/mesa-progs/mesa-progs-9999.ebuild b/x11-apps/mesa-progs/mesa-progs-9999.ebuild
index ac2f9b7db41f..0de99d7b802b 100644
--- a/x11-apps/mesa-progs/mesa-progs-9999.ebuild
+++ b/x11-apps/mesa-progs/mesa-progs-9999.ebuild
@@ -1,7 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
+
+inherit meson-multilib
MY_PN="${PN/progs/demos}"
MY_P="${MY_PN}-${PV}"
@@ -9,10 +11,8 @@ MY_P="${MY_PN}-${PV}"
DESCRIPTION="Mesa's OpenGL utility and demo programs (glxgears and glxinfo)"
HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/ https://gitlab.freedesktop.org/mesa/demos"
if [[ ${PV} = 9999* ]]; then
- inherit autotools git-r3
+ inherit git-r3
EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/demos.git"
- EGIT_CHECKOUT_DIR="${S}"
- EXPERIMENTAL="true"
else
SRC_URI="https://mesa.freedesktop.org/archive/demos/${MY_P}.tar.bz2
https://mesa.freedesktop.org/archive/demos/${PV}/${MY_P}.tar.bz2"
@@ -21,49 +21,58 @@ else
fi
LICENSE="LGPL-2"
SLOT="0"
-IUSE="egl gles2"
+IUSE="gles2 wayland X"
RDEPEND="
- media-libs/mesa[egl(+)?,gles2?]
- virtual/opengl
- x11-libs/libX11"
+ media-libs/mesa[${MULTILIB_USEDEP},egl(+),gles2?,wayland?,X?]
+ wayland? ( dev-libs/wayland[${MULTILIB_USEDEP}] )
+ X? (
+ x11-libs/libX11[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ )
+"
DEPEND="${RDEPEND}
- virtual/glu
- x11-base/xorg-proto"
-BDEPEND="sys-apps/grep
- sys-apps/file"
+ wayland? ( >=dev-libs/wayland-protocols-1.12 )
+ X? ( x11-base/xorg-proto )
+"
+BDEPEND="
+ virtual/pkgconfig
+ wayland? ( dev-util/wayland-scanner )
+"
-src_prepare() {
- default
- [[ ${PV} = 9999* ]] && eautoreconf
-}
+PATCHES=(
+ "${FILESDIR}"/8.5.0-Disable-things-we-don-t-want.patch
+)
-src_compile() {
- emake -C src/glad libglad.la
- emake -C src/xdemos glxgears glxinfo
+pkg_setup() {
+ MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/eglinfo
+ )
- if use egl; then
- emake LDLIBS="-lEGL" -C src/egl/opengl/ eglinfo
- emake -C src/egl/eglut/ libeglut_x11.la
- emake LDLIBS="-lGL -lEGL -lX11 -lm" -C src/egl/opengl/ eglgears_x11
+ use X && MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/glxgears
+ /usr/bin/glxinfo
+ )
- if use gles2; then
- emake LDLIBS="-lGLESv2 -lEGL -lX11" -C src/egl/opengles2/ es2_info
- emake LDLIBS="-lGLESv2 -lEGL -lX11 -lm" -C src/egl/opengles2/ es2gears_x11
- fi
- fi
-}
+ use gles2 && use X && MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/es2_info
+ /usr/bin/es2gears_x11
+ )
-src_install() {
- local demo='src/xdemos'
- if use egl; then
- demo="${demo} src/egl/opengl"
-
- use gles2 && demo="${demo} src/egl/opengles2"
- fi
+ use gles2 && use wayland && MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/es2gears_wayland
+ )
+}
- # Ensure only the binaries are installed and not a similarly named wrapper script
- find ${demo} -type f -print0 |
- xargs -0 file | grep executable | grep ELF | cut -f 1 -d : |
- xargs -I '{}' dobin '{}' || die
+multilib_src_configure() {
+ local emesonargs=(
+ -Dlibdrm=disabled
+ -Degl=enabled
+ -Dgles1=disabled
+ $(meson_feature gles2)
+ -Dosmesa=disabled
+ $(meson_feature wayland)
+ $(meson_feature X x11)
+ )
+ meson_src_configure
}