all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sughosha via Guix-patches via <guix-patches@gnu.org>
To: "63065@debbugs.gnu.org" <63065@debbugs.gnu.org>
Subject: [bug#63065] [PATCH 06/18] gnu: Add vst3sdk.
Date: Tue, 25 Apr 2023 09:30:12 +0000	[thread overview]
Message-ID: <C1LmYLEAX0doKyopgqvNW7hyTYj63frcyP7k_9FiO2Eom8-5V5uZi_1CGHLgmzCCTpRowDfN9UqBdoU48MO7fBZe5JZ4_Pyj6A-U1SpGi3c=@proton.me> (raw)
In-Reply-To: <VWgRB1zpMdRgLnGf6j9VnfZnEFKjoZo1_nBc7XWDuIG9dYagF7ODd9j6Knr-RLS5HNOvBGaz7u0yKAFcj49eedZBW_HxKoDvu-ABjWEy6Rg=@proton.me>

* gnu/packages/audio.scm (vst3sdk): New variable.
* gnu/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.patch:
New file.
* gnu/local.mk: Register the patch file.
---
 gnu/local.mk                                  |   1 +
 gnu/packages/audio.scm                        |  44 ++++
 ...3sdk-3.7.7-allow-winelib-compilation.patch | 191 ++++++++++++++++++
 3 files changed, 236 insertions(+)
 create mode 100644 gnu/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8088e8170b..b53a04a0cd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2000,6 +2000,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/vtk-7-gcc-10-compat.patch		\
   %D%/packages/patches/vtk-7-hdf5-compat.patch			\
   %D%/packages/patches/vtk-7-python-compat.patch		\
+  %D%/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.patch	\
   %D%/packages/patches/wacomtablet-add-missing-includes.patch	\
   %D%/packages/patches/wacomtablet-qt5.15.patch			\
   %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch	\
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 14c1ebbd92..9e111a3b9e 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -3405,6 +3405,50 @@ (define-public freealut
     (home-page "https://kcat.strangesoft.net/openal.html")
     (license license:lgpl2.0)))
 
+(define-public vst3sdk
+  (package
+    (name "vst3sdk")
+    (version "3.7.7")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/steinbergmedia/vst3sdk")
+                    ;; Should the build number included in version variable?
+                    (commit (string-append "v" version "_build_19"))
+                    ;; Required for vst3_base, vst3_cmake, vst3_doc,
+                    ;; vst3_pluginterfaces, vst3_public_sdk and vstgui.
+                    (recursive? #t)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1a2ph0niyzpsjg765pxjmwhjc7pvcy5rsn4d254hx2b5by4f5cf2"))
+              (patches
+               (search-patches
+                "vst3sdk-3.7.7-allow-winelib-compilation.patch"))))
+    (build-system copy-build-system)
+    (arguments
+     `(#:install-plan
+       `(("." "/share/vst3sdk" #:exclude-regexp ("/cmake/"
+                                                 "/doc/"
+                                                 ".gitmodules"
+                                                 "LICENSE.txt"
+                                                 "README.md"))
+         ("cmake/modules" "/lib/cmake/vst3sdk")
+         ("doc" "/share/doc/vst3sdk"))))
+    (home-page "https://github.com/steinbergmedia/vst3sdk")
+    (synopsis "VST 3 plugin SDK")
+    (description
+     "This package contains:
+@itemize
+@item VST 3 API
+@item VST 3 implementation helper classes
+@item VST 2 wrappers
+@end itemize")
+    (license (list license:gpl3
+                   ;; License used by vst3_base, vst3_cmake, vst3_public_sdk
+                   ;; and vstgui
+                   license:bsd-3))))
+
 (define-public patchage
   (package
     (name "patchage")
diff --git a/gnu/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.patch b/gnu/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.patch
new file mode 100644
index 0000000000..43639f978f
--- /dev/null
+++ b/gnu/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.patch
@@ -0,0 +1,191 @@
+This patch is taken from yabridge project:
+https://github.com/robbert-vdh/yabridge.
+
+Submodule base contains modified content
+diff --git a/base/source/fdebug.cpp b/base/source/fdebug.cpp
+index b1d1dcc..9093022 100644
+--- a/base/source/fdebug.cpp
++++ b/base/source/fdebug.cpp
+@@ -117,8 +117,6 @@ bool AmIBeingDebugged ()
+ #if _MSC_VER
+ #include <intrin.h>
+ #endif
+-#define vsnprintf _vsnprintf
+-#define snprintf _snprintf
+ 
+ #elif SMTG_OS_MACOS
+ #include <errno.h>
+Submodule pluginterfaces contains modified content
+diff --git a/pluginterfaces/base/fstrdefs.h b/pluginterfaces/base/fstrdefs.h
+index 848e8ee..8846d31 100644
+--- a/pluginterfaces/base/fstrdefs.h
++++ b/pluginterfaces/base/fstrdefs.h
+@@ -22,6 +22,16 @@
+ /** string methods defines unicode / ASCII */
+ //----------------------------------------------------------------------------
+ 
++// We can use most of the VST3 SDK's Windows UTF-16 functionality by just
++// creating aliases for equivalent Linux functions
++#if __WINE__
++#define wcsicmp wcscasecmp
++#define wcsnicmp wcsncasecmp
++#define _vsnwprintf vswprintf
++#define stricmp strcasecmp
++#define strnicmp strncasecmp
++#endif
++
+ // 16 bit string operations
+ #if SMTG_CPP11	// if c++11 unicode string literals
+ 	#define SMTG_CPP11_CAT_PRIVATE_DONT_USE(a,b)			a ## b
+diff --git a/pluginterfaces/base/ftypes.h b/pluginterfaces/base/ftypes.h
+index 133dbba..33ecae3 100644
+--- a/pluginterfaces/base/ftypes.h
++++ b/pluginterfaces/base/ftypes.h
+@@ -154,7 +154,7 @@ namespace Steinberg
+ // always inline macros (only when RELEASE is 1)
+ //----------------------------------------------------------------------------
+ #if RELEASE
+-    #if SMTG_OS_MACOS || SMTG_OS_LINUX || defined(__MINGW32__)
++    #if SMTG_OS_MACOS || SMTG_OS_LINUX || defined(__WINE__)
+ 		#define SMTG_ALWAYS_INLINE	__inline__ __attribute__((__always_inline__))
+ 		#define SMTG_NEVER_INLINE __attribute__((noinline))
+ 	#elif SMTG_OS_WINDOWS
+diff --git a/pluginterfaces/base/ustring.cpp b/pluginterfaces/base/ustring.cpp
+index 24a412f..8e631c9 100644
+--- a/pluginterfaces/base/ustring.cpp
++++ b/pluginterfaces/base/ustring.cpp
+@@ -38,6 +38,10 @@
+ 
+ #endif
+ 
++#ifdef __WINE__
++#include <wchar.h>
++#endif
++
+ //------------------------------------------------------------------------
+ namespace Steinberg {
+ 
+@@ -173,7 +177,7 @@ bool UString::scanFloat (double& value) const
+ bool UString::printFloat (double value, int32 precision)
+ {
+ #if SMTG_OS_WINDOWS
+-	return swprintf ((wchar_t*)thisBuffer, L"%.*lf", precision, value) != -1;
++	return swprintf ((wchar_t*)thisBuffer, thisSize, L"%.*lf", precision, value) != -1;
+ #elif SMTG_OS_MACOS
+ 	bool result = false;
+ 	CFStringRef cfStr = CFStringCreateWithFormat (0, 0, CFSTR("%.*lf"), precision, value);
+@@ -238,7 +242,7 @@ bool UString::scanInt (int64& value) const
+ bool UString::printInt (int64 value)
+ {
+ #if SMTG_OS_WINDOWS
+-	return swprintf ((wchar_t*)thisBuffer, L"%I64d", value) != -1;
++	return swprintf ((wchar_t*)thisBuffer, thisSize, L"%I64d", value) != -1;
+ 
+ #elif SMTG_OS_MACOS
+ 	CFStringRef cfStr = CFStringCreateWithFormat (0, 0, CFSTR("%lld"), value);
+Submodule public.sdk contains modified content
+diff --git a/public.sdk/source/common/systemclipboard_win32.cpp b/public.sdk/source/common/systemclipboard_win32.cpp
+index c5cb2b8..2ee3d65 100644
+--- a/public.sdk/source/common/systemclipboard_win32.cpp
++++ b/public.sdk/source/common/systemclipboard_win32.cpp
+@@ -111,7 +111,7 @@ bool copyTextToClipboard (const std::string& text)
+ 	{
+ 		if (auto* data = static_cast<WCHAR*> (GlobalLock (memory)))
+ 		{
+-#if defined(__MINGW32__)
++#if defined(__WINE__)
+ 			memcpy (data, wideStr.data (), byteSize);
+ #else
+ 			memcpy_s (data, byteSize, wideStr.data (), byteSize);
+diff --git a/public.sdk/source/vst/hosting/module_win32.cpp b/public.sdk/source/vst/hosting/module_win32.cpp
+index 2ba9319..ab6d72a 100644
+--- a/public.sdk/source/vst/hosting/module_win32.cpp
++++ b/public.sdk/source/vst/hosting/module_win32.cpp
+@@ -44,35 +44,10 @@
+ #include <algorithm>
+ #include <iostream>
+ 
+-#if SMTG_CPP17
+-
+-#if __has_include(<filesystem>)
+-#define USE_FILESYSTEM 1
+-#elif __has_include(<experimental/filesystem>)
+-#define USE_FILESYSTEM 0
+-#endif
+-
+-#else // !SMTG_CPP17
+-
+-#define USE_FILESYSTEM 0
+-
+-#endif // SMTG_CPP17
+-
+-#if USE_FILESYSTEM == 1
+-
+-#include <filesystem>
+-namespace filesystem = std::filesystem;
+-
+-#else // USE_FILESYSTEM == 0
+-
+-// The <experimental/filesystem> header is deprecated. It is superseded by the C++17 <filesystem>
+-// header. You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to silence the
+-// warning, otherwise the build will fail in VS2019 16.3.0
+-#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
+-#include <experimental/filesystem>
+-namespace filesystem = std::experimental::filesystem;
+-
+-#endif // USE_FILESYSTEM
++// `std::filesystem` doesn't work correctly with wineg++, resulting in weird
++// memory errors. This library is a drop-in replacement.
++#include <ghc/filesystem.hpp>
++namespace filesystem = ghc::filesystem;
+ 
+ #pragma comment(lib, "Shell32")
+ 
+@@ -320,7 +295,7 @@ VST3::Optional<filesystem::path> resolveShellLink (const filesystem::path& p)
+ #elif USE_OLE
+ 	Ole::instance ();
+ 
+-	IShellLink* shellLink = nullptr;
++	IShellLinkW* shellLink = nullptr;
+ 	if (!SUCCEEDED (CoCreateInstance (CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER,
+ 	                                  IID_IShellLink, reinterpret_cast<LPVOID*> (&shellLink))))
+ 		return {};
+@@ -405,13 +380,13 @@ void findFilesWithExt (const filesystem::path& path, const std::string& ext,
+ 				filesystem::path result;
+ 				if (checkVST3Package (p, &result))
+ 				{
+-					pathList.push_back (result.generic_u8string ());
++					pathList.push_back (result.generic_string ());
+ 					continue;
+ 				}
+ 				findFilesWithExt (cp, ext, pathList, recursive);
+ 			}
+ 			else
+-				pathList.push_back (cp.generic_u8string ());
++				pathList.push_back (cp.generic_string ());
+ 		}
+ 		else if (recursive)
+ 		{
+@@ -431,18 +406,18 @@ void findFilesWithExt (const filesystem::path& path, const std::string& ext,
+ 							filesystem::path result;
+ 							if (checkVST3Package (*resolvedLink, &result))
+ 							{
+-								pathList.push_back (result.generic_u8string ());
++								pathList.push_back (result.generic_string ());
+ 								continue;
+ 							}
+ 							findFilesWithExt (*resolvedLink, ext, pathList, recursive);
+ 						}
+ 						else
+-							pathList.push_back (resolvedLink->generic_u8string ());
++							pathList.push_back (resolvedLink->generic_string ());
+ 					}
+ 					else if (filesystem::is_directory (*resolvedLink))
+ 					{
+-						const auto& str = resolvedLink->generic_u8string ();
+-						if (cp.generic_u8string ().compare (0, str.size (), str.data (),
++						const auto& str = resolvedLink->generic_string ();
++						if (cp.generic_string ().compare (0, str.size (), str.data (),
+ 						                                    str.size ()) != 0)
+ 							findFilesWithExt (*resolvedLink, ext, pathList, recursive);
+ 					}
-- 
2.39.2





  parent reply	other threads:[~2023-04-25  9:31 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25  9:22 [bug#63065] [PATCH 0/18]: gnu: Add yabridgectl Sughosha via Guix-patches via
2023-04-25  9:25 ` [bug#63065] [PATCH 01/18] gnu: asio: Update to 1.24.0 Sughosha via Guix-patches via
2023-04-25  9:27 ` [bug#63065] [PATCH 02/18] gnu: Add bitsery Sughosha via Guix-patches via
2023-04-25  9:27 ` [bug#63065] [PATCH 03/18] gnu: Add function2 Sughosha via Guix-patches via
2023-04-25  9:28 ` [bug#63065] [PATCH 04/18] gnu: Add tomlplusplus Sughosha via Guix-patches via
2023-04-25  9:29 ` [bug#63065] [PATCH 05/18] gnu: Add clap Sughosha via Guix-patches via
2023-04-25  9:30 ` Sughosha via Guix-patches via [this message]
2023-04-25  9:30 ` [bug#63065] [PATCH 07/18] gnu: Add yabridge Sughosha via Guix-patches via
2023-04-25  9:31 ` [bug#63065] [PATCH 08/18] gnu: Add rust-scroll-derive-0.11 Sughosha via Guix-patches via
2023-04-25  9:31 ` [bug#63065] [PATCH 09/18] gnu: Add rust-scroll-0.11 Sughosha via Guix-patches via
2023-04-25  9:32 ` [bug#63065] [PATCH 10/18] gnu: Add rust-goblin-0.6 Sughosha via Guix-patches via
2023-04-25  9:33 ` [bug#63065] [PATCH 11/18] gnu: rust-libloading-0.7: Update to 0.7.4 Sughosha via Guix-patches via
2023-04-25  9:33 ` [bug#63065] [PATCH 12/18] gnu: Add rust-rustyline-derive-0.6 Sughosha via Guix-patches via
2023-04-25  9:34 ` [bug#63065] [PATCH 13/18] gnu: rust-rustyline-9: Update to 9.1.2 Sughosha via Guix-patches via
2023-04-25  9:35 ` [bug#63065] [PATCH 14/18] gnu: Add rust-promptly-0.3 Sughosha via Guix-patches via
2023-04-25  9:35 ` [bug#63065] [PATCH 15/18] gnu: Add rust-reflink-0.1 Sughosha via Guix-patches via
2023-04-25  9:36 ` [bug#63065] [PATCH 16/18] gnu: Add rust-ryu-0.2 Sughosha via Guix-patches via
2023-04-25  9:38 ` [bug#63065] [PATCH 17/18] gnu: Add rust-serde-jsonrc-0.1 Sughosha via Guix-patches via
2023-04-25  9:39 ` [bug#63065] [PATCH 18/18] gnu: Add yabridgectl Sughosha via Guix-patches via
2023-06-29 10:15 ` [bug#63065] [PATCH v2 00/16] gnu: Add yabridge and yabridgectl Sughosha via Guix-patches via
2023-06-29 10:16 ` [bug#63065] [PATCH v2 01/16] gnu: asio: Update to 1.28.0 Sughosha via Guix-patches via
2023-06-29 10:17 ` [bug#63065] [PATCH v2 02/16] gnu: Add bitsery Sughosha via Guix-patches via
2023-06-29 10:18 ` [bug#63065] [PATCH v2 03/16] gnu: Add function2 Sughosha via Guix-patches via
2023-06-29 10:19 ` [bug#63065] [PATCH v2 04/16] gnu: Add tomlplusplus Sughosha via Guix-patches via
2023-06-29 10:19 ` [bug#63065] [PATCH v2 05/16] gnu: Add clap Sughosha via Guix-patches via
2023-06-29 10:20 ` [bug#63065] [PATCH v2 06/16] gnu: Add yabridge Sughosha via Guix-patches via
2023-06-29 10:22 ` [bug#63065] [PATCH v2 07/16] gnu: Add rust-scroll-derive-0.11 Sughosha via Guix-patches via
2023-06-29 10:22 ` [bug#63065] [PATCH v2 08/16] gnu: Add rust-scroll-0.11 Sughosha via Guix-patches via
2023-06-29 10:23 ` [bug#63065] [PATCH v2 09/16] gnu: Add rust-goblin-0.6 Sughosha via Guix-patches via
2023-06-29 10:23 ` [bug#63065] [PATCH v2 10/16] gnu: Add rust-rustyline-derive-0.6 Sughosha via Guix-patches via
2023-06-29 10:24 ` [bug#63065] [PATCH v2 11/16] gnu: rust-rustyline-9: Update to 9.1.2 Sughosha via Guix-patches via
2023-06-29 10:24 ` [bug#63065] [PATCH v2 12/16] gnu: Add rust-promptly Sughosha via Guix-patches via
2023-06-29 10:25 ` [bug#63065] [PATCH v2 13/16] gnu: Add rust-reflink-0.1 Sughosha via Guix-patches via
2023-06-29 10:25 ` [bug#63065] [PATCH v2 14/16] gnu: Add rust-ryu-0.2 Sughosha via Guix-patches via
2023-06-29 10:26 ` [bug#63065] [PATCH v2 15/16] gnu: Add rust-serde-jsonrc-0.1 Sughosha via Guix-patches via
2023-06-29 10:27 ` [bug#63065] [PATCH v2 16/16] gnu: Add yabridgectl Sughosha via Guix-patches via
2023-06-29 11:15   ` [bug#63065] [PATCH v3 " Sughosha via Guix-patches via
2023-11-01  9:19 ` [bug#63065] [PATCH v4 0/7] " Sughosha via Guix-patches via
2023-11-01  9:19   ` [bug#63065] [PATCH v4 1/7] gnu: Add rust-rustyline-derive-0.6 Sughosha via Guix-patches via
2023-11-01  9:19   ` [bug#63065] [PATCH v4 2/7] gnu: rust-rustyline-9: Update to 9.1.2 Sughosha via Guix-patches via
2023-11-01  9:19   ` [bug#63065] [PATCH v4 3/7] gnu: Add rust-promptly Sughosha via Guix-patches via
2023-11-01  9:19   ` [bug#63065] [PATCH v4 4/7] gnu: Add rust-reflink-0.1 Sughosha via Guix-patches via
2023-11-01  9:19   ` [bug#63065] [PATCH v4 5/7] gnu: Add rust-ryu-0.2 Sughosha via Guix-patches via
2023-11-01  9:19   ` [bug#63065] [PATCH v4 6/7] gnu: Add rust-serde-jsonrc-0.1 Sughosha via Guix-patches via
2023-11-01  9:19   ` [bug#63065] [PATCH v4 7/7] gnu: Add yabridgectl Sughosha via Guix-patches via
2023-11-30 10:56 ` [bug#63065] [PATCH v5 0/7] " Sughosha via Guix-patches via
2023-11-30 10:57   ` [bug#63065] [PATCH v5 1/7] gnu: Add rust-rustyline-derive-0.6 Sughosha via Guix-patches via
2023-11-30 10:57   ` [bug#63065] [PATCH v5 2/7] gnu: rust-rustyline-9: Update to 9.1.2 Sughosha via Guix-patches via
2023-11-30 10:57   ` [bug#63065] [PATCH v5 3/7] gnu: Add rust-promptly-0.3 Sughosha via Guix-patches via
2023-11-30 10:57   ` [bug#63065] [PATCH v5 4/7] gnu: Add rust-reflink-0.1 Sughosha via Guix-patches via
2023-11-30 10:57   ` [bug#63065] [PATCH v5 5/7] gnu: Add rust-ryu-0.2 Sughosha via Guix-patches via
2023-11-30 10:57   ` [bug#63065] [PATCH v5 6/7] gnu: Add rust-serde-jsonrc-0.1 Sughosha via Guix-patches via
2023-11-30 10:57   ` [bug#63065] [PATCH v5 7/7] gnu: Add yabridgectl Sughosha via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='C1LmYLEAX0doKyopgqvNW7hyTYj63frcyP7k_9FiO2Eom8-5V5uZi_1CGHLgmzCCTpRowDfN9UqBdoU48MO7fBZe5JZ4_Pyj6A-U1SpGi3c=@proton.me' \
    --to=guix-patches@gnu.org \
    --cc=63065@debbugs.gnu.org \
    --cc=Sughosha@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.