Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BSD patches #881

Closed
wants to merge 1 commit into from
Closed

Conversation

yurivict
Copy link

This is a set of patches that make JUCE build on FreeBSD. Other BSDs should be similar.

On FreeBSD JUCE builds and seems to run fine with these patches.

The purpose of this PR is not to ask for BSD platforms to be officially supported, but to make building JUCE easier on BSD systems.

@tpoole
Copy link
Member

tpoole commented Mar 29, 2021

I've added more substantial FreeBSD support here: 79fbde7

This does not include the changes you've made to the embedded VST3 SDK. For those to be part of the JUCE distribution we need an official release of the VST3 SDK to support BSD and we will then update our copy of the SDK.

@yurivict
Copy link
Author

[...] we need an official release of the VST3 SDK to support BSD [...]

VST3 SDK port exists on FreeBSD. Is it possible to add a cmake variable to use externally installed VST3 SDK?

Ports exist in several distros (https://repology.org/project/vst3sdk/versions),

@tpoole
Copy link
Member

tpoole commented Apr 1, 2021

I've added || JUCE_BSD to all the corresponding preprocessor macros in the VST3 client and format files. You can use an external VST3 SDK following this commit: 429550f.

@tpoole tpoole closed this Apr 1, 2021
@yurivict
Copy link
Author

@tpoole You only merged part of the patch. Most of the affected files remain unpatched, for example:

diff -ru JUCE/extras/Projucer/Source/Application/jucer_Application.h work/JUCE-f37e9a1/extras/Projucer/Source/Application/jucer_Application.h
--- JUCE/extras/Projucer/Source/Application/jucer_Application.h 2021-04-26 02:33:47.612541000 -0700
+++ work/JUCE-f37e9a1/extras/Projucer/Source/Application/jucer_Application.h    2021-03-26 01:19:54.000000000 -0700
@@ -220,7 +220,7 @@
     std::unique_ptr<AlertWindow> demoRunnerAlert;^M
     bool hasScannedForDemoRunnerExecutable = false, hasScannedForDemoRunnerProject = false;^M
     File lastJUCEPath, lastDemoRunnerExectuableFile, lastDemoRunnerProjectFile;^M
-   #if JUCE_LINUX^M
+   #if JUCE_LINUX || JUCE_BSD^M
     ChildProcess makeProcess;^M
    #endif^M
 ^M
diff -ru JUCE/extras/Projucer/Source/Application/jucer_CommonHeaders.h work/JUCE-f37e9a1/extras/Projucer/Source/Application/jucer_CommonHeaders.h
--- JUCE/extras/Projucer/Source/Application/jucer_CommonHeaders.h       2021-04-26 02:33:47.613563000 -0700
+++ work/JUCE-f37e9a1/extras/Projucer/Source/Application/jucer_CommonHeaders.h  2021-03-26 01:19:54.000000000 -0700
@@ -39,6 +39,7 @@
         windows = 0,^M
         osx,^M
         linux,^M
+        bsd,^M
         unknown^M
     };^M
 ^M
@@ -50,6 +51,8 @@
         return osx;^M
        #elif JUCE_LINUX^M
         return linux;^M
+       #elif JUCE_BSD^M
+        return bsd;^M
        #else^M
         return unknown;^M
        #endif^M
diff -ru JUCE/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp work/JUCE-f37e9a1/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp
--- JUCE/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp    2021-04-26 02:33:47.634616000 -0700
+++ work/JUCE-f37e9a1/extras/Projucer/Source/Licenses/jucer_LicenseController.cpp       2021-03-26 01:19:54.000000000 -0700
@@ -143,7 +143,7 @@
     thread.reset();^M
     updateState ({});^M
 ^M
-   #if ! JUCE_LINUX^M
+   #if ! (JUCE_LINUX || JUCE_BSD)^M
     WebBrowserComponent::clearCookies();^M
    #endif^M
 ^M
@@ -187,7 +187,7 @@
     }^M
     else^M
     {^M
-       #if ! JUCE_LINUX^M
+       #if ! (JUCE_LINUX || JUCE_BSD)^M
         WebBrowserComponent::clearCookies();^M
        #endif^M
 ^M
diff -ru JUCE/modules/juce_audio_devices/midi_io/juce_MidiDevices.h work/JUCE-f37e9a1/modules/juce_audio_devices/midi_io/juce_MidiDevices.h
--- JUCE/modules/juce_audio_devices/midi_io/juce_MidiDevices.h  2021-04-26 02:33:47.682715000 -0700
+++ work/JUCE-f37e9a1/modules/juce_audio_devices/midi_io/juce_MidiDevices.h     2021-03-26 01:19:54.000000000 -0700
@@ -108,7 +108,7 @@
     */^M
     static std::unique_ptr<MidiInput> openDevice (const String& deviceIdentifier, MidiInputCallback* callback);^M
 ^M
-   #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN^M
+   #if JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_IOS || DOXYGEN^M
     /** This will try to create a new midi input device (only available on Linux, macOS and iOS).^M
 ^M
         This will attempt to create a new midi input device with the specified name for other^M
@@ -268,7 +268,7 @@
     */^M
     static std::unique_ptr<MidiOutput> openDevice (const String& deviceIdentifier);^M
 ^M
-   #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN^M
+   #if JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_IOS || DOXYGEN^M
     /** This will try to create a new midi output device (only available on Linux, macOS and iOS).^M
 ^M
         This will attempt to create a new midi output device with the specified name that other^M

@tpoole
Copy link
Member

tpoole commented Apr 26, 2021

What branch are you diffing against? The changes are on the develop branch. They have not yet been merged to master.

@yurivict
Copy link
Author

I see, thanks!

@yurivict
Copy link
Author

yurivict commented Mar 5, 2023

@tpoole

7.0.5 still doesn't have some BSD patches that were submitted with this PR.

Particularly, the change in modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h.

People ask why doesn't JUCE build with VST here. I am not sure what to tell them.

@probonopd
Copy link

probonopd commented Mar 5, 2023

This does not include the changes you've made to the embedded VST3 SDK. For those to be part of the JUCE distribution we need an official release of the VST3 SDK to support BSD and we will then update our copy of the SDK.

@tpoole I think it would be sufficient if JUCE could work with the custom VST3 SDK at /usr/local/include/vst3sdk/ on FreeBSD systems. Unfortunately, when I set Projucer (JUCE 7.0.5) "JUCE_CUSTOM_VST3_SDK" to "Enabled" and /usr/local/include/vst3sdk under "Header Search Paths", then I get compilation errors described there.

@yurivict
Copy link
Author

yurivict commented Mar 5, 2023

@tpoole
Copy link
Member

tpoole commented Mar 6, 2023

People ask why doesn't JUCE build with VST here. I am not sure what to tell them.

Our previous statement in this conversation still applies: "For those to be part of the JUCE distribution we need an official release of the VST3 SDK to support BSD and we will then update our copy of the SDK."

We will not include a modified version of the VST3 SDK with JUCE, particularly to support a platform that the VST3 SDK makes no claims to support. We have a mechanism, JUCE_CUSTOM_VST3_SDK, to use a third-party VST3 SDK in cases like this.

This package, https://www.freshports.org/audio/vst3sdk/, looks like it should be useful, but the structure of the contents means that it is not possible to use this as a replacement for the official VST3 distribution. Am I missing something important?

But after this it still fails to build with some obscure errors.

Are you testing the tip of the develop branch? There shouldn't be any errors in non-VST3 SDK JUCE framework code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants