aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2023-09-28 16:28:40 -0700
committerMicah Lee <micah@micahflee.com>2023-09-28 16:28:40 -0700
commited90261833b99e20c37e0bfcd74a3422e1726dc9 (patch)
tree3a84af29710e5f54e55fcf94cfe19cd829cb144f
parent35e288e60f6fe0489177167721721594156807a2 (diff)
downloadonionshare-ed90261833b99e20c37e0bfcd74a3422e1726dc9.tar.gz
onionshare-ed90261833b99e20c37e0bfcd74a3422e1726dc9.zip
Working on the macOS cx_Freeze
-rw-r--r--desktop/scripts/build-macos.py97
-rw-r--r--desktop/setup-freeze.py13
2 files changed, 18 insertions, 92 deletions
diff --git a/desktop/scripts/build-macos.py b/desktop/scripts/build-macos.py
index 345646fc..c2e4251c 100644
--- a/desktop/scripts/build-macos.py
+++ b/desktop/scripts/build-macos.py
@@ -178,98 +178,37 @@ def cleanup_build():
except FileNotFoundError:
pass
- print("> Move files around so Apple will notarize")
- # https://github.com/marcelotduarte/cx_Freeze/issues/594
- # https://gist.github.com/TechnicalPirate/259a9c24878fcad948452cb148af2a2c#file-custom_bdist_mac-py-L415
-
- # Move lib from MacOS into Resources
- os.rename(
- f"{app_path}/Contents/MacOS/lib",
- f"{app_path}/Contents/Resources/lib",
- )
- run(
- ["ln", "-s", "../Resources/lib"],
- cwd=f"{app_path}/Contents/MacOS",
- )
-
- # Move frameworks from Resources/lib into Frameworks
- os.makedirs(f"{app_path}/Contents/Frameworks", exist_ok=True)
- for framework_filename in glob.glob(
- f"{app_path}/Contents/Resources/lib/PySide6/Qt/lib/Qt*.framework"
- ):
- basename = os.path.basename(framework_filename)
-
- os.rename(framework_filename, f"{app_path}/Contents/Frameworks/{basename}")
- run(
- ["ln", "-s", f"../../../../../Frameworks/{basename}"],
- cwd=f"{app_path}/Contents/Resources/lib/PySide6/Qt/lib",
- )
- if os.path.exists(f"{app_path}/Contents/Frameworks/{basename}/Resources"):
- if not os.path.exists(f"{app_path}/Contents/Frameworks/{basename}/Versions/A/Resources"):
- os.rename(
- f"{app_path}/Contents/Frameworks/{basename}/Resources",
- f"{app_path}/Contents/Frameworks/{basename}/Versions/A/Resources",
- )
- else:
- shutil.rmtree(f"{app_path}/Contents/Frameworks/{basename}/Resources")
- run(
- ["ln", "-s", "Versions/A/Resources"],
- cwd=f"{app_path}/Contents/Frameworks/{basename}",
- )
-
- try:
- run(
- ["ln", "-s", "A", "Current"],
- cwd=f"{app_path}/Contents/Frameworks/{basename}/Versions",
- )
- except:
- pass
-
- # Move Qt plugins
- os.rename(
- f"{app_path}/Contents/Resources/lib/PySide6/Qt/plugins",
- f"{app_path}/Contents/Frameworks/plugins",
- )
- run(
- ["ln", "-s", "../../../../Frameworks/plugins"],
- cwd=f"{app_path}/Contents/Resources/lib/PySide6/Qt",
- )
-
print("> Delete more unused PySide6 stuff to save space")
for filename in [
f"{app_path}/Contents/Resources/lib/PySide6/Designer.app",
- f"{app_path}/Contents/Resources/lib/PySide6/examples",
f"{app_path}/Contents/Resources/lib/PySide6/glue",
f"{app_path}/Contents/Resources/lib/PySide6/include",
f"{app_path}/Contents/Resources/lib/PySide6/lupdate",
- f"{app_path}/Contents/Resources/lib/PySide6/libpyside6.abi3.6.4.dylib",
f"{app_path}/Contents/Resources/lib/PySide6/Qt/qml",
- f"{app_path}/Contents/Resources/lib/shiboken6/libshiboken6.abi3.6.4.dylib",
f"{app_path}/Contents/Resources/lib/PySide6/Assistant.app",
f"{app_path}/Contents/Resources/lib/PySide6/Linguist.app",
- f"{app_path}/Contents/Resources/lib/PySide6/libpyside6qml.abi3.6.4.dylib",
f"{app_path}/Contents/Resources/lib/PySide6/lrelease",
f"{app_path}/Contents/Resources/lib/PySide6/qmlformat",
f"{app_path}/Contents/Resources/lib/PySide6/qmllint",
f"{app_path}/Contents/Resources/lib/PySide6/qmlls",
- f"{app_path}/Contents/MacOS/QtBluetooth",
- f"{app_path}/Contents/MacOS/QtConcurrent",
- f"{app_path}/Contents/MacOS/QtDesigner",
- f"{app_path}/Contents/MacOS/QtNetworkAuth",
- f"{app_path}/Contents/MacOS/QtNfc",
- f"{app_path}/Contents/MacOS/QtOpenGL",
- f"{app_path}/Contents/MacOS/QtOpenGLWidgets",
- f"{app_path}/Contents/MacOS/QtPositioning",
- f"{app_path}/Contents/MacOS/QtQuick3D",
- f"{app_path}/Contents/MacOS/QtQuick3DRuntimeRender",
- f"{app_path}/Contents/MacOS/QtQuick3DUtils",
- f"{app_path}/Contents/MacOS/QtShaderTools",
- f"{app_path}/Contents/MacOS/QtStateMachine",
- f"{app_path}/Contents/MacOS/QtSvgWidgets",
- f"{app_path}/Contents/MacOS/QtWebChannel",
- f"{app_path}/Contents/MacOS/QtWebEngineCore",
- f"{app_path}/Contents/MacOS/QtWebEngineQuick",
- f"{app_path}/Contents/MacOS/QtXml",
+ f"{app_path}/Contents/Resources/lib/QtBluetooth",
+ f"{app_path}/Contents/Resources/lib/QtConcurrent",
+ f"{app_path}/Contents/Resources/lib/QtDesigner",
+ f"{app_path}/Contents/Resources/lib/QtNetworkAuth",
+ f"{app_path}/Contents/Resources/lib/QtNfc",
+ f"{app_path}/Contents/Resources/lib/QtOpenGL",
+ f"{app_path}/Contents/Resources/lib/QtOpenGLWidgets",
+ f"{app_path}/Contents/Resources/lib/QtPositioning",
+ f"{app_path}/Contents/Resources/lib/QtQuick3D",
+ f"{app_path}/Contents/Resources/lib/QtQuick3DRuntimeRender",
+ f"{app_path}/Contents/Resources/lib/QtQuick3DUtils",
+ f"{app_path}/Contents/Resources/lib/QtShaderTools",
+ f"{app_path}/Contents/Resources/lib/QtStateMachine",
+ f"{app_path}/Contents/Resources/lib/QtSvgWidgets",
+ f"{app_path}/Contents/Resources/lib/QtWebChannel",
+ f"{app_path}/Contents/Resources/lib/QtWebEngineCore",
+ f"{app_path}/Contents/Resources/lib/QtWebEngineQuick",
+ f"{app_path}/Contents/Resources/lib/QtXml",
]:
if os.path.isfile(filename) or os.path.islink(filename):
os.remove(filename)
diff --git a/desktop/setup-freeze.py b/desktop/setup-freeze.py
index 9fea8925..663fbf67 100644
--- a/desktop/setup-freeze.py
+++ b/desktop/setup-freeze.py
@@ -44,22 +44,9 @@ if platform.system() == "Windows":
exec_icon = os.path.join("onionshare", "resources", "onionshare.ico")
elif platform.system() == "Darwin":
- import PySide6
- import shiboken6
-
include_msvcr = False
gui_base = None
exec_icon = None
- include_files += [
- (
- os.path.join(PySide6.__path__[0], "libpyside6.abi3.6.5.dylib"),
- "libpyside6.abi3.6.5.dylib",
- ),
- (
- os.path.join(shiboken6.__path__[0], "libshiboken6.abi3.6.5.dylib"),
- "libshiboken6.abi3.6.5.dylib",
- ),
- ]
elif platform.system() == "Linux":
include_msvcr = False