mirror of
https://github.com/onionshare/onionshare.git
synced 2025-04-29 14:19:30 -04:00
Merge pull request #2007 from onionshare/fix-mac
Some checks are pending
Build / build-win64 (push) Waiting to run
Build / build-mac-intel (push) Waiting to run
Build / build-flatpak (push) Waiting to run
Build / build-snap (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Run Tests / test-cli (push) Waiting to run
Run Tests / test-desktop (push) Waiting to run
Some checks are pending
Build / build-win64 (push) Waiting to run
Build / build-mac-intel (push) Waiting to run
Build / build-flatpak (push) Waiting to run
Build / build-snap (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Run Tests / test-cli (push) Waiting to run
Run Tests / test-desktop (push) Waiting to run
Fix macos intel build to actually build on an Intel mac (macos-latest switched to arm in 2024)
This commit is contained in:
commit
863bc4c47c
4 changed files with 31 additions and 3 deletions
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
@ -116,7 +116,7 @@ jobs:
|
||||||
path: ~\onionshare-win64.zip
|
path: ~\onionshare-win64.zip
|
||||||
|
|
||||||
build-mac-intel:
|
build-mac-intel:
|
||||||
runs-on: macos-latest
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
@ -212,6 +212,10 @@ jobs:
|
||||||
cp -r /Volumes/Postgres-2.6.5-14/Postgres.app /Applications/
|
cp -r /Volumes/Postgres-2.6.5-14/Postgres.app /Applications/
|
||||||
hdiutil detach /Volumes/Postgres-2.6.5-14
|
hdiutil detach /Volumes/Postgres-2.6.5-14
|
||||||
|
|
||||||
|
- name: Touch dylib file for build to finish
|
||||||
|
run: |
|
||||||
|
touch /usr/local/lib/libmimerapi.dylib
|
||||||
|
|
||||||
- name: Build OnionShare
|
- name: Build OnionShare
|
||||||
run: |
|
run: |
|
||||||
cd desktop
|
cd desktop
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import os
|
import os
|
||||||
import inspect
|
import inspect
|
||||||
import click
|
import click
|
||||||
|
import platform
|
||||||
import subprocess
|
import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
import glob
|
import glob
|
||||||
|
@ -16,7 +17,7 @@ root = os.path.dirname(
|
||||||
)
|
)
|
||||||
desktop_dir = os.path.join(root, "desktop")
|
desktop_dir = os.path.join(root, "desktop")
|
||||||
|
|
||||||
identity_name_application = "Developer ID Application: Micah Lee (N9B95FDWH4)"
|
identity_name_application = "Developer ID Application: Science & Design, Inc. (7WLJ4UBL5L)"
|
||||||
entitlements_plist_path = f"{desktop_dir}/package/Entitlements.plist"
|
entitlements_plist_path = f"{desktop_dir}/package/Entitlements.plist"
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,7 +123,6 @@ def cleanup_build():
|
||||||
"QtQuickShapes",
|
"QtQuickShapes",
|
||||||
"QtQuickTest",
|
"QtQuickTest",
|
||||||
"QtNetwork",
|
"QtNetwork",
|
||||||
"QtSvg",
|
|
||||||
"QtDesignerComponents",
|
"QtDesignerComponents",
|
||||||
"QtMultimediaWidgets",
|
"QtMultimediaWidgets",
|
||||||
"QtQmlModels",
|
"QtQmlModels",
|
||||||
|
@ -228,6 +228,18 @@ def cleanup_build():
|
||||||
else:
|
else:
|
||||||
print(f"Cannot delete, filename not found: {filename}")
|
print(f"Cannot delete, filename not found: {filename}")
|
||||||
|
|
||||||
|
# Set a symlink for Qt's platforms and imageformats plugins, which seems to be necessary only on arm
|
||||||
|
if platform.system() == "Darwin" and platform.processor() == "arm":
|
||||||
|
platforms_target_path = os.path.join("..", "Resources", "lib", "PySide6", "Qt", "plugins", "platforms")
|
||||||
|
platforms_symlink_path = os.path.join(app_path, "Contents", "MacOS", "platforms")
|
||||||
|
|
||||||
|
os.symlink(platforms_target_path, platforms_symlink_path)
|
||||||
|
|
||||||
|
imageformats_target_path = os.path.join("..", "Resources", "lib", "PySide6", "Qt", "plugins", "imageformats")
|
||||||
|
imageformats_symlink_path = os.path.join(app_path, "Contents", "MacOS", "imageformats")
|
||||||
|
os.symlink(imageformats_target_path, imageformats_symlink_path)
|
||||||
|
|
||||||
|
|
||||||
after_size = get_size(f"{app_path}")
|
after_size = get_size(f"{app_path}")
|
||||||
freed_bytes = before_size - after_size
|
freed_bytes = before_size - after_size
|
||||||
freed_mb = int(freed_bytes / 1024 / 1024)
|
freed_mb = int(freed_bytes / 1024 / 1024)
|
||||||
|
|
|
@ -120,6 +120,9 @@ def get_tor_macos(gpg, torkey, macos_url, macos_filename, expected_macos_sig):
|
||||||
dist_path = os.path.join(root_path, "onionshare", "resources", "tor")
|
dist_path = os.path.join(root_path, "onionshare", "resources", "tor")
|
||||||
if not os.path.exists(dist_path):
|
if not os.path.exists(dist_path):
|
||||||
os.makedirs(dist_path, exist_ok=True)
|
os.makedirs(dist_path, exist_ok=True)
|
||||||
|
tor_lib_dir = os.path.join(root_path, "onionshare", "resources", "tor", "lib")
|
||||||
|
if not os.path.exists(tor_lib_dir):
|
||||||
|
os.makedirs(tor_lib_dir, exist_ok=True)
|
||||||
|
|
||||||
# Make sure the working folder exists
|
# Make sure the working folder exists
|
||||||
if not os.path.exists(working_path):
|
if not os.path.exists(working_path):
|
||||||
|
@ -163,10 +166,17 @@ def get_tor_macos(gpg, torkey, macos_url, macos_filename, expected_macos_sig):
|
||||||
os.path.join(dist_path, "tor"),
|
os.path.join(dist_path, "tor"),
|
||||||
)
|
)
|
||||||
os.chmod(os.path.join(dist_path, "tor"), 0o755)
|
os.chmod(os.path.join(dist_path, "tor"), 0o755)
|
||||||
|
# This is necessary for cx_freeze itself to work...
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
os.path.join(dmg_tor_path, "MacOS", "Tor", "libevent-2.1.7.dylib"),
|
os.path.join(dmg_tor_path, "MacOS", "Tor", "libevent-2.1.7.dylib"),
|
||||||
os.path.join(dist_path, "libevent-2.1.7.dylib"),
|
os.path.join(dist_path, "libevent-2.1.7.dylib"),
|
||||||
)
|
)
|
||||||
|
# ...but the libevent-2.1.7.dylib now seems to also need to be in a 'lib'
|
||||||
|
# subfolder of the tor/ folder to work on MacOS, so copy it there too.
|
||||||
|
shutil.copyfile(
|
||||||
|
os.path.join(dmg_tor_path, "MacOS", "Tor", "libevent-2.1.7.dylib"),
|
||||||
|
os.path.join(tor_lib_dir, "libevent-2.1.7.dylib"),
|
||||||
|
)
|
||||||
|
|
||||||
# Eject dmg
|
# Eject dmg
|
||||||
subprocess.call(["diskutil", "eject", "/Volumes/Tor Browser"])
|
subprocess.call(["diskutil", "eject", "/Volumes/Tor Browser"])
|
||||||
|
|
|
@ -77,6 +77,7 @@ build_exe_options = {
|
||||||
"shiboken6",
|
"shiboken6",
|
||||||
"PySide6.QtCore",
|
"PySide6.QtCore",
|
||||||
"PySide6.QtGui",
|
"PySide6.QtGui",
|
||||||
|
"PySide6.QtSvg",
|
||||||
"PySide6.QtWidgets",
|
"PySide6.QtWidgets",
|
||||||
],
|
],
|
||||||
"excludes": [
|
"excludes": [
|
||||||
|
@ -139,6 +140,7 @@ if platform.system() == "Darwin" and platform.processor() == "arm":
|
||||||
"shiboken6",
|
"shiboken6",
|
||||||
"PySide6.QtCore",
|
"PySide6.QtCore",
|
||||||
"PySide6.QtGui",
|
"PySide6.QtGui",
|
||||||
|
"PySide6.QtSvg",
|
||||||
"PySide6.QtWidgets",
|
"PySide6.QtWidgets",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue