Skip to content

Commit bf38d87

Browse files
committed
Fix build on Xcode 16.4+
tdlib/td#3427
1 parent 16bd873 commit bf38d87

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ jobs:
2727
run: |
2828
cd td
2929
git apply ../builder/tdlib-patches/build-openssl.patch
30+
git apply ../builder/tdlib-patches/Python-Apple-Support-patch.patch
3031
3132
- name: Cache Openssl
3233
id: cache-openssl
3334
uses: actions/cache@v4
3435
with:
3536
path: td/example/ios/third_party/openssl/${{ env.PLATFORM }}
36-
key: openssl-v1-${{ env.PLATFORM }}-${{ inputs.developer-dir }}-${{ hashFiles('td/example/ios/build-openssl.sh', 'td/example/ios/Python-Apple-support.patch', 'builder/tdlib-patches/build-openssl.patch') }}
37+
key: openssl-v1-${{ env.PLATFORM }}-${{ inputs.developer-dir }}-${{ hashFiles('td/example/ios/build-openssl.sh', 'td/example/ios/Python-Apple-support.patch', 'builder/tdlib-patches/build-openssl.patch', 'builder/tdlib-patches/Python-Apple-Support-patch.patch') }}
3738

3839
- name: Install deps
3940
if: steps.cache-openssl.outputs.cache-hit != 'true'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/example/ios/Python-Apple-support.patch b/example/ios/Python-Apple-support.patch
2+
index 4ef7827be963..7c73f7a3a0a3 100644
3+
--- a/example/ios/Python-Apple-support.patch
4+
+++ b/example/ios/Python-Apple-support.patch
5+
@@ -79,7 +79,7 @@ index a1d13e9..8efcf20 100644
6+
# The architecture of the machine doing the build
7+
HOST_ARCH=$(shell uname -m)
8+
HOST_PYTHON=install/macOS/macosx/python-$(PYTHON_VERSION)
9+
-@@ -212,6 +236,10 @@ ARCH-$(target)=$$(subst .,,$$(suffix $(target)))
10+
+@@ -212,12 +236,12 @@ ARCH-$(target)=$$(subst .,,$$(suffix $(target)))
11+
12+
ifeq ($(os),macOS)
13+
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-darwin
14+
@@ -88,9 +88,15 @@ index a1d13e9..8efcf20 100644
15+
+else ifeq ($(os),visionOS-simulator)
16+
+TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-xros-simulator
17+
else
18+
- ifeq ($$(findstring simulator,$$(SDK-$(target))),)
19+
+- ifeq ($$(findstring simulator,$$(SDK-$(target))),)
20+
TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))
21+
-@@ -662,7 +690,7 @@ BZIP2_FATLIB-$(sdk)=$$(BZIP2_MERGE-$(sdk))/lib/libbz2.a
22+
+- else
23+
+-TARGET_TRIPLE-$(target)=$$(ARCH-$(target))-apple-$$(OS_LOWER-$(target))-simulator
24+
+- endif
25+
+ endif
26+
+
27+
+ SDK_ROOT-$(target)=$$(shell xcrun --sdk $$(SDK-$(target)) --show-sdk-path)
28+
+@@ -662,7 +686,7 @@ BZIP2_FATLIB-$(sdk)=$$(BZIP2_MERGE-$(sdk))/lib/libbz2.a
29+
XZ_MERGE-$(sdk)=$(PROJECT_DIR)/merge/$(os)/$(sdk)/xz-$(XZ_VERSION)
30+
XZ_FATLIB-$(sdk)=$$(XZ_MERGE-$(sdk))/lib/liblzma.a
31+
32+
@@ -99,7 +105,7 @@ index a1d13e9..8efcf20 100644
33+
OPENSSL_FATINCLUDE-$(sdk)=$$(OPENSSL_MERGE-$(sdk))/include
34+
OPENSSL_SSL_FATLIB-$(sdk)=$$(OPENSSL_MERGE-$(sdk))/lib/libssl.a
35+
OPENSSL_CRYPTO_FATLIB-$(sdk)=$$(OPENSSL_MERGE-$(sdk))/lib/libcrypto.a
36+
-@@ -716,14 +744,14 @@ $$(OPENSSL_SSL_FATLIB-$(sdk)): $$(foreach target,$$(SDK_TARGETS-$(sdk)),$$(OPENS
37+
+@@ -716,14 +740,14 @@ $$(OPENSSL_SSL_FATLIB-$(sdk)): $$(foreach target,$$(SDK_TARGETS-$(sdk)),$$(OPENS
38+
mkdir -p $$(OPENSSL_MERGE-$(sdk))/lib
39+
lipo -create -output $$@ \
40+
$$(foreach target,$$(SDK_TARGETS-$(sdk)),$$(OPENSSL_SSL_LIB-$$(target))) \

0 commit comments

Comments
 (0)