-
Notifications
You must be signed in to change notification settings - Fork 128
Building on macOS arm64
These instructions are for Macs running Apple Silicon processors (M1, M2...). Command lines are executed in a terminal running in normal arm64 mode (the command uname -m
returns arm64
)
If you want to contribute to the project, please visit the official repository, otherwise just download the code, expand the zip
archive and move the source folder to the correct location.
There are two exclusive possibilities, either with MacPorts or Homebrew: pick the one that works... Anyways, both need building tools:
Install the official Apple developer tools. In the Mac AppStore, search Xcode
.
You install CMake
from [https://cmake.org/download/](the official repository).
Make sure you download a universal
archive.
- install
macports
for macOS Ventura v13 - Open a terminal and execute command
export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH"
You can also customize your .zshrc
accordingly, but that may conflict with homebrew.
- install the required libraries (it may take a while) with terminal command
sudo port install hunspell lua53 poppler-qt5 qt5-qtbase qt5-qtdeclarative qt5-qtscript qt5-qttools
lua53
is the latest version provided for arm64. It may take a while and you will have to press the enter
key multiple times.
- In the terminal,
cd
to the TeXworks source root directory and execute
mkdir build
cd build
cmake -DCMAKE_OSX_ARCHITECTURES="arm64" -DQT_DEFAULT_MAJOR_VERSION=5 -DLUA_VERSION_STRING="53" ..
make -j
make test
- This creates
TeXworks.app
that you can move and launch. Remember that running twoTeXworks
concurrently may sometimes cause unexpected results.
- Install homebrew with terminal command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Open a terminal and execute command
export PATH="/opt/homebrew/bin:$PATH"
You can also customize your .zshrc
accordingly, but that may conflict with macports.
- install the required libraries (it may take a while) with terminal command
brew install hunspell poppler-qt5 lua qt@5
brew link --force poppler-qt5
There is no poppler-qt6
.
- In the terminal,
cd
to the TeXworks source root directory and execute
mkdir build
cd build
cmake -DQT_DEFAULT_MAJOR_VERSION=5 -DQt5_DIR=/opt/homebrew/Cellar/qt@5/5.15.8_2/lib/cmake/Qt5 -DCMAKE_PREFIX_PATH=/opt/homebrew -DCMAKE_OSX_ARCHITECTURES="arm64" ..
make -j
make test
Beware that Qt
version is explicitly given. It may have changed.
- This creates
TeXworks.app
that you can move and launch. Remember that running twoTeXworks
concurrently may sometimes cause unexpected results.
If you install anaconda, it can take precedence over Macports or homebrew. Whereas the build succeeds in appearance, the resulting application may be unbearably slow in some circumstances. To avoid this, you can run conda deactivate
just before launching cmake
and make
.
If you plan to use an IDE, be sure to use an arm64
compliant configuration.