FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build Python.framework manually · plotdevice/plotdevice@237b480 · GitHub

Repository navigation

Commit 237b480

Browse files
committed
build Python.framework manually
- who knows how long the devtool-provided copy will continue to exist... - lets pyobjc and requests be bundled in rather than having to live in plotdevice/lib
1 parent a7881f3 commit 237b480

5 files changed

Lines changed: 63 additions & 15 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ build/
44
dist/
55
app/deps/vendor/Sparkle*
66
app/deps/vendor/*.tar.gz
7+
app/deps/embed/Python.framework
8+
app/deps/embed/relocatable-python
79

810
# cds garbage
911
related/

‎PlotDevice.xcodeproj/project.pbxproj‎

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
2A15C45018A329BD006BDFF0 /* editor.html in Copy Editor Assets */ = {isa = PBXBuildFile; fileRef = 2A15C44418A329AE006BDFF0 /* editor.html */; };
1212
2A15C45218A329BD006BDFF0 /* themes.json in Copy Editor Assets */ = {isa = PBXBuildFile; fileRef = 2A15C44618A329AE006BDFF0 /* themes.json */; };
1313
2A15C45618A48770006BDFF0 /* autocomplete.css in Copy Editor Assets */ = {isa = PBXBuildFile; fileRef = 2A15C45418A48765006BDFF0 /* autocomplete.css */; };
14+
2A36AE2D2868B4E50088976E /* Python.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A36AE2C2868B4E50088976E /* Python.framework */; };
15+
2A36AE2E2868B4F30088976E /* Python.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 2A36AE2C2868B4E50088976E /* Python.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1416
2A591FF0185C17D200D1833D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A591FEF185C17D200D1833D /* Security.framework */; };
1517
2A66ECEB18A99328002903DE /* ace.js in Copy Editor Scripts */ = {isa = PBXBuildFile; fileRef = 2A66ECDE18A992BD002903DE /* ace.js */; };
1618
2A66ECEC18A99328002903DE /* editor.js in Copy Editor Scripts */ = {isa = PBXBuildFile; fileRef = 2A66ECDF18A992BD002903DE /* editor.js */; };
1719
2A66ECED18A99328002903DE /* jquery-2.1.0.js in Copy Editor Scripts */ = {isa = PBXBuildFile; fileRef = 2A66ECE018A992BD002903DE /* jquery-2.1.0.js */; };
1820
2A66ECEE18A99328002903DE /* keybindings.js in Copy Editor Scripts */ = {isa = PBXBuildFile; fileRef = 2A66ECE118A992BD002903DE /* keybindings.js */; };
1921
2A66ECEF18A99328002903DE /* underscore-1.5.2.min.js in Copy Editor Scripts */ = {isa = PBXBuildFile; fileRef = 2A66ECE218A992BD002903DE /* underscore-1.5.2.min.js */; };
20-
2A79B146286508220074E96A /* Python3.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A79B144286507000074E96A /* Python3.framework */; };
21-
2A79B147286508220074E96A /* Python3.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 2A79B144286507000074E96A /* Python3.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2222
2A7AF5C818D2AFAA00F8FFC2 /* examples in Resources */ = {isa = PBXBuildFile; fileRef = 2A7AF5C718D2AFAA00F8FFC2 /* examples */; };
2323
2A93AE751903326E00C6144D /* placeholder.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 2A93AE731903326E00C6144D /* placeholder.pdf */; };
2424
2ABBB2FA1854018B001C4E0A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ABBB2F91854018B001C4E0A /* AVFoundation.framework */; };
@@ -75,7 +75,7 @@
7575
dstPath = "";
7676
dstSubfolderSpec = 10;
7777
files = (
78-
2A79B147286508220074E96A /* Python3.framework in Embed Frameworks */,
78+
2A36AE2E2868B4F30088976E /* Python.framework in Embed Frameworks */,
7979
);
8080
name = "Embed Frameworks";
8181
runOnlyForDeploymentPostprocessing = 0;
@@ -108,6 +108,7 @@
108108
2A32957218C59D0A00EEDD1C /* __init__.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = __init__.py; sourceTree = "<group>"; };
109109
2A32957718C59D0A00EEDD1C /* io.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = io.py; sourceTree = "<group>"; };
110110
2A32957918C59D0A00EEDD1C /* pathmatics.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = pathmatics.py; sourceTree = "<group>"; };
111+
2A36AE2C2868B4E50088976E /* Python.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Python.framework; path = app/deps/embed/Python.framework; sourceTree = "<group>"; };
111112
2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
112113
2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
113114
2A591FEF185C17D200D1833D /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
@@ -125,7 +126,6 @@
125126
2A79B13E2864FDAE0074E96A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = Resources/en.lproj/PlotDevicePreferences.xib; sourceTree = "<group>"; };
126127
2A79B13F2864FDAE0074E96A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = Resources/en.lproj/PlotDeviceScript.xib; sourceTree = "<group>"; };
127128
2A79B1402864FDAF0074E96A /* en */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = en; path = Resources/en.lproj/placeholder.pdf; sourceTree = "<group>"; };
128-
2A79B144286507000074E96A /* Python3.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Python3.framework; path = Library/Frameworks/Python3.framework; sourceTree = DEVELOPER_DIR; };
129129
2A7AF5C718D2AFAA00F8FFC2 /* examples */ = {isa = PBXFileReference; lastKnownFileType = folder; path = examples; sourceTree = "<group>"; };
130130
2A827CC91859E9FE00A126BA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
131131
2A98FCAD1B3C6BFC00ABF2C9 /* python.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = python.xcconfig; path = app/python.xcconfig; sourceTree = "<group>"; };
@@ -173,11 +173,11 @@
173173
isa = PBXFrameworksBuildPhase;
174174
buildActionMask = 2147483647;
175175
files = (
176+
2A36AE2D2868B4E50088976E /* Python.framework in Frameworks */,
176177
2ABBB2FC18540246001C4E0A /* CoreVideo.framework in Frameworks */,
177178
2ABBB2FE185402AC001C4E0A /* CoreMedia.framework in Frameworks */,
178179
2ABBB2FA1854018B001C4E0A /* AVFoundation.framework in Frameworks */,
179180
2A15C42D18A1FA14006BDFF0 /* WebKit.framework in Frameworks */,
180-
2A79B146286508220074E96A /* Python3.framework in Frameworks */,
181181
2A591FF0185C17D200D1833D /* Security.framework in Frameworks */,
182182
8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */,
183183
);
@@ -296,7 +296,7 @@
296296
2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = {
297297
isa = PBXGroup;
298298
children = (
299-
2A79B144286507000074E96A /* Python3.framework */,
299+
2A36AE2C2868B4E50088976E /* Python.framework */,
300300
2AEE843D18B5603900CF91D4 /* CoreText.framework */,
301301
2A15C42C18A1FA14006BDFF0 /* WebKit.framework */,
302302
2A591FEF185C17D200D1833D /* Security.framework */,
@@ -388,6 +388,7 @@
388388
8D15AC2B0486D014006FF6A4 /* Resources */,
389389
2A15C43718A20929006BDFF0 /* Copy Editor Assets */,
390390
2A66ECEA18A99303002903DE /* Copy Editor Scripts */,
391+
2A36AE2F2868BB9A0088976E /* Build Python Framework */,
391392
2A758E411957B7CE003ECF9D /* Build PlotDevice Module */,
392393
2ABDB76F1867D9560069EFC3 /* Copy 'plotdevice' Tool */,
393394
2AF8981419953CA1005A49A5 /* Manually Update Examples */,
@@ -454,6 +455,24 @@
454455
/* End PBXResourcesBuildPhase section */
455456

456457
/* Begin PBXShellScriptBuildPhase section */
458+
2A36AE2F2868BB9A0088976E /* Build Python Framework */ = {
459+
isa = PBXShellScriptBuildPhase;
460+
buildActionMask = 2147483647;
461+
files = (
462+
);
463+
inputFileListPaths = (
464+
);
465+
inputPaths = (
466+
);
467+
name = "Build Python Framework";
468+
outputFileListPaths = (
469+
);
470+
outputPaths = (
471+
);
472+
runOnlyForDeploymentPostprocessing = 0;
473+
shellPath = /bin/sh;
474+
shellScript = "cd app/deps/embed\nmake\n";
475+
};
457476
2A758E411957B7CE003ECF9D /* Build PlotDevice Module */ = {
458477
isa = PBXShellScriptBuildPhase;
459478
buildActionMask = 2147483647;
@@ -576,15 +595,18 @@
576595
COMBINE_HIDPI_IMAGES = YES;
577596
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
578597
COPY_PHASE_STRIP = NO;
579-
FRAMEWORK_SEARCH_PATHS = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/**";
598+
FRAMEWORK_SEARCH_PATHS = (
599+
"/Applications/Xcode.app/Contents/Developer/Library/Frameworks/**",
600+
"$(PROJECT_DIR)/app/deps/embed",
601+
);
580602
GCC_DYNAMIC_NO_PIC = NO;
581603
GCC_MODEL_TUNING = G5;
582604
GCC_OPTIMIZATION_LEVEL = 0;
583605
GCC_PRECOMPILE_PREFIX_HEADER = YES;
584606
GCC_PREFIX_HEADER = "";
585607
INFOPLIST_FILE = app/info.plist;
586608
INSTALL_PATH = /Applications;
587-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
609+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../Frameworks/Python.framework";
588610
MACOSX_DEPLOYMENT_TARGET = 10.14;
589611
ONLY_ACTIVE_ARCH = NO;
590612
OTHER_LDFLAGS = "$(inherited)";
@@ -603,13 +625,16 @@
603625
COMBINE_HIDPI_IMAGES = YES;
604626
CONFIGURATION_BUILD_DIR = dist;
605627
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
606-
FRAMEWORK_SEARCH_PATHS = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/**";
628+
FRAMEWORK_SEARCH_PATHS = (
629+
"/Applications/Xcode.app/Contents/Developer/Library/Frameworks/**",
630+
"$(PROJECT_DIR)/app/deps/embed",
631+
);
607632
GCC_MODEL_TUNING = G5;
608633
GCC_PRECOMPILE_PREFIX_HEADER = YES;
609634
GCC_PREFIX_HEADER = "";
610635
INFOPLIST_FILE = app/info.plist;
611636
INSTALL_PATH = /Applications;
612-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
637+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../Frameworks/Python.framework";
613638
MACOSX_DEPLOYMENT_TARGET = 10.14;
614639
OTHER_LDFLAGS = "$(inherited)";
615640
PRODUCT_BUNDLE_IDENTIFIER = io.plotdevice.PlotDevice;

‎app/deps/embed/Makefile‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
REPO = https://github.com/gregneagle/relocatable-python.git
2+
BUILD_OPTS = --os-version=11 --python-version=3.10.5 --upgrade-pip --pip-requirements=requirements.txt
3+
4+
Python.framework: relocatable-python
5+
python3 ./relocatable-python/make_relocatable_python_framework.py $(BUILD_OPTS)
6+
7+
relocatable-python:
8+
git clone $(REPO)
9+
10+
clean:
11+
rm -r Python.framework

‎app/deps/embed/requirements.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# --no-binary :all:
2+
xattr
3+
cachecontrol
4+
cffi
5+
lockfile
6+
pyobjc
7+
requests
8+
six

‎app/python.xcconfig‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
PYTHON = /Applications/Xcode.app/Contents/Developer/usr/bin/python3
2-
LIBRARY_SEARCH_PATHS = $(inherited) /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/config-3.8-darwin
3-
HEADER_SEARCH_PATHS = $(inherited) /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers
4-
OTHER_LDFLAGS = $(inherited) -lpython3.8
5-
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) PYTHON_BIN="/Applications/Xcode.app/Contents/Developer/usr/bin/python3" PY3K=1
1+
PYTHON_FRAMEWORK = $(PROJECT_DIR)/app/deps/embed/Python.framework
2+
PYTHON_VERSION = 3.10
3+
PYTHON = $(PYTHON_FRAMEWORK)/Versions/$(PYTHON_VERSION)/bin/python3
4+
LIBRARY_SEARCH_PATHS = $(inherited) $(PYTHON_FRAMEWORK)/Versions/$(PYTHON_VERSION)/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)-darwin
5+
HEADER_SEARCH_PATHS = $(inherited) $(PYTHON_FRAMEWORK)/Versions/$(PYTHON_VERSION)/Headers
6+
OTHER_LDFLAGS = $(inherited) -lpython$(PYTHON_VERSION)
7+
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) PYTHON_BIN="$(PYTHON)" PY3K=1

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL