diff --git a/docs/CMake API.md b/docs/CMake API.md index 450e573781..5328f44cd5 100644 --- a/docs/CMake API.md +++ b/docs/CMake API.md @@ -480,6 +480,13 @@ attributes directly to these creation functions, rather than adding them later. - `AU_SANDBOX_SAFE` - May be either TRUE or FALSE. Adds the appropriate entries to an AU plugin's Info.plist. +- `SUPPRESS_AU_PLIST_RESOURCE_USAGE` + - May be either TRUE or FALSE. Defaults to FALSE. Set this to TRUE to disable the `resourceUsage` + key in the target's plist. This is useful for AU plugins that must access resources which cannot + be declared in the resourceUsage block, such as UNIX domain sockets. In particular, + PACE-protected AU plugins may require this option to be enabled in order for the plugin to load + in GarageBand. + - `AAX_CATEGORY` - Should be one of: `AAX_ePlugInCategory_None`, `AAX_ePlugInCategory_EQ`, `AAX_ePlugInCategory_Dynamics`, `AAX_ePlugInCategory_PitchShift`, `AAX_ePlugInCategory_Reverb`, diff --git a/extras/Build/CMake/JUCEUtils.cmake b/extras/Build/CMake/JUCEUtils.cmake index d5b9d7adc2..73a450e853 100644 --- a/extras/Build/CMake/JUCEUtils.cmake +++ b/extras/Build/CMake/JUCEUtils.cmake @@ -766,6 +766,7 @@ function(_juce_write_configure_time_info target) _juce_append_target_property(file_content PLUGIN_AU_MAIN_TYPE ${target} JUCE_AU_MAIN_TYPE_CODE) _juce_append_target_property(file_content IS_AU_SANDBOX_SAFE ${target} JUCE_AU_SANDBOX_SAFE) _juce_append_target_property(file_content IS_PLUGIN_SYNTH ${target} JUCE_IS_SYNTH) + _juce_append_target_property(file_content SUPPRESS_AU_PLIST_RESOURCE_USAGE ${target} JUCE_SUPPRESS_AU_PLIST_RESOURCE_USAGE) _juce_append_target_property(file_content HARDENED_RUNTIME_ENABLED ${target} JUCE_HARDENED_RUNTIME_ENABLED) _juce_append_target_property(file_content APP_SANDBOX_ENABLED ${target} JUCE_APP_SANDBOX_ENABLED) _juce_append_target_property(file_content APP_SANDBOX_INHERIT ${target} JUCE_APP_SANDBOX_INHERIT) @@ -1728,6 +1729,8 @@ function(_juce_set_fallback_properties target) _juce_set_property_if_not_set(${target} AU_SANDBOX_SAFE FALSE) + _juce_set_property_if_not_set(${target} SUPPRESS_AU_PLIST_RESOURCE_USAGE FALSE) + _juce_set_property_if_not_set(${target} HARDENED_RUNTIME_ENABLED NO) _juce_set_property_if_not_set(${target} APP_SANDBOX_ENABLED NO) _juce_set_property_if_not_set(${target} APP_SANDBOX_INHERIT NO) @@ -1910,6 +1913,7 @@ function(_juce_initialise_target target) AU_MAIN_TYPE AU_EXPORT_PREFIX AU_SANDBOX_SAFE + SUPPRESS_AU_PLIST_RESOURCE_USAGE AAX_CATEGORY PLUGINHOST_AU # Set this true if you want to host AU plugins USE_LEGACY_COMPATIBILITY_PLUGIN_CODE diff --git a/extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp b/extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp index 18826097cb..8b23e0ee59 100644 --- a/extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp +++ b/extras/Build/juce_build_tools/utils/juce_PlistOptions.cpp @@ -302,7 +302,7 @@ namespace build_tools { addPlistDictionaryKey (*dict, "sandboxSafe", true); } - else + else if (! suppressResourceUsage) { dict->createNewChildElement ("key")->addTextElement ("resourceUsage"); auto* resourceUsageDict = dict->createNewChildElement ("dict"); diff --git a/extras/Build/juce_build_tools/utils/juce_PlistOptions.h b/extras/Build/juce_build_tools/utils/juce_PlistOptions.h index 4f7a55d569..780dbd9eb5 100644 --- a/extras/Build/juce_build_tools/utils/juce_PlistOptions.h +++ b/extras/Build/juce_build_tools/utils/juce_PlistOptions.h @@ -89,6 +89,7 @@ namespace build_tools String auMainType; bool isAuSandboxSafe = false; bool isPluginSynth = false; + bool suppressResourceUsage = false; private: void write (MemoryOutputStream&) const; diff --git a/extras/Build/juceaide/Main.cpp b/extras/Build/juceaide/Main.cpp index 8058912766..b5d5144807 100644 --- a/extras/Build/juceaide/Main.cpp +++ b/extras/Build/juceaide/Main.cpp @@ -260,6 +260,7 @@ juce::build_tools::PlistOptions parsePlistOptions (const juce::File& file, updateField ("PLUGIN_AU_MAIN_TYPE", result.auMainType); updateField ("IS_AU_SANDBOX_SAFE", result.isAuSandboxSafe); updateField ("IS_PLUGIN_SYNTH", result.isPluginSynth); + updateField ("SUPPRESS_AU_PLIST_RESOURCE_USAGE", result.suppressResourceUsage); updateField ("BUNDLE_ID", result.bundleIdentifier); updateField ("ICON_FILE", result.iconFile); diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index 98b840002d..f918ef0f7b 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -181,7 +181,8 @@ public: keepCustomXcodeSchemesValue (settings, Ids::keepCustomXcodeSchemes, getUndoManager()), useHeaderMapValue (settings, Ids::useHeaderMap, getUndoManager()), customLaunchStoryboardValue (settings, Ids::customLaunchStoryboard, getUndoManager()), - exporterBundleIdentifierValue (settings, Ids::bundleIdentifier, getUndoManager()) + exporterBundleIdentifierValue (settings, Ids::bundleIdentifier, getUndoManager()), + suppressPlistResourceUsage (settings, Ids::suppressPlistResourceUsage, getUndoManager()) { if (iOS) { @@ -268,6 +269,8 @@ public: bool isDocumentBrowserEnabled() const { return uiSupportsDocumentBrowserValue.get(); } bool isStatusBarHidden() const { return uiStatusBarHiddenValue.get(); } + bool getSuppressPlistResourceUsage() const { return suppressPlistResourceUsage.get(); } + String getDocumentExtensionsString() const { return documentExtensionsValue.get(); } bool shouldKeepCustomXcodeSchemes() const { return keepCustomXcodeSchemesValue.get(); } @@ -567,6 +570,12 @@ public: props.add (new TextPropertyComponent (pListPrefixHeaderValue, "PList Prefix Header", 512, false), "Header file containing definitions used in plist file (see PList Preprocess)."); + props.add (new ChoicePropertyComponent (suppressPlistResourceUsage, "Suppress AudioUnit Plist resourceUsage Key"), + "Suppress the resourceUsage key in the target's generated Plist. This is useful for AU" + " plugins that must access resources which cannot be declared in the resourceUsage block, such" + " as UNIX domain sockets. In particular, PACE-protected AU plugins may require this option to be enabled" + " in order for the plugin to load in GarageBand."); + props.add (new TextPropertyComponent (extraFrameworksValue, "Extra System Frameworks", 2048, false), "A comma-separated list of extra system frameworks that should be added to the build. " "(Don't include the .framework extension in the name)" @@ -1742,6 +1751,7 @@ public: options.auMainType = owner.project.getAUMainTypeString(); options.isAuSandboxSafe = owner.project.isAUSandBoxSafe(); options.isPluginSynth = owner.project.isPluginSynth(); + options.suppressResourceUsage = owner.getSuppressPlistResourceUsage(); options.write (infoPlistFile); } @@ -1951,7 +1961,7 @@ private: uiFileSharingEnabledValue, uiSupportsDocumentBrowserValue, uiStatusBarHiddenValue, documentExtensionsValue, iosInAppPurchasesValue, iosContentSharingValue, iosBackgroundAudioValue, iosBackgroundBleValue, iosPushNotificationsValue, iosAppGroupsValue, iCloudPermissionsValue, iosDevelopmentTeamIDValue, iosAppGroupsIDValue, keepCustomXcodeSchemesValue, useHeaderMapValue, customLaunchStoryboardValue, - exporterBundleIdentifierValue; + exporterBundleIdentifierValue, suppressPlistResourceUsage; static String sanitisePath (const String& path) { diff --git a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h index 52252d2ac6..b2cc932936 100644 --- a/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h +++ b/extras/Projucer/Source/Utility/Helpers/jucer_PresetIDs.h @@ -357,6 +357,7 @@ namespace Ids DECLARE_ID (pluginAAXDisableMultiMono); DECLARE_ID (pluginVSTNumMidiInputs); DECLARE_ID (pluginVSTNumMidiOutputs); + DECLARE_ID (suppressPlistResourceUsage); DECLARE_ID (exporters); DECLARE_ID (website); DECLARE_ID (mainClass);