From c9b2336f643291a53648caedd4731405768407bd Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 16 Apr 2017 19:19:34 +0200 Subject: [PATCH] Added patch to implement support for recent OSMesa versions. --- ...e-Support-for-recent-OSMesa-versions.patch | 61 +++++++++++++++++++ patches/configure-OSMesa/definition | 1 + patches/patchinstall.sh | 16 +++++ 3 files changed, 78 insertions(+) create mode 100644 patches/configure-OSMesa/0001-configure-Support-for-recent-OSMesa-versions.patch create mode 100644 patches/configure-OSMesa/definition diff --git a/patches/configure-OSMesa/0001-configure-Support-for-recent-OSMesa-versions.patch b/patches/configure-OSMesa/0001-configure-Support-for-recent-OSMesa-versions.patch new file mode 100644 index 00000000..3d81bb47 --- /dev/null +++ b/patches/configure-OSMesa/0001-configure-Support-for-recent-OSMesa-versions.patch @@ -0,0 +1,61 @@ +From 11e0603c3ec889f0b8b2f28f9a44d96a8183de31 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 16 Apr 2017 19:18:21 +0200 +Subject: configure: Support for recent OSMesa versions. + +--- + configure.ac | 2 +- + dlls/gdi32/dibdrv/opengl.c | 17 +++++++++-------- + 2 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 1a5b0de0e3..f5b587c80a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1149,7 +1149,7 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c + + if test "x$with_osmesa" != "xno" + then +- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS -lm $X_EXTRA_LIBS]) ++ WINE_CHECK_SONAME(OSMesa,OSMesaGetProcAddress,,,[$X_LIBS -lm $X_EXTRA_LIBS]) + WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"], + [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.]) + fi +diff --git a/dlls/gdi32/dibdrv/opengl.c b/dlls/gdi32/dibdrv/opengl.c +index 41331169c4..77d63201cf 100644 +--- a/dlls/gdi32/dibdrv/opengl.c ++++ b/dlls/gdi32/dibdrv/opengl.c +@@ -113,14 +113,6 @@ static BOOL init_opengl(void) + return FALSE; + } + +- for (i = 0; i < sizeof(opengl_func_names)/sizeof(opengl_func_names[0]); i++) +- { +- if (!(((void **)&opengl_funcs.gl)[i] = wine_dlsym( osmesa_handle, opengl_func_names[i], buffer, sizeof(buffer) ))) +- { +- ERR( "%s not found in %s (%s), disabling.\n", opengl_func_names[i], SONAME_LIBOSMESA, buffer ); +- goto failed; +- } +- } + #define LOAD_FUNCPTR(f) do if (!(p##f = wine_dlsym( osmesa_handle, #f, buffer, sizeof(buffer) ))) \ + { \ + ERR( "%s not found in %s (%s), disabling.\n", #f, SONAME_LIBOSMESA, buffer ); \ +@@ -134,6 +126,15 @@ static BOOL init_opengl(void) + LOAD_FUNCPTR(OSMesaPixelStore); + #undef LOAD_FUNCPTR + ++ for (i = 0; i < sizeof(opengl_func_names)/sizeof(opengl_func_names[0]); i++) ++ { ++ if (!(((void **)&opengl_funcs.gl)[i] = pOSMesaGetProcAddress( opengl_func_names[i] ))) ++ { ++ ERR( "%s not found in %s, disabling.\n", opengl_func_names[i], SONAME_LIBOSMESA ); ++ goto failed; ++ } ++ } ++ + return TRUE; + + failed: +-- +2.12.2 + diff --git a/patches/configure-OSMesa/definition b/patches/configure-OSMesa/definition new file mode 100644 index 00000000..c465b3f2 --- /dev/null +++ b/patches/configure-OSMesa/definition @@ -0,0 +1 @@ +Fixes: Support compilation with recent OSMesa versions diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e51362e4..0590dc79 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -103,6 +103,7 @@ patch_enable_all () enable_comctl32_TTM_ADDTOOLW="$1" enable_comdlg32_lpstrFileTitle="$1" enable_configure_Absolute_RPATH="$1" + enable_configure_OSMesa="$1" enable_crypt32_CMS_Certificates="$1" enable_crypt32_Certificate_Check="$1" enable_crypt32_CryptUnprotectMemory="$1" @@ -539,6 +540,9 @@ patch_enable () configure-Absolute_RPATH) enable_configure_Absolute_RPATH="$2" ;; + configure-OSMesa) + enable_configure_OSMesa="$2" + ;; crypt32-CMS_Certificates) enable_crypt32_CMS_Certificates="$2" ;; @@ -3094,6 +3098,18 @@ if test "$enable_configure_Absolute_RPATH" -eq 1; then ) >> "$patchlist" fi +# Patchset configure-OSMesa +# | +# | Modified files: +# | * configure.ac, dlls/gdi32/dibdrv/opengl.c +# | +if test "$enable_configure_OSMesa" -eq 1; then + patch_apply configure-OSMesa/0001-configure-Support-for-recent-OSMesa-versions.patch + ( + printf '%s\n' '+ { "Sebastian Lackner", "configure: Support for recent OSMesa versions.", 1 },'; + ) >> "$patchlist" +fi + # Patchset crypt32-CMS_Certificates # | # | This patchset fixes the following Wine bugs: