kumquat-buildroot/package/mesa3d-demos/0001-demos-makes-opengl-an-optional-component.patch
Julien Olivain fa75c4a305 package/mesa3d-demos: bump version to 8.5.0
The package build system changed from autotools to meson. Autotools
was deprecated in commit [1], which is included in this 8.5.0
version. It was definitevely removed soon after, in commit [2].

The package patch file making libgl optional was fully rewritten
for meson.

This patch also updates the old ftp _SITE url to the new https one,
published in the project README.rst file. See [3].

This patch also removes openvg and freetype2 dependencies, as their
support was removed in commit [4]. The 'gbm' option is removed, and
the option 'libdrm' is added.

The md5 and sha1 entries in hash files are also removed, to keep only
sha256 and sha512 from the release announce email [5].

For change log, see the release announce [5].

[1] 2df8e97108
[2] abfead3758
[3] https://gitlab.freedesktop.org/mesa/demos/-/blob/mesa-demos-8.5.0/README.rst
[4] e6d0d9a868
[5] https://lists.freedesktop.org/archives/mesa-announce/2022-May/000677.html

Signed-off-by: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-02-06 22:46:35 +01:00

102 lines
2.8 KiB
Diff

From 9ec9f7b4d0ef5e799ca4cc5103163e4630d184d8 Mon Sep 17 00:00:00 2001
From: Julien Olivain <ju.o@free.fr>
Date: Fri, 16 Sep 2022 22:30:59 +0200
Subject: [PATCH] demos: makes opengl an optional component
This patch is a port of [1] for the new meson build system.
[1].
https://git.busybox.net/buildroot/tree/package/mesa3d-demos/0001-demos-makes-opengl-an-optional-component.patch?h=2022.08
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
meson.build | 19 ++++++++++++-------
meson_options.txt | 1 +
src/egl/meson.build | 5 ++++-
src/meson.build | 4 +++-
4 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index e1968fab..a15699d6 100644
--- a/meson.build
+++ b/meson.build
@@ -38,7 +38,10 @@ add_project_arguments(
dep_m = cc.find_library('m', required : false)
dep_winmm = cc.find_library('winmm', required : false)
-dep_gl = dependency('gl')
+dep_gl = dependency('gl', required : get_option('gl'))
+if not dep_gl.found()
+ add_project_arguments('-DEGL_NO_X11=1', language: 'c')
+endif
dep_gles1 = dependency('glesv1_cm', required : get_option('gles1'))
dep_gles2 = dependency('glesv2', required : get_option('gles2'))
@@ -75,13 +78,15 @@ 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'
+if dep_gl.found()
+ 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 = cc.find_library(_glu_name, has_headers: 'GL/glu.h')
endif
# GBM is needed for EGL on KMS
diff --git a/meson_options.txt b/meson_options.txt
index ddadd2e3..f5405698 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,5 +1,6 @@
option('with-glut', type : 'string')
option('egl', type : 'feature')
+option('gl', type : 'feature')
option('gles1', type : 'feature')
option('gles2', type : 'feature')
option('osmesa', type : 'feature')
diff --git a/src/egl/meson.build b/src/egl/meson.build
index d1846921..42bf8ecd 100644
--- a/src/egl/meson.build
+++ b/src/egl/meson.build
@@ -19,7 +19,10 @@
# SOFTWARE.
subdir('eglut')
-subdir('opengl')
+
+if dep_gl.found()
+ subdir('opengl')
+endif
if dep_gles1.found()
subdir('opengles1')
diff --git a/src/meson.build b/src/meson.build
index 39cac78d..7607c6de 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -20,7 +20,9 @@
subdir('glad')
-subdir('util')
+if dep_gl.found()
+ subdir('util')
+endif
if dep_glut.found()
subdir('demos')
--
2.37.3