pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/cmake devel/cmake: add patch to Modules/FindOpenGL



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dc44ab912c0e
branches:  trunk
changeset: 386509:dc44ab912c0e
user:      rhialto <rhialto%pkgsrc.org@localhost>
date:      Sun Oct 09 12:06:05 2022 +0000

description:
devel/cmake: add patch to Modules/FindOpenGL

In order to use libEGL, it looks for libOpenGL, but NetBSD and pkgsrc's
MesaLib don't have that, they have libGL instead. This causes issues in
x11/wxGTK32. See
https://github.com/wxWidgets/wxWidgets/issues/22841
https://gitlab.kitware.com/cmake/cmake/-/issues/24019

diffstat:

 devel/cmake/Makefile                               |   3 +-
 devel/cmake/distinfo                               |   3 +-
 devel/cmake/patches/patch-Modules_FindOpenGL.cmake |  31 ++++++++++++++++++++++
 3 files changed, 35 insertions(+), 2 deletions(-)

diffs (65 lines):

diff -r af64cefc260f -r dc44ab912c0e devel/cmake/Makefile
--- a/devel/cmake/Makefile      Sun Oct 09 09:17:24 2022 +0000
+++ b/devel/cmake/Makefile      Sun Oct 09 12:06:05 2022 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.198 2022/08/22 19:08:10 adam Exp $
+# $NetBSD: Makefile,v 1.199 2022/10/09 12:06:05 rhialto Exp $
 
 .include "Makefile.common"
 
+PKGREVISION=   1
 COMMENT=       Cross platform make
 
 USE_TOOLS+=            gmake
diff -r af64cefc260f -r dc44ab912c0e devel/cmake/distinfo
--- a/devel/cmake/distinfo      Sun Oct 09 09:17:24 2022 +0000
+++ b/devel/cmake/distinfo      Sun Oct 09 12:06:05 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.200 2022/09/26 13:37:32 adam Exp $
+$NetBSD: distinfo,v 1.201 2022/10/09 12:06:05 rhialto Exp $
 
 BLAKE2s (cmake-3.24.2.tar.gz) = b863499a7acf9e8d88ed73bc34c5df8232f9df3461b6de3488541452fafab9af
 SHA512 (cmake-3.24.2.tar.gz) = 6f0e8e29bf0336f555ba72c4d83f35d820f8a5159cc999d48795dc57a6627b4ee3966dda84ca97d39906e35dd476ea00cf80023672cc0fad862e2996194c0674
@@ -10,6 +10,7 @@
 SHA1 (patch-Modules_FindCurses.cmake) = 98cac805a6abafcfb8b61e441b50a1d6aec27ad0
 SHA1 (patch-Modules_FindGTK2.cmake) = 51b7520d35fdec2a7bfcf494fe35ce0e3863e4ee
 SHA1 (patch-Modules_FindLAPACK.cmake) = ded20237fdc8b3e9c488102367c0ee33713c21be
+SHA1 (patch-Modules_FindOpenGL.cmake) = 365d422b50a1b1279cab04a8fd11e05633f52833
 SHA1 (patch-Modules_FindPythonInterp.cmake) = d1b39bdcd654f2a4fc63463cd20de656cce3cf8f
 SHA1 (patch-Modules_FindPythonLibs.cmake) = b5cedc6a2354beaf08e06d416c150154a7dc1f05
 SHA1 (patch-Modules_FindPython_Support.cmake) = aaec7767cad795dd269c851bd110ccefbfc87eb3
diff -r af64cefc260f -r dc44ab912c0e devel/cmake/patches/patch-Modules_FindOpenGL.cmake
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/cmake/patches/patch-Modules_FindOpenGL.cmake        Sun Oct 09 12:06:05 2022 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-Modules_FindOpenGL.cmake,v 1.1 2022/10/09 12:06:05 rhialto Exp $
+
+Despite complicated wording in the module, pkgsrc's MesaLib has no libOpenGL
+but does have (conditionally) libGL. Possibly all conditions and dependencies
+on (Open)GL should even be removed here.
+
+https://github.com/wxWidgets/wxWidgets/issues/22841
+https://gitlab.kitware.com/cmake/cmake/-/issues/24019
+
+--- Modules/FindOpenGL.cmake.orig      2022-08-17 16:54:57.000000000 +0000
++++ Modules/FindOpenGL.cmake
+@@ -520,7 +520,9 @@ if(OPENGL_FOUND)
+   # Note we test for OpenGL::OpenGL as a target.  When this module is updated to
+   # support GLES, we would additionally want to check for the hypothetical GLES
+   # target and enable EGL if either ::GLES or ::OpenGL is created.
+-  if(TARGET OpenGL::OpenGL AND OpenGL_EGL_FOUND AND NOT TARGET OpenGL::EGL)
++  # Pkgsrc note: despite complicated wording above, pkgsrc's MesaLib
++  # has no libOpenGL but does have (conditionally) libGL.
++  if(TARGET OpenGL::GL AND OpenGL_EGL_FOUND AND NOT TARGET OpenGL::EGL)
+     if(IS_ABSOLUTE "${OPENGL_egl_LIBRARY}")
+       add_library(OpenGL::EGL UNKNOWN IMPORTED)
+       set_target_properties(OpenGL::EGL PROPERTIES IMPORTED_LOCATION
+@@ -531,7 +533,7 @@ if(OPENGL_FOUND)
+                             "${OPENGL_egl_LIBRARY}")
+     endif()
+     set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_LINK_LIBRARIES
+-                          OpenGL::OpenGL)
++                          OpenGL::GL)
+     # Note that EGL's include directory is different from OpenGL/GLX's!
+     set_target_properties(OpenGL::EGL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+                           "${OPENGL_EGL_INCLUDE_DIR}")



Home | Main Index | Thread Index | Old Index