Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C
2.7 KB
Raw Blame
#!/bin/sh
# Builds the simulator harness (sim/main.m): SpeedPitch.x and Sing.x generated by logos with the internal
# generator as the tweak builds them, Sing's model, separator and engine, in an app whose main executable is the
# harness, so the rebinding of AudioUnitSetProperty and AudioOutputUnitStart takes as it does in Spotify. VOICE is
# the voice laid over the chords (macOS's `say -o speech.aiff "..."`), bundled as voice.aiff.
#   THEOS=$HOME/theos VOICE=speech.aiff ./build-sim.sh
set -e
cd "$(dirname "$0")"
SRC=../../tweak/Sources
SING=$SRC/Shared/Sing
OUT=build/sim
rm -rf "$OUT"
mkdir -p "$OUT/gen" "$OUT/SingHarness.app"
"$THEOS/bin/logos.pl" -c generator=internal "$SRC/Shared/Player/SpeedPitch.x" > "$OUT/gen/SpeedPitch.m"
"$THEOS/bin/logos.pl" -c generator=internal "$SING/Sing.x" > "$OUT/gen/Sing.m"
SDK=$(xcrun --sdk iphonesimulator --show-sdk-path)
xcrun -sdk iphonesimulator clang -target arm64-apple-ios18.0-simulator -fobjc-arc -g -O1 -isysroot "$SDK" -Wno-deprecated-declarations \
    -I"$SRC" -I"$SING" -I"$SRC/Shared/Player" \
    sim/main.m ../scene.m "$OUT/gen/SpeedPitch.m" "$OUT/gen/Sing.m" "$SRC/Shared/Player/SGTimePitch.m" \
    "$SING/SGSingModel.m" "$SING/SGSingLoader.m" "$SING/SGSingSeparator.m" "$SING/SGSingEngine.m" "$SRC/Shared/AudioEffects/SGDSPReverb.m" \
    "$SRC/Core/SGRebind.m" "$SRC/Core/SGLog.m" "$SRC/Core/SGPrefs.m" "$SRC/Core/SGUIMode.m" "$SRC/Core/SGFlagForce.m" \
    -framework UIKit -framework QuartzCore -framework MediaPlayer -framework AudioToolbox -framework AVFoundation -framework Accelerate -framework CoreML -framework Foundation \
    -o "$OUT/SingHarness.app/SingHarness"
if [ -n "$VOICE" ]; then cp "$VOICE" "$OUT/SingHarness.app/voice.aiff"; fi
cat > "$OUT/SingHarness.app/Info.plist" <<'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleExecutable</key><string>SingHarness</string>
<key>CFBundleIdentifier</key><string>com.vojta.singharness</string>
<key>CFBundleName</key><string>SingHarness</string>
<key>CFBundleVersion</key><string>1</string>
<key>CFBundleShortVersionString</key><string>1.0</string>
<key>UILaunchScreen</key><dict/>
<key>UIBackgroundModes</key><array><string>audio</string></array>
<key>UIApplicationSceneManifest</key><dict>
  <key>UIApplicationSupportsMultipleScenes</key><false/>
  <key>UISceneConfigurations</key><dict>
    <key>UIWindowSceneSessionRoleApplication</key><array><dict>
      <key>UISceneConfigurationName</key><string>Default</string>
      <key>UISceneDelegateClassName</key><string>SGRHarnessScene</string>
    </dict></array>
  </dict>
</dict>
</dict></plist>
PLIST
echo "built $OUT/SingHarness.app"