Flatten nested Presets/<category>/*.xml into a single dir

gin's loadDirectory() doesn't recurse, and the legacy BinaryData flow stored
presets flat in the user dir. Installer/build.sh now stages a flat copy under
Installer/_flat_presets/ which the Inno Setup script and macOS pkg both
consume; CMakeLists installs the same flat set on Linux.
This commit is contained in:
Roland Rabien 2026-04-29 13:43:18 -07:00
commit 8e068f7104
4 changed files with 21 additions and 6 deletions

View file

@ -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/<category>/*.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

View file

@ -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