Skip to content

Commit

Permalink
Merge pull request #2334 from tomkins/macos
Browse files Browse the repository at this point in the history
Update macOS support to run on arm64
  • Loading branch information
legoktm authored Dec 20, 2024
2 parents 27df203 + c1526dd commit ba63e54
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 16 deletions.
3 changes: 1 addition & 2 deletions client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
all: help

# We prefer to use python3.11 if it's available, especially on arm64 based Macs,
# which would not be able to install the virtual environment without an x86_64
# Python 3.11, but we're also OK with just python3 if that's all we've got
# but we're also OK with just python3 if that's all we've got
PYTHON := $(if $(shell bash -c "command -v python3.11"), python3.11, python3)

SEMGREP_FLAGS := --exclude "tests/" --error --strict --verbose
Expand Down
9 changes: 1 addition & 8 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,7 @@ socat TCP4-LISTEN:8081,fork,reuseaddr TCP4:A.B.C.D:8081

#### Set up the SecureDrop Client
1. Open a new terminal window.
2. Install Homebrew
a. If you use an Intel based machine, follow the instructions at https://brew.sh/
b. If you use an Apple Silicon based machine (M1 or M2 Macs):
1. (Informational) If you already have a native `arm64` version of Homebrew, you will wind up with a separate Homebrew installation for each architecture. While they do not conflict, combining them in your `PATH` permanently may cause confusion about which brews are installed where. You may want to modify your `PATH` temporarily to perform this installation. The environment you create in this session will continue to work in subsequent sessions.
2. Run `/usr/sbin/softwareupdate --install-rosetta` to allow you to run `x86_64` binaries
3. Enter a shell in `x86_64` mode with `arch -x86_64 bash`
4. Install Homebrew via the instructions at https://brew.sh/
5. Install the dependencies below in the same `x86_64` shell session
2. Install [Homebrew](https://brew.sh/)
3. Install dependencies via Homebrew: `brew install [email protected] gnupg oath-toolkit`
4. clone the SecureDrop Client repo and install its dependencies
```
Expand Down
63 changes: 62 additions & 1 deletion client/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions client/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ python-dateutil = "^2.7.5"
# In production these two are installed using a system package
# so match those versions exactly
PyQt5 = [
{version = "=5.15.9", python = ">=3.11"}, # bookworm
{version = "=5.15.9", python = ">=3.11", platform = "linux"}, # bookworm
{version = "^5.15.11", python = ">=3.11", platform = "darwin"},
]
PyQt5-Qt5 = [
{version = "=5.15.2", python = ">=3.11", platform = "linux"}, # bookworm
{version = "^5.15.15", python = ">=3.11", platform = "darwin"},
]
PyQt5-sip = [
{version = "=12.11.1", python = ">=3.11"}, # bookworm
{version = "=12.11.1", python = ">=3.11", platform = "linux"}, # bookworm
{version = "^12.16.1", python = ">=3.11", platform = "darwin"},
]
PyAutoGUI = "*"
babel = "^2.16.0"
Expand Down
3 changes: 0 additions & 3 deletions client/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ done
source scripts/setup-tmp-directories.sh

PYTHON="poetry run python"
if [[ $OSTYPE == 'darwin'* ]] && [[ "$(uname -m)" == "arm64" ]]; then
PYTHON="arch -x86_64 ${PYTHON}"
fi

GNUPGHOME="$SDC_HOME/gpg"
export GNUPGHOME
Expand Down

0 comments on commit ba63e54

Please sign in to comment.