diff --git a/.gitignore b/.gitignore index addd9fd..9d078de 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,6 @@ JuceLibraryCode bin Installer/macOS/bin Installer/win/bin +Installer/_flat_presets .DS_Store .claude \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 0262d5c..c5793ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,10 +268,12 @@ if (UNIX AND NOT APPLE) DESTINATION lib/clap COMPONENT CLAP) - install (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugin/Resources/Presets/" + # Presets ship flat — gin's loadDirectory doesn't recurse, and the pre-installer + # BinaryData flow stored them flat in the user dir. + file (GLOB_RECURSE _preset_xmls "${CMAKE_CURRENT_SOURCE_DIR}/plugin/Resources/Presets/*.xml") + install (FILES ${_preset_xmls} DESTINATION share/SocaLabs/${PLUGIN_NAME}/Presets - COMPONENT Resources - FILES_MATCHING PATTERN "*.xml") + COMPONENT Resources) install (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/plugin/Resources/WavetablesFLAC/" DESTINATION share/SocaLabs/${PLUGIN_NAME}/Wavetables diff --git a/Installer/build.sh b/Installer/build.sh index 482d42e..38c6d9f 100755 --- a/Installer/build.sh +++ b/Installer/build.sh @@ -29,6 +29,16 @@ mkdir -p "$PROJECT_ROOT/Installer/$PLATFORM/bin" rm -Rf "$PROJECT_ROOT/bin" mkdir -p "$PROJECT_ROOT/bin" +# +# Flatten the nested Presets//*.xml tree into a single flat directory. +# gin's loadDirectory() doesn't recurse, and the legacy BinaryData flow stored +# presets flat in the user directory — keeping flat matches what users see. +# +FLAT_PRESETS="$PROJECT_ROOT/Installer/_flat_presets" +rm -Rf "$FLAT_PRESETS" +mkdir -p "$FLAT_PRESETS" +find "$PROJECT_ROOT/plugin/Resources/Presets" -name "*.xml" -type f -exec cp {} "$FLAT_PRESETS/" \; + ############################################################ # macOS — pkgbuild + productbuild ############################################################ @@ -79,8 +89,9 @@ if [ "$PLATFORM" = "macOS" ]; then cp -RL "$ART_DIR/AU/$PLUGIN.component" "$STAGE/au/" cp -RL "$ART_DIR/CLAP/$PLUGIN.clap" "$STAGE/clap/" - # Resources component: factory Wavetables and Presets - cp -R "$PROJECT_ROOT/plugin/Resources/Presets" "$STAGE/resources/Library/Audio/Presets/$VENDOR/$PLUGIN/Presets" + # Resources component: factory Wavetables and Presets (presets flattened above) + mkdir -p "$STAGE/resources/Library/Audio/Presets/$VENDOR/$PLUGIN/Presets" + cp "$FLAT_PRESETS/"*.xml "$STAGE/resources/Library/Audio/Presets/$VENDOR/$PLUGIN/Presets/" cp -R "$PROJECT_ROOT/plugin/Resources/WavetablesFLAC" "$STAGE/resources/Library/Audio/Presets/$VENDOR/$PLUGIN/Wavetables" find "$STAGE/resources" -name ".DS_Store" -delete diff --git a/Installer/win/Wavetable.iss b/Installer/win/Wavetable.iss index 9978fe8..eaf49e4 100644 --- a/Installer/win/Wavetable.iss +++ b/Installer/win/Wavetable.iss @@ -71,5 +71,6 @@ Source: "bin\VST3\Wavetable.vst3\*"; DestDir: "{commoncf64}\VST3\Wavetable.vst3\ Source: "bin\CLAP\Wavetable.clap"; DestDir: "{commoncf64}\CLAP"; Flags: ignoreversion overwritereadonly; Components: clap ; Factory content (Wavetables, Presets) → C:\ProgramData\SocaLabs\Wavetable\ -Source: "..\..\plugin\Resources\Presets\*.xml"; DestDir: "{commonappdata}\SocaLabs\Wavetable\Presets\"; Flags: ignoreversion; Components: resources +; Presets are flattened by Installer/build.sh into Installer/_flat_presets/. +Source: "..\_flat_presets\*.xml"; DestDir: "{commonappdata}\SocaLabs\Wavetable\Presets\"; Flags: ignoreversion; Components: resources Source: "..\..\plugin\Resources\WavetablesFLAC\*.wt2048"; DestDir: "{commonappdata}\SocaLabs\Wavetable\Wavetables\"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: resources