From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1459875-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id C7DD3158020
	for <garchives@archives.gentoo.org>; Thu, 24 Nov 2022 00:57:08 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id EEA92E0A02;
	Thu, 24 Nov 2022 00:57:06 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id A549CE0A02
	for <gentoo-commits@lists.gentoo.org>; Thu, 24 Nov 2022 00:57:06 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 9403C340FC2
	for <gentoo-commits@lists.gentoo.org>; Thu, 24 Nov 2022 00:57:05 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 0C0BA74D
	for <gentoo-commits@lists.gentoo.org>; Thu, 24 Nov 2022 00:57:04 +0000 (UTC)
From: "Ionen Wolkens" <ionen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ionen Wolkens" <ionen@gentoo.org>
Message-ID: <1669251287.bd5474ca01e379cb7b8d4c4da6f6bd3be103f8bf.ionen@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/wine-staging/, app-emulation/wine-staging/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-emulation/wine-staging/files/wine-staging-7.21-opengl32.patch app-emulation/wine-staging/wine-staging-7.21-r1.ebuild app-emulation/wine-staging/wine-staging-7.21.ebuild
X-VCS-Directories: app-emulation/wine-staging/ app-emulation/wine-staging/files/
X-VCS-Committer: ionen
X-VCS-Committer-Name: Ionen Wolkens
X-VCS-Revision: bd5474ca01e379cb7b8d4c4da6f6bd3be103f8bf
X-VCS-Branch: master
Date: Thu, 24 Nov 2022 00:57:04 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 09eaf4cf-28ff-4633-b05d-3f1998f3bf42
X-Archives-Hash: 8a701e53046dc986074e204ea0baad61

commit:     bd5474ca01e379cb7b8d4c4da6f6bd3be103f8bf
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 23 23:49:07 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Nov 24 00:54:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd5474ca

app-emulation/wine-staging: backport opengl32.dll fix to 7.21

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../files/wine-staging-7.21-opengl32.patch         | 73 ++++++++++++++++++++++
 ...ing-7.21.ebuild => wine-staging-7.21-r1.ebuild} |  3 +-
 2 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/app-emulation/wine-staging/files/wine-staging-7.21-opengl32.patch b/app-emulation/wine-staging/files/wine-staging-7.21-opengl32.patch
new file mode 100644
index 000000000000..9411e05e96fd
--- /dev/null
+++ b/app-emulation/wine-staging/files/wine-staging-7.21-opengl32.patch
@@ -0,0 +1,73 @@
+Fixes PE opengl32.dll failing to initialize.
+
+https://gitlab.winehq.org/wine/wine/-/commit/34099bba6cb
+From:  RĂ©mi Bernon <rbernon@codeweavers.com>
+Date: Mon, 14 Nov 2022 11:55:51 +0100
+Subject: [PATCH] ntdll: Delay loading unixlibs until the functions are
+ requested.
+
+Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53909
+--- a/dlls/ntdll/unix/virtual.c
++++ b/dlls/ntdll/unix/virtual.c
+@@ -98,6 +98,7 @@ struct builtin_module
+     unsigned int refcount;
+     void        *handle;
+     void        *module;
++    char        *unix_path;
+     void        *unix_handle;
+ };
+ 
+@@ -583,6 +584,7 @@ static void add_builtin_module( void *module, void *handle )
+     builtin->handle      = handle;
+     builtin->module      = module;
+     builtin->refcount    = 1;
++    builtin->unix_path   = NULL;
+     builtin->unix_handle = NULL;
+     list_add_tail( &builtin_modules, &builtin->entry );
+ }
+@@ -603,6 +605,7 @@ void release_builtin_module( void *module )
+             list_remove( &builtin->entry );
+             if (builtin->handle) dlclose( builtin->handle );
+             if (builtin->unix_handle) dlclose( builtin->unix_handle );
++            free( builtin->unix_path );
+             free( builtin );
+         }
+         break;
+@@ -652,6 +655,8 @@ static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, const void **fun
+     LIST_FOR_EACH_ENTRY( builtin, &builtin_modules, struct builtin_module, entry )
+     {
+         if (builtin->module != module) continue;
++        if (builtin->unix_path && !builtin->unix_handle)
++            builtin->unix_handle = dlopen( builtin->unix_path, RTLD_NOW );
+         if (builtin->unix_handle)
+         {
+             *funcs = dlsym( builtin->unix_handle, ptr_name );
+@@ -669,26 +674,19 @@ static NTSTATUS get_builtin_unix_funcs( void *module, BOOL wow, const void **fun
+  */
+ NTSTATUS load_builtin_unixlib( void *module, const char *name )
+ {
+-    void *handle;
+     sigset_t sigset;
+-    NTSTATUS status = STATUS_DLL_NOT_FOUND;
++    NTSTATUS status = STATUS_SUCCESS;
+     struct builtin_module *builtin;
+ 
+-    if (!(handle = dlopen( name, RTLD_NOW ))) return status;
+     server_enter_uninterrupted_section( &virtual_mutex, &sigset );
+     LIST_FOR_EACH_ENTRY( builtin, &builtin_modules, struct builtin_module, entry )
+     {
+         if (builtin->module != module) continue;
+-        if (!builtin->unix_handle)
+-        {
+-            builtin->unix_handle = handle;
+-            status = STATUS_SUCCESS;
+-        }
++        if (!builtin->unix_path) builtin->unix_path = strdup( name );
+         else status = STATUS_IMAGE_ALREADY_LOADED;
+         break;
+     }
+     server_leave_uninterrupted_section( &virtual_mutex, &sigset );
+-    if (status) dlclose( handle );
+     return status;
+ }
+ 

diff --git a/app-emulation/wine-staging/wine-staging-7.21.ebuild b/app-emulation/wine-staging/wine-staging-7.21-r1.ebuild
similarity index 99%
rename from app-emulation/wine-staging/wine-staging-7.21.ebuild
rename to app-emulation/wine-staging/wine-staging-7.21-r1.ebuild
index e3f38a33cb12..606f5b2e9331 100644
--- a/app-emulation/wine-staging/wine-staging-7.21.ebuild
+++ b/app-emulation/wine-staging/wine-staging-7.21-r1.ebuild
@@ -129,7 +129,8 @@ QA_TEXTRELS="usr/lib/*/wine/i386-unix/*.so" # uses -fno-PIC -Wl,-z,notext
 PATCHES=(
 	"${FILESDIR}"/${PN}-7.17-noexecstack.patch
 	"${FILESDIR}"/${PN}-7.20-unwind.patch
-	"${FILESDIR}"/${PN}-7.21-crossflags.patch
+	"${FILESDIR}"/${P}-crossflags.patch
+	"${FILESDIR}"/${P}-opengl32.patch
 )
 
 pkg_pretend() {