Fix xcframework linking for pub.dev installs, bump to 0.1.1
Use DERIVED_FILE_DIR instead of symlinks for force_load path. Symlinks in PODS_TARGET_SRCROOT fail when installed from pub cache because Xcode validates build inputs before script phases run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cefcd23cd2
commit
5c9f318f5a
@ -1,3 +1,7 @@
|
|||||||
|
## 0.1.1
|
||||||
|
|
||||||
|
- Fix: xcframework linking when installed from pub.dev (use DERIVED_FILE_DIR instead of symlinks)
|
||||||
|
|
||||||
## 0.1.0
|
## 0.1.0
|
||||||
|
|
||||||
- Initial release
|
- Initial release
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'tsnet_flutter'
|
s.name = 'tsnet_flutter'
|
||||||
s.version = '0.1.0'
|
s.version = '0.1.1'
|
||||||
s.summary = 'Embedded Tailscale tsnet for Flutter'
|
s.summary = 'Embedded Tailscale tsnet for Flutter'
|
||||||
s.description = <<-DESC
|
s.description = <<-DESC
|
||||||
Embed Tailscale's tsnet in Flutter apps. Provides a userspace WireGuard
|
Embed Tailscale's tsnet in Flutter apps. Provides a userspace WireGuard
|
||||||
@ -23,27 +23,39 @@ No VPN entitlement needed — uses userspace netstack.
|
|||||||
s.pod_target_xcconfig = {
|
s.pod_target_xcconfig = {
|
||||||
'DEFINES_MODULE' => 'YES',
|
'DEFINES_MODULE' => 'YES',
|
||||||
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 x86_64',
|
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 x86_64',
|
||||||
'OTHER_LDFLAGS' => '$(inherited) -force_load "$(PODS_TARGET_SRCROOT)/_current_slice/TailscaleKit.framework/TailscaleKit"',
|
# Link the Go static library — the script phase copies the correct slice
|
||||||
|
# to DERIVED_FILE_DIR which is always writable and available at link time.
|
||||||
|
'OTHER_LDFLAGS' => '$(inherited) -force_load "$(DERIVED_FILE_DIR)/TailscaleKit"',
|
||||||
}
|
}
|
||||||
|
|
||||||
s.user_target_xcconfig = {
|
s.user_target_xcconfig = {
|
||||||
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 x86_64',
|
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 x86_64',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Copy the correct xcframework slice to DERIVED_FILE_DIR before compile.
|
||||||
|
# DERIVED_FILE_DIR is writable and exists before the link phase.
|
||||||
s.script_phase = {
|
s.script_phase = {
|
||||||
:name => 'Select TailscaleKit Slice',
|
:name => 'Select TailscaleKit Slice',
|
||||||
:script => <<-'SCRIPT',
|
:script => <<-'SCRIPT',
|
||||||
PLUGIN_DIR="${PODS_TARGET_SRCROOT}"
|
XCFW="${PODS_TARGET_SRCROOT}/TailscaleKit.xcframework"
|
||||||
LINK="${PLUGIN_DIR}/_current_slice"
|
|
||||||
rm -f "$LINK"
|
|
||||||
|
|
||||||
if [ "$PLATFORM_NAME" = "iphonesimulator" ]; then
|
if [ "$PLATFORM_NAME" = "iphonesimulator" ]; then
|
||||||
ln -sf "TailscaleKit.xcframework/ios-arm64-simulator" "$LINK"
|
SLICE="ios-arm64-simulator"
|
||||||
else
|
else
|
||||||
ln -sf "TailscaleKit.xcframework/ios-arm64" "$LINK"
|
SLICE="ios-arm64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
SRC="$XCFW/$SLICE/TailscaleKit.framework/TailscaleKit"
|
||||||
|
DEST="${DERIVED_FILE_DIR}/TailscaleKit"
|
||||||
|
|
||||||
|
if [ ! -f "$DEST" ] || [ "$SRC" -nt "$DEST" ]; then
|
||||||
|
cp "$SRC" "$DEST"
|
||||||
|
echo "Copied TailscaleKit ($SLICE) to $DEST"
|
||||||
|
else
|
||||||
|
echo "TailscaleKit ($SLICE) up to date"
|
||||||
fi
|
fi
|
||||||
echo "TailscaleKit: selected $PLATFORM_NAME slice"
|
|
||||||
SCRIPT
|
SCRIPT
|
||||||
:execution_position => :before_compile,
|
:execution_position => :before_compile,
|
||||||
|
:output_files => ['$(DERIVED_FILE_DIR)/TailscaleKit'],
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
name: tsnet_flutter
|
name: tsnet_flutter
|
||||||
description: Embed Tailscale's tsnet in Flutter apps. Provides a userspace WireGuard tunnel with a localhost TCP proxy — no VPN entitlement needed on iOS.
|
description: Embed Tailscale's tsnet in Flutter apps. Provides a userspace WireGuard tunnel with a localhost TCP proxy — no VPN entitlement needed on iOS.
|
||||||
version: 0.1.0
|
version: 0.1.1
|
||||||
homepage: https://github.com/svrnty/tsnet_flutter
|
homepage: https://github.com/svrnty/tsnet_flutter
|
||||||
repository: https://github.com/svrnty/tsnet_flutter
|
repository: https://github.com/svrnty/tsnet_flutter
|
||||||
issue_tracker: https://github.com/svrnty/tsnet_flutter/issues
|
issue_tracker: https://github.com/svrnty/tsnet_flutter/issues
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user