From 022f75d23c527bdd199de50d615cfbe599498e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sun, 7 Feb 2021 21:23:34 +0100 Subject: [PATCH] wineasio: fix ftbfs --- srcpkgs/wineasio/patches/wine-unicode_h.patch | 59 +++++++++++++++++++ srcpkgs/wineasio/template | 4 +- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/wineasio/patches/wine-unicode_h.patch diff --git a/srcpkgs/wineasio/patches/wine-unicode_h.patch b/srcpkgs/wineasio/patches/wine-unicode_h.patch new file mode 100644 index 0000000000..7b49df4727 --- /dev/null +++ b/srcpkgs/wineasio/patches/wine-unicode_h.patch @@ -0,0 +1,59 @@ +Source: @pullmoll +Upstream: no +Reason: wine/unicode.h does not exist anymore and also strrchrW() + is not available. Replace the code with a simple linear + scan over the application_path array to find the rightmost + backslash (\) and period (.) for creating the application_name. + +--- wineasio/asio.c 2013-10-28 15:22:00.000000000 +0100 ++++ wineasio/asio.c 2021-02-07 21:18:46.741180398 +0100 +@@ -24,6 +24,7 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + ++#define _UNICODE + #include + #include + #include +@@ -34,7 +35,6 @@ + #include "objbase.h" + #include "mmsystem.h" + #include "winreg.h" +-#include "wine/unicode.h" + + #include + #include +@@ -1449,7 +1449,7 @@ + { + HKEY hkey; + LONG result, value; +- DWORD type, size; ++ DWORD type, size, pos, backslash, period; + WCHAR application_path [MAX_PATH]; + WCHAR *application_name; + char environment_variable[MAX_ENVIRONMENT_SIZE]; +@@ -1601,10 +1601,20 @@ + + /* get client name by stripping path and extension */ + GetModuleFileNameW(0, application_path, MAX_PATH); +- application_name = strrchrW(application_path, L'.'); +- *application_name = 0; +- application_name = strrchrW(application_path, L'\\'); +- application_name++; ++ backslash = 0; ++ period = 0; ++ for (pos = 0; pos < MAX_PATH; pos++) { ++ if (L'\\' == application_path[pos]) ++ backslash = pos; ++ if (L'.' == application_path[pos]) ++ period = pos; ++ if (0 == application_path[pos]) ++ break; ++ } ++ if (period > 0) { ++ application_path[period] = 0; ++ } ++ application_name = backslash ? &application_path[backslash + 1] : application_path; + WideCharToMultiByte(CP_ACP, WC_SEPCHARS, application_name, -1, This->jack_client_name, ASIO_MAX_NAME_LENGTH, NULL, NULL); + + RegCloseKey(hkey); diff --git a/srcpkgs/wineasio/template b/srcpkgs/wineasio/template index 52b04d8442..bc529e72b3 100644 --- a/srcpkgs/wineasio/template +++ b/srcpkgs/wineasio/template @@ -1,14 +1,14 @@ # Template file for 'wineasio' pkgname=wineasio version=0.9.2 -revision=6 +revision=7 archs="i686" repository="nonfree" build_style=gnu-makefile create_wrksrc=yes build_wrksrc=${pkgname} homepage="https://sourceforge.net/projects/wineasio" -hostmakedepends="unzip" +hostmakedepends="unzip wine-tools" makedepends="wine wine-devel jack-devel" depends="jack" short_desc="JACK driver for WINE to provide Windows Apps with ASIO support"