Skip to content

Commit 481168d

Browse files
committed
update Package.swift
1 parent d5964d0 commit 481168d

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ let package = Package(
1515
]),
1616
],
1717
targets: [
18-
.binaryTarget(name: "libpython3", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1/libpython3.xcframework.zip", checksum: "245c51a97eda854a7b0c7bd507f24d1dfc2efae38f20aceac91fe0fd99a6eebe"),
19-
.binaryTarget(name: "libssl", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1/libssl.xcframework.zip", checksum: "1fc7dd3e95d5152812bc8d74450fdc45539e4ac53d4008b21b7f0a81d2fc52a9"),
20-
.binaryTarget(name: "libcrypto", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1/libcrypto.xcframework.zip", checksum: "43948ae2aac97bf80445ad0e38dd943b4f903506802633bd82d8b813da0328bf"),
21-
.binaryTarget(name: "libffi", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1/libffi.xcframework.zip", checksum: "0b028a1068f5f085ba1861b73928b99d14970438639d2531c3f31afe4d0e0e3c"),
18+
.binaryTarget(name: "libpython3", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1-20210331/libpython3.xcframework.zip", checksum: "f45a4efeefad5d282c7eb4ac1d7252e8ad023991e151b48b5ca131989a30a2c3"),
19+
.binaryTarget(name: "libssl", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1-20210331/libssl.xcframework.zip", checksum: "18d6754f053c5923fb9ef7c23339e1e2ab7cd3b6463aab24a05ee70999cbf90e"),
20+
.binaryTarget(name: "libcrypto", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1-20210331/libcrypto.xcframework.zip", checksum: "4db7e03555a66e1141246bbb7c5c0bd7b8aeec3c67aed3c05fcea28c1e263ebb"),
21+
.binaryTarget(name: "libffi", url: "https://github.com/kewlbear/Python-iOS/releases/download/0.0.1-20210331/libffi.xcframework.zip", checksum: "207daa9ba776076bce888cfe1fe9f0bd76aafe15a6f8b4e0bc74bd08254a206b"),
2222
.target(name: "LinkPython",
2323
dependencies: [
2424
"libpython3",

Scripts/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
xcodebuild -create-xcframework -output Frameworks/python3.xcframework \
2+
-library ci/dist/frameworks/python3.xcframework/ios-arm64/libpython3.8.a -headers ci/dist/root/python3/include/python3.8 \
3+
-library ci/dist/frameworks/python3.xcframework/ios-x86_64-simulator/libpython3.8.a -headers ci/dist/root/python3/include/python3.8

Scripts/zip.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cd Frameworks
2+
rm *.zip
3+
4+
for f in *.xcframework
5+
do
6+
zip -r $f.zip $f
7+
swift package compute-checksum $f.zip
8+
done

Sources/LinkPython/PythonSupport.m

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222
// THE SOFTWARE.
2323
//
2424

25-
#import <Python.h>
26-
#include <dlfcn.h>
27-
2825
#import "PythonSupport.h"
2926

27+
void Py_Initialize(void);
28+
void *PyMem_RawMalloc(size_t);
29+
wchar_t *Py_DecodeLocale(const char *, size_t *);
30+
void PySys_SetArgv(int, wchar_t **);
31+
void PyEval_InitThreads(void);
32+
int PyRun_SimpleString(const char *);
33+
void Py_Finalize(void);
34+
3035
int PythonInitialize(int argc, const char **argv, const char *custom_builtin_importer)
3136
{
3237
int ret = 0;

0 commit comments

Comments
 (0)