Skip to content

Commit d9e07ff

Browse files
committed
Migrated Python to use XCframework
1 parent b9fe79a commit d9e07ff

File tree

10 files changed

+320
-174
lines changed

10 files changed

+320
-174
lines changed

Makefile

Lines changed: 231 additions & 135 deletions
Large diffs are not rendered by default.

patch/Python/Setup.embedded

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ _abc _abc.c
66
_asyncio _asynciomodule.c
77
_bisect _bisectmodule.c
88
_blake2 _blake2/blake2module.c _blake2/blake2b_impl.c _blake2/blake2s_impl.c
9-
_bz2 _bz2module.c -I$(srcdir)/../Support/BZip2/Headers -L$(srcdir)/../Support/BZip2 -lbzip2
9+
_bz2 _bz2module.c -I$(srcdir)/../Support/BZip2.xcframework/{{slice}}/Headers -L$(srcdir)/../Support/BZip2.xcframework/{{slice}} -lbzip2
1010
_codecs _codecsmodule.c
1111
_codecs_cn cjkcodecs/_codecs_cn.c
1212
_codecs_hk cjkcodecs/_codecs_hk.c
@@ -23,21 +23,19 @@ _elementtree _elementtree.c \
2323
-I$(srcdir)/Modules/expat
2424
-DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
2525
_functools -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal _functoolsmodule.c
26-
_hashlib _hashopenssl.c -I$(srcdir)/../Support/OpenSSL/Headers -L$(srcdir)/../Support/OpenSSL -lOpenSSL -DUSE_SSL
26+
_hashlib _hashopenssl.c -I$(srcdir)/../Support/OpenSSL.xcframework/{{slice}}/Headers -L$(srcdir)/../Support/OpenSSL.xcframework/{{slice}} -lOpenSSL -DUSE_SSL
2727
_heapq _heapqmodule.c
2828
_io -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
2929
_json -I$(srcdir)/Include/internal -DPy_BUILD_CORE_BUILTIN _json.c
3030
_locale _localemodule.c # -lintl
3131
_lsprof _lsprof.c rotatingtree.c
32-
_lzma _lzmamodule.c -I$(srcdir)/../Support/XZ/Headers -L$(srcdir)/../Support/XZ/ -lxz
32+
_lzma _lzmamodule.c -I$(srcdir)/../Support/XZ.xcframework/{{slice}}/Headers -L$(srcdir)/../Support/XZ.xcframework/{{slice}} -lxz
3333
_md5 md5module.c
3434
_multibytecodec cjkcodecs/multibytecodec.c
3535
_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c
3636
_opcode _opcode.c
3737
_operator _operator.c
3838
_pickle _pickle.c -DPy_BUILD_CORE_MODULE
39-
_posixsubprocess _posixsubprocess.c
40-
_posixshmem -I$(srcdir)/Modules/_multiprocessing posixshmem.c
4139
_queue _queuemodule.c
4240
_random _randommodule.c -DPy_BUILD_CORE_MODULE
4341
_sha1 sha1module.c
@@ -57,7 +55,7 @@ _sqlite3 -I$(srcdir)/Modules/_sqlite -DMODULE_NAME='\"sqlite3\"' -DSQLITE_OMIT_L
5755
_sqlite/statement.c \
5856
_sqlite/util.c
5957
_sre _sre.c
60-
_ssl _ssl.c -I$(srcdir)/../Support/OpenSSL/Headers -L$(srcdir)/../Support/OpenSSL -lOpenSSL -DUSE_SSL
58+
_ssl _ssl.c -I$(srcdir)/../Support/OpenSSL.xcframework/{{slice}}/Headers -L$(srcdir)/../Support/OpenSSL.xcframework/{{slice}} -lOpenSSL -DUSE_SSL
6159
_stat _stat.c
6260
_statistics _statisticsmodule.c
6361
_struct _struct.c

