-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- feat: drag to archive/revert (requires PyQt6) - utility included to patch PyQt6-Qt6 with Universal 2 binary using `lipo`
- Loading branch information
Showing
7 changed files
with
185 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# functions | ||
trash() { osascript -e "tell application \"Finder\" to delete POSIX file \"$(realpath "$1")\"" > /dev/null; } | ||
|
||
echo "PyQt Universal 2 Binary Patch Utility" | ||
|
||
if [[ "$(sysctl -n machdep.cpu.brand_string)" != *"Apple"* ]]; then | ||
echo "This script must be run on an Apple Silicon Mac. Nothing to do." | ||
echo "PyQt Universal 2 Binary Patch Utility complete." | ||
exit | ||
fi | ||
|
||
echo "Current Directory: $(pwd)" | ||
|
||
echo "Activating virtual environment..." | ||
source ./venv/bin/activate | ||
|
||
SITE_PACKAGE=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") | ||
echo "Site Package: $SITE_PACKAGE" | ||
|
||
echo "Patching PyQt6..." | ||
# make a backup, preserve permissions | ||
cp -R $SITE_PACKAGE/PyQt6 $SITE_PACKAGE/PyQt6.bak | ||
|
||
# reinstall PyQt6 as arm64 | ||
arch -arm64 pip install PyQt6 --force-reinstall | ||
|
||
# Patch | ||
cd $SITE_PACKAGE | ||
echo "Converting to Universal Binary..." | ||
find ./PyQt6/Qt6 -type f -perm +111 -exec sh -c 'xcrun lipo -create -output "{}" "{}" "$(echo "{}" | sed "s|^./PyQt6/|./PyQt6.bak/|")"' \; | ||
echo "Patching complete." | ||
|
||
deactivate | ||
|
||
echo "PyQt Universal 2 Binary Patch Utility complete." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
py2app~=0.28.7 | ||
setuptools<70.0.0 | ||
wheel | ||
pyqt6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters