Islet/tools/build-arch
astar76 c88455c759 Islet 0.7.6: a Dynamic Island for notched iPhones
SpringBoard tweak for the iPhone XR on iOS 18.7.1 (Dopamine rootless),
built without Theos using the swift.org clang and linked on the phone.

The island shows music with Apple's audio analyzer and live lyrics, timers,
calls, flashlight, screen recording, accessories and their batteries, calendar,
notifications with actions, and system popups, in portrait and landscape.
Includes a Settings page, a Watch ping hook, an offscreen self test and the
tools that capture the showcase video.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:03:58 -06:00

24 lines
1.6 KiB
Shell
Executable file

#!/bin/bash
# build-arch <arch> <kind:dylib|mini|exe> <out> <srcs...> : compile locally (swift.org clang + iPhoneOS SDK), link with ld64 on the phone.
set -euo pipefail
arch=$1 kind=$2 out=$3; shift 3
SWIFT=${SWIFT:-$HOME/.local/opt/swift/usr/bin}
SDK=${SDK:-$HOME/.local/opt/dl/sdk18/iPhoneOS18.6.sdk}
PH=${IPHONE:-mobile@192.168.1.94}; KEY=${IPHONE_KEY:-$HOME/.ssh/iphone_key}
RSDK=/var/mobile/mulberry-build/iPhoneOS18.6.sdk
S=(ssh -i "$KEY" -o BatchMode=yes -o ControlMaster=auto -o ControlPersist=60 -o ControlPath="$HOME/.ssh/cm-islet-%r@%h" "$PH")
tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT
objs=()
for s in "$@"; do
o=$tmp/$(basename "$s").o
"$SWIFT/clang" -target $arch-apple-ios15.0 -isysroot "$SDK" -fobjc-arc -fmodules -O2 -Wall -Wno-deprecated-declarations -Wno-arc-performSelector-leaks -Wno-unguarded-availability-new -Wno-format-security ${EXTRA_CFLAGS:-} -DISLET_VERSION="\"$(cat "$(dirname "$0")/../VERSION")\"" -c "$s" -o "$o"
objs+=("$o")
done
job=/var/mobile/islet-build/$$; "${S[@]}" "mkdir -p $job"
tar -cf - -C "$tmp" . | "${S[@]}" "tar -xf - -C $job"
extra=""; [ "$kind" = dylib ] && extra="-dylib -install_name @rpath/$(basename $out)"
libs="-framework Foundation -framework UIKit -framework QuartzCore -framework CoreGraphics -framework AVFoundation -framework MediaPlayer -framework Network"
[ "$kind" = mini ] && { extra="-dylib -install_name @rpath/$(basename $out)"; libs="-framework Foundation"; } # for daemons: no UIKit
"${S[@]}" "cd $job && ld64 -arch $arch -platform_version ios 15.0 18.6 -syslibroot $RSDK $extra *.o \
$libs -lobjc -lSystem -o out && ldid -S out" 1>&2
"${S[@]}" "cat $job/out; rm -rf $job" > "$out"; chmod +x "$out"