patch/Python/Setup.iOS

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#####################################################################
32
# iOS: Platform specific configuration
43
#####################################################################
@@ -9,10 +8,10 @@ _ctypes _ctypes/_ctypes.c \
98
_ctypes/cfield.c \
109
_ctypes/malloc_closure.c \
1110
-I$(srcdir)/Modules/_ctypes/darwin \
12-
-I$(srcdir)/../Support/libFFI/Headers \
11+
-I$(srcdir)/../Support/libFFI.xcframework/{{slice}}/Headers \
1312
-DPy_BUILD_CORE_MODULE \
1413
-DHAVE_FFI_PREP_CLOSURE_LOC=1 \
15-
-L$(srcdir)/../Support/libFFI \
14+
-L$(srcdir)/../Support/libFFI.xcframework/{{slice}} \
1615
-lFFI
1716

1817
_decimal _decimal/_decimal.c \

patch/Python/Setup.macOS

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#####################################################################
32
# macOS: Platform specific configuration
43
#####################################################################
@@ -10,9 +9,13 @@ _ctypes _ctypes/_ctypes.c \
109
_ctypes/malloc_closure.c \
1110
-I$(srcdir)/Modules/_ctypes/darwin \
1211
-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi \
13-
-DPy_BUILD_CORE_MODULE -DUSING_MALLOC_CLOSURE_DOT_C=1 -DMACOSX \
14-
-DUSING_APPLE_OS_LIBFFI=1 -DHAVE_FFI_PREP_CIF_VAR=1 \
15-
-DHAVE_FFI_PREP_CLOSURE_LOC=1 -DHAVE_FFI_CLOSURE_ALLOC=1 \
12+
-DPy_BUILD_CORE_MODULE \
13+
-DHAVE_FFI_CLOSURE_ALLOC=1 \
14+
-DHAVE_FFI_PREP_CIF_VAR=1 \
15+
-DHAVE_FFI_PREP_CLOSURE_LOC=1 \
16+
-DMACOSX \
17+
-DUSING_APPLE_OS_LIBFFI=1 \
18+
-DUSING_MALLOC_CLOSURE_DOT_C=1 \
1619
-lffi
1720

1821
_decimal _decimal/_decimal.c \
@@ -33,6 +36,9 @@ _decimal _decimal/_decimal.c \
3336
-I$(srcdir)/Modules/_decimal/libmpdec \
3437
-DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1
3538

39+
_posixshmem -I$(srcdir)/Modules/_multiprocessing _multiprocessing/posixshmem.c
40+
_posixsubprocess _posixsubprocess.c
41+
3642
_scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
3743

3844
_curses _cursesmodule.c -lcurses -ltermcap

patch/Python/Setup.tvOS

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#####################################################################
32
# tvOS: Platform specific configuration
43
#####################################################################
@@ -9,10 +8,10 @@ _ctypes _ctypes/_ctypes.c \
98
_ctypes/cfield.c \
109
_ctypes/malloc_closure.c \
1110
-I$(srcdir)/Modules/_ctypes/darwin \
12-
-I$(srcdir)/../Support/libFFI/Headers \
11+
-I$(srcdir)/../Support/libFFI.xcframework/{{slice}}/Headers \
1312
-DPy_BUILD_CORE_MODULE \
1413
-DHAVE_FFI_PREP_CLOSURE_LOC=1 \
15-
-L$(srcdir)/../Support/libFFI \
14+
-L$(srcdir)/../Support/libFFI.xcframework/{{slice}} \
1615
-lFFI
1716

1817
_decimal _decimal/_decimal.c \

patch/Python/Setup.watchOS

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#####################################################################
32
# watchOS: Platform specific configuration
43
#####################################################################
@@ -9,26 +8,8 @@ _ctypes _ctypes/_ctypes.c \
98
_ctypes/cfield.c \
109
_ctypes/malloc_closure.c \
1110
-I$(srcdir)/Modules/_ctypes/darwin \
12-
-I$(srcdir)/../Support/libFFI/Headers \
11+
-I$(srcdir)/../Support/libFFI.xcframework/{{slice}}/Headers \
1312
-DPy_BUILD_CORE_MODULE \
1413
-DHAVE_FFI_PREP_CLOSURE_LOC=1 \
15-
-L$(srcdir)/../Support/libFFI \
14+
-L$(srcdir)/../Support/libFFI.xcframework/{{slice}} \
1615
-lFFI
17-
18-
_decimal _decimal/_decimal.c \
19-
_decimal/libmpdec/basearith.c \
20-
_decimal/libmpdec/constants.c \
21-
_decimal/libmpdec/context.c \
22-
_decimal/libmpdec/convolute.c \
23-
_decimal/libmpdec/crt.c \
24-
_decimal/libmpdec/difradix2.c \
25-
_decimal/libmpdec/fnt.c \
26-
_decimal/libmpdec/fourstep.c \
27-
_decimal/libmpdec/io.c \
28-
_decimal/libmpdec/mpalloc.c \
29-
_decimal/libmpdec/mpdecimal.c \
30-
_decimal/libmpdec/numbertheory.c \
31-
_decimal/libmpdec/sixstep.c \
32-
_decimal/libmpdec/transpose.c \
33-
-I$(srcdir)/Modules/_decimal/libmpdec \
34-
-DCONFIG_32=1 -DANSI=1

