Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit 30e3031

Browse files
authored
Combine apple and apple_future frameworks (#123)
* Combine `apple` and `apple_future` frameworks so we can support older iOS versions and Catalyst at the same time. * Remove `apple_future` and `apple_legacy` and make `ios` and `macos` intermediary steps instead. * Use the target filename instead of hard-coding it. * Remove `apple_future` from workflow.
1 parent 4c5b7bf commit 30e3031

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.github/workflows/build_and_test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ jobs:
7878

7979
- name: Build for Apple platforms
8080
run: make apple
81-
82-
- name: Build future Apple library
83-
run: make apple_future
8481

8582
android:
8683
name: Android Build

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ GOBIND=env PATH="$(GOBIN):$(PATH)" "$(GOMOBILE)" bind
77
IMPORT_HOST=github.com
88
IMPORT_PATH=$(IMPORT_HOST)/Jigsaw-Code/outline-go-tun2socks
99

10-
.PHONY: android apple apple_future linux windows intra clean clean-all
10+
.PHONY: android apple linux windows intra clean clean-all
1111

12-
all: intra android linux apple windows apple_future
12+
all: intra android linux apple windows
1313

1414
# Don't strip Android debug symbols so we can upload them to crash reporting tools.
1515
ANDROID_BUILD_CMD=$(GOBIND) -a -ldflags '-w' -target=android -tags android -work
@@ -26,18 +26,20 @@ $(BUILDDIR)/android/tun2socks.aar: $(GOMOBILE)
2626
mkdir -p "$(BUILDDIR)/android"
2727
$(ANDROID_BUILD_CMD) -o "$@" $(IMPORT_PATH)/outline/tun2socks $(IMPORT_PATH)/outline/shadowsocks
2828

29-
apple: $(BUILDDIR)/apple/Tun2socks.xcframework
29+
# TODO(fortuna): -s strips symbols and is obsolete. Why are we using it?
30+
$(BUILDDIR)/ios/Tun2socks.xcframework: $(GOMOBILE)
31+
# -iosversion should match what outline-client supports.
32+
$(GOBIND) -iosversion=11.0 -target=ios,iossimulator -o $@ -ldflags '-s -w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/outline/tun2socks $(IMPORT_PATH)/outline/shadowsocks
3033

31-
$(BUILDDIR)/apple/Tun2socks.xcframework: $(GOMOBILE)
34+
$(BUILDDIR)/macos/Tun2socks.xcframework: $(GOMOBILE)
3235
# MACOSX_DEPLOYMENT_TARGET and -iosversion should match what outline-client supports.
33-
# TODO(fortuna): -s strips symbols and is obsolete. Why are we using it?
34-
export MACOSX_DEPLOYMENT_TARGET=10.14; $(GOBIND) -iosversion=11.0 -target=ios,iossimulator,macos -o $@ -ldflags '-s -w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/outline/tun2socks $(IMPORT_PATH)/outline/shadowsocks
35-
36-
apple_future: $(BUILDDIR)/apple_future/Tun2socks.xcframework
36+
export MACOSX_DEPLOYMENT_TARGET=10.14; $(GOBIND) -iosversion=13.1 -target=macos,maccatalyst -o $@ -ldflags '-s -w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/outline/tun2socks $(IMPORT_PATH)/outline/shadowsocks
3737

38-
$(BUILDDIR)/apple_future/Tun2socks.xcframework: $(GOMOBILE)
39-
$(GOBIND) -iosversion=13.1 -target=ios,iossimulator,maccatalyst -o $@ -ldflags '-s -w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/outline/tun2socks $(IMPORT_PATH)/outline/shadowsocks
38+
apple: $(BUILDDIR)/apple/Tun2socks.xcframework
4039

40+
$(BUILDDIR)/apple/Tun2socks.xcframework: $(BUILDDIR)/ios/Tun2socks.xcframework $(BUILDDIR)/macos/Tun2socks.xcframework
41+
find $^ -name "Tun2socks.framework" -type d | xargs -I {} echo " -framework {} " | \
42+
xargs xcrun xcodebuild -create-xcframework -output "$@"
4143

4244
XGO=$(GOBIN)/xgo
4345
TUN2SOCKS_VERSION=v1.16.11

0 commit comments

Comments
 (0)