-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: DarthNihilus1 <mgracer48@yahoo.com> Co-Authored-By: Spotlight <spotlight@joscomputing.space>
- Loading branch information
1 parent
574c6a9
commit 4c7a48e
Showing
4 changed files
with
107 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
python3 -m pip install wheel | ||
bash prep-PyQt.sh | ||
cd ../../client | ||
python3 -m pip install -r requirements.txt py2app | ||
py2applet --make-setup app.py icon.icns "icon.png" "taskbarDark.png" "taskbarLight.png" | ||
# build universal binary | ||
sed -i '' -e "s/)/ name='NSO-RPC')/" setup.py | ||
python3 setup.py py2app -O2 --arch=universal2 | ||
python3 ../scripts/macos-universal2/debloat-qt.py | ||
# arm64 requires codesigning to run | ||
codesign --deep --force --sign - dist/NSO-RPC.app/Contents/MacOS/* | ||
open dist |
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,30 @@ | ||
|
||
import shutil | ||
import os | ||
import sys | ||
|
||
removeFiles = [ | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtQuick3DRuntimeRender.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtQuickParticles.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtSpatialAudio.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtShaderTools.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtQuickTest.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtBluetooth.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtDesigner.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtQuick.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtHelp.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtPdf.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/lib/QtQml.framework", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/plugins/sqldrivers", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/plugins/multimedia", | ||
f"./dist/NSO-RPC.app/Contents/Resources/lib/python{sys.version_info.major}.{sys.version_info.minor}/PyQt6/Qt6/qml", | ||
] | ||
|
||
for file in removeFiles: | ||
try: | ||
rmFile = shutil.rmtree(file) | ||
print(f"Removing: {file}") | ||
except NotADirectoryError: | ||
os.remove(file) | ||
except FileNotFoundError: | ||
pass |
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,32 @@ | ||
#!/bin/bash | ||
# Provided by @spotlightishere on Github | ||
# https://github.com/MCMi460/NSO-RPC/pull/86#issuecomment-1605700512 | ||
|
||
alias python3=python3.10 | ||
|
||
# Download and unpack | ||
python3 -m pip download --only-binary=:all: --platform=macosx_13_0_x86_64 PyQt6_Qt6 | ||
python3 -m pip download --only-binary=:all: --platform=macosx_13_0_arm64 PyQt6_Qt6 | ||
python3 -m wheel unpack PyQt6_*arm64.whl --dest arm64 | ||
python3 -m wheel unpack PyQt6_*x86_64.whl --dest x86_64 | ||
|
||
# We'll use x86_64 as our basis. | ||
# As of writing, PyQt6_Qt6 specifies a minimum of 10.14 for x86_64, and 11.0 for arm64. | ||
# We'll reuse this tag; it should be updated if this ever changes in the future. | ||
python3 -m wheel tags --platform-tag macosx_10_14_universal2 PyQt6_*x86_64.whl | ||
python3 -m wheel unpack PyQt6_*universal2.whl --dest universal | ||
|
||
# https://stackoverflow.com/a/46020381 | ||
merge_frameworks() { | ||
# Remove the leading universal/ from this path. | ||
binary_path="${1##universal/}" | ||
lipo -create -arch x86_64 "x86_64/$binary_path" "arm64/$binary_path" -output "universal/$binary_path" | ||
} | ||
export -f merge_frameworks | ||
|
||
# Iterate through all frameworks and libraries, and lipo together | ||
find universal -perm +111 -type f -exec sh -c 'merge_frameworks "$1"' _ {} \; | ||
python3 -m wheel pack universal/PyQt6_* | ||
|
||
# Finally, install our universal python3.10 -m wheel. | ||
python3 -m pip install PyQt6_*universal2.whl --force-reinstall |