Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ $$(PYTHON_XCFRAMEWORK-$(os))/Info.plist: \
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
find $$(PYTHON_FRAMEWORK-macosx) -name "*.so" -type f -exec codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f {} \; \
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
find $$(PYTHON_INSTALL_VERSION-macosx)/bin -type f -perm +111 -exec sh -c 'file "$$$$1" | grep -q Mach-O' _ {} \; -exec codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f {} \; \
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f $$(PYTHON_INSTALL_VERSION-macosx)/Resources/Python.app \
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log
codesign -s - --preserve-metadata=identifier,entitlements,flags,runtime -f $$(PYTHON_FRAMEWORK-macosx) \
2>&1 | tee -a $$(PYTHON_INSTALL-macosx)/python-$(os).codesign.log

Expand Down
5 changes: 3 additions & 2 deletions patch/Python/release.macOS.exclude
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
._Python
._Resources
Resources/._Python.app
Resources/Python.app
Versions/._Current
Versions/*/.__CodeSignature
Versions/*/._bin
Expand All @@ -17,7 +16,9 @@ Versions/*/._include
Versions/*/._lib
Versions/*/._Resources
Versions/*/._share
Versions/*/bin
Versions/*/bin/idle*
Versions/*/bin/pydoc*
Versions/*/bin/python*-config
Versions/*/etc
Versions/*/Frameworks
Versions/*/lib/python*/idlelib
Expand Down
11 changes: 11 additions & 0 deletions patch/make-relocatable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,15 @@ for module in `find . -name "*.dylib" -type f -o -name "*.so" -type f`; do
done
fi
done
for exe in `find bin Resources/Python.app/Contents/MacOS -type f -perm +111`; do
if [ "$(otool -L ${exe} 2>/dev/null | grep -c /Library/Frameworks/Python.framework)" != "0" ]; then
echo Rewrite references to Python library in ${exe}
install_name_tool -change /Library/Frameworks/Python.framework/Versions/${PYTHON_VER}/Python @rpath/Python.framework/Versions/${PYTHON_VER}/Python ${exe}
# Add an rpath pointing at the directory that contains Python.framework
# (one level up per path component, plus 3 for Python.framework/Versions/X.Y)
depth=$(( $(echo ${exe} | tr -cd '/' | wc -c) + 3 ))
rpath=@executable_path$(printf '/..%.0s' $(seq ${depth}))
install_name_tool -add_rpath ${rpath} ${exe}
fi
done
popd
Loading