Closed m-zheng closed 1 year ago
I don't really see why this would be failing on M1/M2 specifically.
Can you try installing synctex directly: brew install zegervdv/zathure/synctex
?
You may want to brew uninstall synctex
first to clean up.
After hours of debugging, I have fixed it myself. It is something to do with the dbus on Apple silicon chip. For those who also run into this rabbit hole, below is my solution.
org.freedesktop.dbus-session.plist
from folder ~/Library/LaunchAgents
, /Library/LaunchAgents
and /Library/LaunchDaemons
if it exists there.
mv ~/.zshrc ~/.zshrc_bak
mv ~/.zprofile ~/.zprofile_bak
mv ~/.profile ~/.profile_bak
mv ~/.bashrc ~/.bashrc_bak
mv ~/.bash-profile ~/.bash-profil_bak
mv ~/.profile ~/.profile_bak
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH=/opt/homebrew/bin:$PATH
to ~/.zshrc
. Then source ~/.zshrc
, and make sure echo $(brew --prefix)
return /opt/homebrew
brew uninstall dbus girara zathura zathura-pdf-poppler
if you have previously installed these packages./usr/sbin/softwareupdate --install-rosetta --agree-to-license
arch -x86_64 zsh
export PATH=/opt/homebrew/bin:$PATH
in ~/.zshrc
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH=/usr/local/bin:$PATH
to ~/.zshrc
. Then source ~/.zshrc
, and make sure echo $(brew --prefix)
return /usr/local
brew install dbus
export DBUS_SESSION_BUS_ADDRESS="unix:path=$DBUS_LAUNCHD_SESSION_BUS_SOCKET"
to ~/.zshrc
<auth><\auth>
in /usr/local/opt/dbus/share/dbus-1/session.conf
from EXTERNAL
to DBUS_COOKIE_SHA1
.brew services start dbus
arch -x86_64 zsh
and make sure echo $(brew --prefix)
return /usr/local
and echo $(launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET)
is not empty. If it is empty inside tmux, check it without the tmux.brew tap zegervdv/zathura
brew install girara --HEAD
brew install zathura --HEAD --with-synctex
brew install zathura-pdf-poppler
mkdir -p $(brew --prefix zathura)/lib/zathura
ln -s $(brew --prefix zathura-pdf-poppler)/libpdf-poppler.dylib $(brew --prefix zathura)/lib/zathura/libpdf-poppler.dylib
brew pin dbus girara zathura zathura-pdf-poppler
. You can upgrade brew packages with brew update && brew upgrade --ignore-pinned --formula
if needed in the future.export PATH=/opt/homebrew/bin:$PATH
and export PATH=/usr/local/bin:$PATH
in ~/.zshrc
. Then add below to the top of ~/.zshrc
. This will get rid of errors when you try to use intel brew.
# Homebrew setup
if [[ $(uname -m) == 'arm64' ]]; then
BREWPATH=/opt/homebrew/bin
else
BREWPATH=/usr/local/bin
fi
export PATH=$BREWPATH:$PATH
20. exit the terminal, and run below line by line to prevent these packages from upgrading. Again, You can upgrade brew packages with `brew update && brew upgrade --ignore-pinned --formula` if needed in the future.
brew pin dbus brew pin girara brew pin zathura brew pin zathura-pdf-poppler
21. below is my `$PATH`. You can check it against yours if something goes wrong.
/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/opt/homebrew/Caskroom/miniconda/base/bin:/opt/homebrew/Caskroom/miniconda/base/condabin:/opt/homebrew/bin
22. enjoy.
23. if everything works well, manually bring back your previous zsh config to `~/.zshrc`. If seeing errors related to brew path for your alias, update it with `$BREWPATH` or `$(brew --prefix)`. In my case, a single `~/.zshrc` can do all the job and no need to deal with files in step 1.
Summary:
This method installs two versions of Homebrew on apple silicon machines. The system will look for executable files from `/opt/homebrew/bin` first. Because you cannot install some packages with apple silicon brew, the system will look for executable files from `/usr/local/bin` which are installed by intel brew.
With this method, particularly from step 5 to 11, you can install all old or scientific packages that can only run on intel machines, such as `python2`, `java jdk 8`. Meanwhile, your apple silicon brew still takes advantages of the chip.
I have been struggling to install zathura with synctex option on macos ventura (apple silicon chip).
Below is the command I have used. It works perfectly fine on macos ventura (intel chip) except changing the EXTERNAL on
/usr/local/opt/dbus/share/dbus-1/session.conf
.Below is the output from
brew install zathura --HEAD --with-synctex
Below is the content from
~/Library/Logs/Homebrew/synctex/01.clang
I have reboot the computer to make sure
$DBUS_LAUNCHD_SESSION_BUS_SOCKET
andecho $(launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET)
are not empty before runningbrew install zathura --HEAD --with-synctex
. But no luck.I also observed that dbus service is never running after checking 'brew services info dbus`.
Any help would be highly appreciated.