Skip to content

Commit

Permalink
Update carla and wineasio for wine compat fixes
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Feb 28, 2024
1 parent 8ca3729 commit 14051c6
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sources/apps/carla/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
carla (6:2.5.8-1kxstudio1) focal; urgency=medium
carla (6:2.5.8-1kxstudio2) focal; urgency=medium

* Update

Expand Down
94 changes: 94 additions & 0 deletions sources/apps/carla/debian/patches/01_fix-wine-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
commit 85beab57e1616f1b5bc923319d7abbbcc86ceea2
Author: falkTX <falktx@falktx.com>
Date: Wed Feb 28 22:16:15 2024 +0100

wine related fixes

Signed-off-by: falkTX <falktx@falktx.com>

diff --git a/source/bridges-plugin/CarlaBridgePlugin.cpp b/source/bridges-plugin/CarlaBridgePlugin.cpp
index cbf79ebf1..991cf4257 100644
--- a/source/bridges-plugin/CarlaBridgePlugin.cpp
+++ b/source/bridges-plugin/CarlaBridgePlugin.cpp
@@ -86,6 +86,11 @@ static void saveSignalHandler(int) noexcept
gSaveNow = true;
}
#elif defined(CARLA_OS_WIN)
+static LONG WINAPI winExceptionFilter(_EXCEPTION_POINTERS*)
+{
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+
static BOOL WINAPI winSignalHandler(DWORD dwCtrlType) noexcept
{
if (dwCtrlType == CTRL_C_EVENT)
@@ -115,6 +120,8 @@ static void initSignalHandler()
sigaction(SIGUSR1, &sig, nullptr);
#elif defined(CARLA_OS_WIN)
SetConsoleCtrlHandler(winSignalHandler, TRUE);
+ SetErrorMode(SEM_NOGPFAULTERRORBOX);
+ SetUnhandledExceptionFilter(winExceptionFilter);
#endif
}

diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp
index 43a3af0d7..996c33247 100644
--- a/source/discovery/carla-discovery.cpp
+++ b/source/discovery/carla-discovery.cpp
@@ -132,7 +132,6 @@ protected:

CarlaScopedPointer<DiscoveryPipe> gPipe;

-
// --------------------------------------------------------------------------------------------------------------------
// Don't print ELF/EXE related errors since discovery can find multi-architecture binaries

@@ -151,6 +150,16 @@ static void print_lib_error(const char* const filename)
}
}

+#ifdef CARLA_OS_WIN
+// --------------------------------------------------------------------------------------------------------------------
+// Do not show error message box on Windows
+
+static LONG WINAPI winExceptionFilter(_EXCEPTION_POINTERS*)
+{
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+#endif
+
// --------------------------------------------------------------------------------------------------------------------
// Plugin Checks

@@ -2305,13 +2314,19 @@ int main(int argc, const char* argv[])
#endif

#ifdef CARLA_OS_WIN
+ // init win32 stuff that plugins might use
OleInitialize(nullptr);
CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
+
# ifndef __WINPTHREADS_VERSION
// (non-portable) initialization of statically linked pthread library
pthread_win32_process_attach_np();
pthread_win32_thread_attach_np();
# endif
+
+ // do not show error message box on Windows
+ SetErrorMode(SEM_NOGPFAULTERRORBOX);
+ SetUnhandledExceptionFilter(winExceptionFilter);
#endif

// ---------------------------------------------------------------------------------------------------------------
diff --git a/source/jackbridge/Makefile b/source/jackbridge/Makefile
index a7bd0a4cf..a95776ef8 100644
--- a/source/jackbridge/Makefile
+++ b/source/jackbridge/Makefile
@@ -22,6 +22,7 @@ WINE_32BIT_FLAGS = $(32BIT_FLAGS) -fpermissive
WINE_64BIT_FLAGS = $(64BIT_FLAGS) -fpermissive
WINE_BUILD_FLAGS = $(filter-out -flto,$(BUILD_CXX_FLAGS))
WINE_LINK_FLAGS = $(filter-out -flto -static-libgcc -static-libstdc++,$(LINK_FLAGS))
+WINE_LINK_FLAGS += -nostartfiles
WINE_LINK_FLAGS += $(LIBDL_LIBS)
WINE_LINK_FLAGS += -pthread
WINE_LINK_FLAGS += -lstdc++
1 change: 1 addition & 0 deletions sources/apps/carla/debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01_fix-wine-compat.patch
2 changes: 1 addition & 1 deletion sources/apps/wineasio/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
wineasio (5:1.2.0b-1kxstudio3) bionic; urgency=medium
wineasio (5:1.2.0b-1kxstudio4) bionic; urgency=medium

* Fix compat with legacy wine

Expand Down
20 changes: 20 additions & 0 deletions sources/apps/wineasio/debian/patches/01_fix-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
commit bde84a3b8d02112607cfa33f72b51e39b38790a8
Author: falkTX <falktx@falktx.com>
Date: Thu Feb 29 00:03:08 2024 +0100

Fix compat with newer wine that does not have winelib

Signed-off-by: falkTX <falktx@falktx.com>

diff --git a/Makefile.mk b/Makefile.mk
index 991fd5d..67ffafa 100644
--- a/Makefile.mk
+++ b/Makefile.mk
@@ -75,6 +75,7 @@ wineasio_dll_LDFLAGS = -shared \
-L/opt/wine-staging/lib/wine \
-L/opt/wine-staging/lib$(M) \
-L/opt/wine-staging/lib$(M)/wine
+wineasio_dll_LDFLAGS += -nostartfiles
wineasio_dll_DLLS = odbc32 \
ole32 \
winmm
1 change: 1 addition & 0 deletions sources/apps/wineasio/debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
01_fix-compat.patch

0 comments on commit 14051c6

Please sign in to comment.