patch/Python/Setup.watchos.arm64_32

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#####################################################################
2+
# watchOS ARM64_32: Target specific configuration
3+
#####################################################################
4+
5+
_decimal _decimal/_decimal.c \
6+
_decimal/libmpdec/basearith.c \
7+
_decimal/libmpdec/constants.c \
8+
_decimal/libmpdec/context.c \
9+
_decimal/libmpdec/convolute.c \
10+
_decimal/libmpdec/crt.c \
11+
_decimal/libmpdec/difradix2.c \
12+
_decimal/libmpdec/fnt.c \
13+
_decimal/libmpdec/fourstep.c \
14+
_decimal/libmpdec/io.c \
15+
_decimal/libmpdec/mpalloc.c \
16+
_decimal/libmpdec/mpdecimal.c \
17+
_decimal/libmpdec/numbertheory.c \
18+
_decimal/libmpdec/sixstep.c \
19+
_decimal/libmpdec/transpose.c \
20+
-I$(srcdir)/Modules/_decimal/libmpdec \
21+
-DCONFIG_32=1 -DANSI=1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#####################################################################
2+
# watchOS Simulator ARM64: Target specific configuration
3+
#####################################################################
4+
5+
_decimal _decimal/_decimal.c \
6+
_decimal/libmpdec/basearith.c \
7+
_decimal/libmpdec/constants.c \
8+
_decimal/libmpdec/context.c \
9+
_decimal/libmpdec/convolute.c \
10+
_decimal/libmpdec/crt.c \
11+
_decimal/libmpdec/difradix2.c \
12+
_decimal/libmpdec/fnt.c \
13+
_decimal/libmpdec/fourstep.c \
14+
_decimal/libmpdec/io.c \
15+
_decimal/libmpdec/mpalloc.c \
16+
_decimal/libmpdec/mpdecimal.c \
17+
_decimal/libmpdec/numbertheory.c \
18+
_decimal/libmpdec/sixstep.c \
19+
_decimal/libmpdec/transpose.c \
20+
-I$(srcdir)/Modules/_decimal/libmpdec \
21+
-DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#####################################################################
2+
# watchOS simulator x86_64: Target specific configuration
3+
#####################################################################
4+
5+
_decimal _decimal/_decimal.c \
6+
_decimal/libmpdec/basearith.c \
7+
_decimal/libmpdec/constants.c \
8+
_decimal/libmpdec/context.c \
9+
_decimal/libmpdec/convolute.c \
10+
_decimal/libmpdec/crt.c \
11+
_decimal/libmpdec/difradix2.c \
12+
_decimal/libmpdec/fnt.c \
13+
_decimal/libmpdec/fourstep.c \
14+
_decimal/libmpdec/io.c \
15+
_decimal/libmpdec/mpalloc.c \
16+
_decimal/libmpdec/mpdecimal.c \
17+
_decimal/libmpdec/numbertheory.c \
18+
_decimal/libmpdec/sixstep.c \
19+
_decimal/libmpdec/transpose.c \
20+
-I$(srcdir)/Modules/_decimal/libmpdec \
21+
-DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1

patch/Python/pyconfig-watchOS.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "pyconfig-armv7k.h"
33
#endif
44

5-
#ifdef __i386__
6-
#include "pyconfig-i386.h"
5+
#ifdef __arm64__
6+
#include "pyconfig-arm64.h"
77
#endif
8+
9+
#ifdef __x86_64__
10+
#include "pyconfig-x86_64.h"
11+
#endif

0 commit comments

Comments
 (0)