summaryrefslogtreecommitdiffstats
path: root/external/epoxy
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /external/epoxy
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'external/epoxy')
-rw-r--r--external/epoxy/Library_epoxy.mk65
-rw-r--r--external/epoxy/Makefile7
-rw-r--r--external/epoxy/Module_epoxy.mk17
-rw-r--r--external/epoxy/README5
-rw-r--r--external/epoxy/UnpackedTarball_epoxy.mk38
-rw-r--r--external/epoxy/Wint-conversion.patch26
-rw-r--r--external/epoxy/clang-cl.patch14
-rw-r--r--external/epoxy/epoxy.noegl.by.default.patch28
-rw-r--r--external/epoxy/epoxy.visibility.patch5
-rw-r--r--external/epoxy/epoxy.windows.api.patch12
10 files changed, 217 insertions, 0 deletions
diff --git a/external/epoxy/Library_epoxy.mk b/external/epoxy/Library_epoxy.mk
new file mode 100644
index 0000000000..81c35d6959
--- /dev/null
+++ b/external/epoxy/Library_epoxy.mk
@@ -0,0 +1,65 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,epoxy))
+
+$(eval $(call gb_Library_use_unpacked,epoxy,epoxy))
+
+$(eval $(call gb_Library_set_warnings_disabled,epoxy))
+
+$(eval $(call gb_Library_set_include,epoxy,\
+ -I$(call gb_UnpackedTarball_get_dir,epoxy)/include \
+ -I$(call gb_UnpackedTarball_get_dir,epoxy)/src \
+ $$(INCLUDE) \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_libs,epoxy,\
+ -ldl \
+))
+endif
+
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+ UnpackedTarball/epoxy/src/dispatch_common \
+ UnpackedTarball/epoxy/src/gl_generated_dispatch \
+))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+ UnpackedTarball/epoxy/src/dispatch_wgl \
+ UnpackedTarball/epoxy/src/wgl_generated_dispatch \
+))
+else ifneq ($(filter iOS MACOSX,$(OS)),)
+# nothing
+else ifeq ($(OS),ANDROID)
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+ UnpackedTarball/epoxy/src/dispatch_egl \
+ UnpackedTarball/epoxy/src/egl_generated_dispatch \
+))
+else
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+ UnpackedTarball/epoxy/src/dispatch_glx \
+ UnpackedTarball/epoxy/src/glx_generated_dispatch \
+))
+ifeq ($(ENABLE_GTK3),TRUE)
+$(eval $(call gb_Library_add_cflags,epoxy,\
+ -DPLATFORM_HAS_EGL=1 \
+))
+$(eval $(call gb_Library_add_generated_cobjects,epoxy,\
+ UnpackedTarball/epoxy/src/dispatch_egl \
+ UnpackedTarball/epoxy/src/egl_generated_dispatch \
+))
+else
+$(eval $(call gb_Library_add_cflags,epoxy,\
+ -DPLATFORM_HAS_EGL=0 \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/Makefile b/external/epoxy/Makefile
new file mode 100644
index 0000000000..e4968cf85f
--- /dev/null
+++ b/external/epoxy/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/Module_epoxy.mk b/external/epoxy/Module_epoxy.mk
new file mode 100644
index 0000000000..ea65176b85
--- /dev/null
+++ b/external/epoxy/Module_epoxy.mk
@@ -0,0 +1,17 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,epoxy))
+
+$(eval $(call gb_Module_add_targets,epoxy,\
+ Library_epoxy \
+ UnpackedTarball_epoxy \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/README b/external/epoxy/README
new file mode 100644
index 0000000000..8bd467af5c
--- /dev/null
+++ b/external/epoxy/README
@@ -0,0 +1,5 @@
+Epoxy is an OpenGL Extension Wrangler
+
+Epoxy is a library for handling OpenGL function pointer management for you
+
+https://github.com/anholt/libepoxy
diff --git a/external/epoxy/UnpackedTarball_epoxy.mk b/external/epoxy/UnpackedTarball_epoxy.mk
new file mode 100644
index 0000000000..7dd3199881
--- /dev/null
+++ b/external/epoxy/UnpackedTarball_epoxy.mk
@@ -0,0 +1,38 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,epoxy))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,epoxy,$(EPOXY_TARBALL)))
+
+$(call gb_UnpackedTarball_get_target,epoxy) :| $(call gb_ExternalExecutable_get_dependencies,python)
+
+epoxy_PYTHON := $(call gb_ExternalExecutable_get_command,python)
+
+# previous versions of epoxy bundled the output, but now it has to be generated
+$(eval $(call gb_UnpackedTarball_set_post_action,epoxy,\
+ $(epoxy_PYTHON) ./src/gen_dispatch.py --srcdir src --includedir include/epoxy registry/gl.xml && \
+ $(epoxy_PYTHON) ./src/gen_dispatch.py --srcdir src --includedir include/epoxy registry/glx.xml && \
+ $(epoxy_PYTHON) ./src/gen_dispatch.py --srcdir src --includedir include/epoxy registry/egl.xml && \
+ $(epoxy_PYTHON) ./src/gen_dispatch.py --srcdir src --includedir include/epoxy registry/wgl.xml \
+))
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,epoxy,0))
+
+# * external/external/epoxy/epoxy.android.patch upstream at
+# <https://github.com/anholt/libepoxy/pull/263> "fix error: use of undeclared identifier 'OPENGL_LIB'":
+$(eval $(call gb_UnpackedTarball_add_patches,epoxy, \
+ external/epoxy/epoxy.visibility.patch \
+ external/epoxy/epoxy.windows.api.patch \
+ external/epoxy/epoxy.noegl.by.default.patch \
+ external/epoxy/clang-cl.patch \
+ external/epoxy/Wint-conversion.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/epoxy/Wint-conversion.patch b/external/epoxy/Wint-conversion.patch
new file mode 100644
index 0000000000..b638dfad80
--- /dev/null
+++ b/external/epoxy/Wint-conversion.patch
@@ -0,0 +1,26 @@
+--- src/gen_dispatch.py
++++ src/gen_dispatch.py
+@@ -123,20 +123,16 @@
+ #
+ # We retain those aliases. In the x86_64 ABI, the first 6
+ # args are stored in 64-bit registers, so the calls end up
+- # being the same despite the different types. We just need to
+- # add a cast to uintptr_t to shut up the compiler.
++ # being the same despite the different types.
+ if arg_type == 'GLhandleARB':
+ assert len(self.args) < 6
+- arg_list_name = '(uintptr_t)' + arg_name
+- else:
+- arg_list_name = arg_name
+
+ self.args.append((arg_type, arg_name))
+ if self.args_decl == 'void':
+- self.args_list = arg_list_name
++ self.args_list = arg_name
+ self.args_decl = arg_type + ' ' + arg_name
+ else:
+- self.args_list += ', ' + arg_list_name
++ self.args_list += ', ' + arg_name
+ self.args_decl += ', ' + arg_type + ' ' + arg_name
+
+ def add_provider(self, condition, loader, condition_name):
diff --git a/external/epoxy/clang-cl.patch b/external/epoxy/clang-cl.patch
new file mode 100644
index 0000000000..0e0232cea6
--- /dev/null
+++ b/external/epoxy/clang-cl.patch
@@ -0,0 +1,14 @@
+--- src/dispatch_common.c
++++ src/dispatch_common.c
+@@ -272,7 +272,11 @@
+ #endif
+ };
+
++#if defined _MSC_VER && defined __clang__
++static bool library_initialized = true;
++#else
+ static bool library_initialized;
++#endif
+
+ static bool epoxy_current_context_is_glx(void);
+
diff --git a/external/epoxy/epoxy.noegl.by.default.patch b/external/epoxy/epoxy.noegl.by.default.patch
new file mode 100644
index 0000000000..bf89453363
--- /dev/null
+++ b/external/epoxy/epoxy.noegl.by.default.patch
@@ -0,0 +1,28 @@
+--- src/dispatch_common.h
++++ src/dispatch_common.h
+@@ -24,20 +24,19 @@
+ #include "config.h"
+
+ #ifdef _WIN32
+-#define PLATFORM_HAS_EGL ENABLE_EGL
+-#define PLATFORM_HAS_GLX ENABLE_GLX
++#define PLATFORM_HAS_EGL 0
++#define PLATFORM_HAS_GLX 0
+ #define PLATFORM_HAS_WGL 1
+ #elif defined(__APPLE__)
+ #define PLATFORM_HAS_EGL 0
+-#define PLATFORM_HAS_GLX ENABLE_GLX
++#define PLATFORM_HAS_GLX 0
+ #define PLATFORM_HAS_WGL 0
+ #elif defined(ANDROID)
+-#define PLATFORM_HAS_EGL ENABLE_EGL
++#define PLATFORM_HAS_EGL 1
+ #define PLATFORM_HAS_GLX 0
+ #define PLATFORM_HAS_WGL 0
+ #else
+-#define PLATFORM_HAS_EGL ENABLE_EGL
+-#define PLATFORM_HAS_GLX ENABLE_GLX
++#define PLATFORM_HAS_GLX 1
+ #define PLATFORM_HAS_WGL 0
+ #endif
+
diff --git a/external/epoxy/epoxy.visibility.patch b/external/epoxy/epoxy.visibility.patch
new file mode 100644
index 0000000000..12297b5e29
--- /dev/null
+++ b/external/epoxy/epoxy.visibility.patch
@@ -0,0 +1,5 @@
+--- src/config.h 2018-08-28 13:19:40.699141662 +0100
++++ src/config.h 2018-08-28 13:21:51.942139881 +0100
+@@ -0,0 +1,2 @@
++#include <sal/types.h>
++#define EPOXY_PUBLIC SAL_DLLPUBLIC_EXPORT extern
diff --git a/external/epoxy/epoxy.windows.api.patch b/external/epoxy/epoxy.windows.api.patch
new file mode 100644
index 0000000000..985f2d8808
--- /dev/null
+++ b/external/epoxy/epoxy.windows.api.patch
@@ -0,0 +1,12 @@
+--- include/epoxy/gl.h
++++ include/epoxy/gl.h
+@@ -59,7 +59,8 @@
+
+ #else
+ #ifndef APIENTRY
+-#define APIENTRY __stdcall
++#define WINAPI __stdcall
++#define APIENTRY WINAPI
+ #endif
+
+ #ifndef GLAPIENTRY