From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aDOOCOedR2TCEwEASxT56A (envelope-from ) for ; Tue, 25 Apr 2023 11:31:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iBlMCOedR2R2AgAAauVa8A (envelope-from ) for ; Tue, 25 Apr 2023 11:31:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C8F1241E64 for ; Tue, 25 Apr 2023 11:31:18 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=proton.me header.s=protonmail header.b=HO5LqSnp; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682415078; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2IJZZmPbxzaKUIybrEQuC/BOHzf3pbijbT/AHoF959Q=; b=pT27jrpX88a96C0IGnSmBdWrsUuNHusXcV3t/myIN+t7nhY18fE/pc6JfbxnT00Wnb2FwN 7OrFSTjzFXwIo98z/SCpfCiNamnqHUiS3nK7bKsNCsBTnrGVDWkgLKRvNRlRuUPy9uKohU +64d2XeyOLqxq6nBPqQyQBcSRkQvY7nAMMRWtBNB6GeGhmkRi07APbIpybY8aWqJpmYOKO gzuOL2LYKJruUGtZkpHnWLj3k933ICwjiCuH1ia0eabUGSswqJscRqCiP/+5t6qN0PEB00 DpodgbpVxFMeVDMPYKff5bEehgbudjBQ7fbb2erDakfUjqe1SUv3MfjKdc0p+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=proton.me header.s=protonmail header.b=HO5LqSnp; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682415078; a=rsa-sha256; cv=none; b=JzqQ94PqFvvTTEScZ2+CEg7maPiUOBBecHNqj7XCW1W6QHIcEXwdJvXS1VNys1v0Fcqp1E BdYZlKycg8cWdbaS349x/7tBxMB9qKJWpiY2hQhECs3QWXJFOIfR7qaiNDnLsAryASkm5i UHNhV11kIndG4sqbwZz1JUNY0tGTxG/BPpJto2DjqcnBYv3V1DpC7qsbuttECzS695JznQ BQhtP5DQUsZwyQK2LSmbyBkONspU8RhaQYdB7kdQpwClFTEvDJSqyVlGcVRkD/S8XheyFf 8cvYkKTKzvzYarlN10f8VwNkwZBgHGXx5EF5IC3juQTAY5os5OIZzzhq5MBK3A== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prF0q-0002Wm-KD; Tue, 25 Apr 2023 05:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prF0p-0002WL-Ad for guix-patches@gnu.org; Tue, 25 Apr 2023 05:31:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prF0p-00079x-2F for guix-patches@gnu.org; Tue, 25 Apr 2023 05:31:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prF0n-0005yG-Ty for guix-patches@gnu.org; Tue, 25 Apr 2023 05:31:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63065] [PATCH 06/18] gnu: Add vst3sdk. References: In-Reply-To: Resent-From: Sughosha Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 25 Apr 2023 09:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63065 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "63065@debbugs.gnu.org" <63065@debbugs.gnu.org> Received: via spool by 63065-submit@debbugs.gnu.org id=B63065.168241503722915 (code B ref 63065); Tue, 25 Apr 2023 09:31:01 +0000 Received: (at 63065) by debbugs.gnu.org; 25 Apr 2023 09:30:37 +0000 Received: from localhost ([127.0.0.1]:51333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prF0L-0005xS-Qo for submit@debbugs.gnu.org; Tue, 25 Apr 2023 05:30:37 -0400 Received: from mail-4325.protonmail.ch ([185.70.43.25]:41773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prF0G-0005x9-N9 for 63065@debbugs.gnu.org; Tue, 25 Apr 2023 05:30:32 -0400 Date: Tue, 25 Apr 2023 09:30:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1682415019; x=1682674219; bh=2IJZZmPbxzaKUIybrEQuC/BOHzf3pbijbT/AHoF959Q=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=HO5LqSnpqWJ5wMUarikruA3kmojlD/so+ZqXIBbJxJXs7v+NcUDRtEn8TVNcw5vUp JoymCwR+bCecyFYLlyukt4nOzoLyp1t8i27U1cDPxKFnutaAT6M5qEooYo5FOHPRnk IusONI58zPMYpfazoXIZBgbhxIMbsLqV3QvqVBmhjnaBqKCuD3AyeU2kTIQwDPJ4cI ufDR/mSHFpHcAZy80DwlD8XkTUjsQYIJk1/SBi/knfmHtZgkFg4Kr7w7mGfNdEmP9o Vt4MEpJZ/uyIEHe8WvUo2ZcrEguWdzlf7uDVBLifED6TQxBj6XC0aji8I0f1/fdBGd 6XYUk7ic2Pdaw== Message-ID: Feedback-ID: 45211691:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Sughosha X-ACL-Warn: , Sughosha via Guix-patches From: Sughosha via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: UNKNOWN X-Migadu-Spam-Score: -1.05 X-Spam-Score: -1.05 X-Migadu-Queue-Id: C8F1241E64 X-Migadu-Scanner: in3.migadu.com X-TUID: CnAWr94Rywxz * 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-compil= ation.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 =3D=09=09=09=09=09=09\ %D%/packages/patches/vtk-7-gcc-10-compat.patch=09=09\ %D%/packages/patches/vtk-7-hdf5-compat.patch=09=09=09\ %D%/packages/patches/vtk-7-python-compat.patch=09=09\ + %D%/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.patch=09\ %D%/packages/patches/wacomtablet-add-missing-includes.patch=09\ %D%/packages/patches/wacomtablet-qt5.15.patch=09=09=09\ %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch=09\ 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))) =20 +(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 variabl= e? + (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_s= dk + ;; and vstgui + license:bsd-3)))) + (define-public patchage (package (name "patchage") diff --git a/gnu/packages/patches/vst3sdk-3.7.7-allow-winelib-compilation.p= atch 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 + #endif +-#define vsnprintf _vsnprintf +-#define snprintf _snprintf +=20 + #elif SMTG_OS_MACOS + #include +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 */ + //-----------------------------------------------------------------------= ----- +=20 ++// 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=09// if c++11 unicode string literals + =09#define SMTG_CPP11_CAT_PRIVATE_DONT_USE(a,b)=09=09=09a ## 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__) + =09=09#define SMTG_ALWAYS_INLINE=09__inline__ __attribute__((__always_inl= ine__)) + =09=09#define SMTG_NEVER_INLINE __attribute__((noinline)) + =09#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 @@ +=20 + #endif +=20 ++#ifdef __WINE__ ++#include ++#endif ++ + //-----------------------------------------------------------------------= - + namespace Steinberg { +=20 +@@ -173,7 +177,7 @@ bool UString::scanFloat (double& value) const + bool UString::printFloat (double value, int32 precision) + { + #if SMTG_OS_WINDOWS +-=09return swprintf ((wchar_t*)thisBuffer, L"%.*lf", precision, value) != =3D -1; ++=09return swprintf ((wchar_t*)thisBuffer, thisSize, L"%.*lf", precision, = value) !=3D -1; + #elif SMTG_OS_MACOS + =09bool result =3D false; + =09CFStringRef cfStr =3D 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 +-=09return swprintf ((wchar_t*)thisBuffer, L"%I64d", value) !=3D -1; ++=09return swprintf ((wchar_t*)thisBuffer, thisSize, L"%I64d", value) !=3D= -1; +=20 + #elif SMTG_OS_MACOS + =09CFStringRef cfStr =3D CFStringCreateWithFormat (0, 0, CFSTR("%lld"), v= alue); +Submodule public.sdk contains modified content +diff --git a/public.sdk/source/common/systemclipboard_win32.cpp b/public.s= dk/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) + =09{ + =09=09if (auto* data =3D static_cast (GlobalLock (memory))) + =09=09{ +-#if defined(__MINGW32__) ++#if defined(__WINE__) + =09=09=09memcpy (data, wideStr.data (), byteSize); + #else + =09=09=09memcpy_s (data, byteSize, wideStr.data (), byteSize); +diff --git a/public.sdk/source/vst/hosting/module_win32.cpp b/public.sdk/s= ource/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 + #include +=20 +-#if SMTG_CPP17 +- +-#if __has_include() +-#define USE_FILESYSTEM 1 +-#elif __has_include() +-#define USE_FILESYSTEM 0 +-#endif +- +-#else // !SMTG_CPP17 +- +-#define USE_FILESYSTEM 0 +- +-#endif // SMTG_CPP17 +- +-#if USE_FILESYSTEM =3D=3D 1 +- +-#include +-namespace filesystem =3D std::filesystem; +- +-#else // USE_FILESYSTEM =3D=3D 0 +- +-// The header is deprecated. It is superseded b= y the C++17 +-// header. You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WA= RNING to silence the +-// warning, otherwise the build will fail in VS2019 16.3.0 +-#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING +-#include +-namespace filesystem =3D std::experimental::filesystem; +- +-#endif // USE_FILESYSTEM ++// `std::filesystem` doesn't work correctly with wineg++, resulting in we= ird ++// memory errors. This library is a drop-in replacement. ++#include ++namespace filesystem =3D ghc::filesystem; +=20 + #pragma comment(lib, "Shell32") +=20 +@@ -320,7 +295,7 @@ VST3::Optional resolveShellLink (con= st filesystem::path& p) + #elif USE_OLE + =09Ole::instance (); +=20 +-=09IShellLink* shellLink =3D nullptr; ++=09IShellLinkW* shellLink =3D nullptr; + =09if (!SUCCEEDED (CoCreateInstance (CLSID_ShellLink, nullptr, CLSCTX_INP= ROC_SERVER, + =09 IID_IShellLink, reinterpret_cast (&shellLink)))) + =09=09return {}; +@@ -405,13 +380,13 @@ void findFilesWithExt (const filesystem::path& path,= const std::string& ext, + =09=09=09=09filesystem::path result; + =09=09=09=09if (checkVST3Package (p, &result)) + =09=09=09=09{ +-=09=09=09=09=09pathList.push_back (result.generic_u8string ()); ++=09=09=09=09=09pathList.push_back (result.generic_string ()); + =09=09=09=09=09continue; + =09=09=09=09} + =09=09=09=09findFilesWithExt (cp, ext, pathList, recursive); + =09=09=09} + =09=09=09else +-=09=09=09=09pathList.push_back (cp.generic_u8string ()); ++=09=09=09=09pathList.push_back (cp.generic_string ()); + =09=09} + =09=09else if (recursive) + =09=09{ +@@ -431,18 +406,18 @@ void findFilesWithExt (const filesystem::path& path,= const std::string& ext, + =09=09=09=09=09=09=09filesystem::path result; + =09=09=09=09=09=09=09if (checkVST3Package (*resolvedLink, &result)) + =09=09=09=09=09=09=09{ +-=09=09=09=09=09=09=09=09pathList.push_back (result.generic_u8string ()); ++=09=09=09=09=09=09=09=09pathList.push_back (result.generic_string ()); + =09=09=09=09=09=09=09=09continue; + =09=09=09=09=09=09=09} + =09=09=09=09=09=09=09findFilesWithExt (*resolvedLink, ext, pathList, recu= rsive); + =09=09=09=09=09=09} + =09=09=09=09=09=09else +-=09=09=09=09=09=09=09pathList.push_back (resolvedLink->generic_u8string (= )); ++=09=09=09=09=09=09=09pathList.push_back (resolvedLink->generic_string ())= ; + =09=09=09=09=09} + =09=09=09=09=09else if (filesystem::is_directory (*resolvedLink)) + =09=09=09=09=09{ +-=09=09=09=09=09=09const auto& str =3D resolvedLink->generic_u8string (); +-=09=09=09=09=09=09if (cp.generic_u8string ().compare (0, str.size (), str= .data (), ++=09=09=09=09=09=09const auto& str =3D resolvedLink->generic_string (); ++=09=09=09=09=09=09if (cp.generic_string ().compare (0, str.size (), str.d= ata (), + =09=09=09=09=09=09 str.size ()) !=3D 0= ) + =09=09=09=09=09=09=09findFilesWithExt (*resolvedLink, ext, pathList, recu= rsive); + =09=09=09=09=09} --=20 2.39.2