zegervdv / homebrew-zathura

Homebrew formulae to build Zathura on Mac OS X
553 stars 43 forks source link

Can't install Zathura in Monterey 12.0.1 #83

Closed idr4n closed 3 years ago

idr4n commented 3 years ago

After recently upgrading to Monterey, I was having the same issue as #81 (i.e., only the title bar was rendering). So I decided to uninstalled Zathura and install it again, however when trying to reinstall, I'm getting the following error:

==> Installing zathura from zegervdv/zathura
==> mkdir build
==> meson build --prefix /usr/local/Cellar/zathura/0.4.8
Last 15 lines from $HOME/Library/Logs/Homebrew/zathura/02.0.4.8:
Compiler for C supports arguments -fvisibility=hidden: YES
Run-time dependency sqlite3 found: YES 3.36.0
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency synctex found: NO (tried pkgconfig, framework and cmake)
Library magic found: YES
Run-time dependency libseccomp found: NO (tried pkgconfig, framework and cmake)
Configuring zathura-version.h using configuration
Found pkg-config: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/pkg-config (0.29.2)
Program glib-compile-resources found: YES (/usr/local/opt/glib/bin/glib-compile-resources)
Program rsvg-convert found: YES (/usr/local/opt/librsvg/bin/rsvg-convert)

data/meson.build:22:0: ERROR: Function does not take positional arguments.

A full log can be found at /private/tmp/zathura-20211028-5259-uyljll/zathura-0.4.8/build/meson-logs/meson-log.txt

No logs are being created in the file mentioned in the last line.

Both brew install zathura and brew install zathura --HEAD gives me the same error.

I have updated cmake to the latest version using brew.

Any ideas on how to tackle this issue? Thanks in advance!

phye commented 3 years ago

Removing girara/zathura and reinstalling zathura will not hit the compile issue.

However, even if I can compile zathura correctly, it just does not work at all (except the title bar)

image

flimofly commented 3 years ago

I have the same issue but I do see these errors for the sandboxd process in Console:

idr4n commented 3 years ago

Removing girara/zathura and reinstalling zathura will not hit the compile issue.

However, even if I can compile zathura correctly, it just does not work at all (except the title bar)

image

I was able to install zathura (--HEAD) in a new Mac (M1) with zathura-pdf-poppler, but I'm getting issue as illustrated by @phye.

flimofly commented 3 years ago

@ivanddm Do you see the same errors in Console?

idr4n commented 3 years ago

@flimofly You mean in Mac's Console app? If yes, then no, I don't see any errors being reported there. Let me know if I should look somewhere else.

flimofly commented 3 years ago

@ivanddm Yes, in the Mac Console app (first press Start in Console, then try to open a pdf using the zathura command in the Terminal, then search for zathura in Console).

@zegervdv Any ideas? I have tried granting Full Disk Access to the zathura process but that didn't solve the problem.

idr4n commented 3 years ago

@flimofly Yes, now I get what you meant. So I'm getting this error when launching zathura from the terminal:

System Policy: zathura(7623) deny(1) file-read-data /Users/username/Library/Autosave Information
Violation:       deny(1) file-read-data /Users/username/Library/Autosave Information
Process:         zathura [7623]
Path:            /opt/homebrew/Cellar/zathura/HEAD-c6ec504/bin/zathura
Load Address:    0x100cbc000
Identifier:      zathura
Version:         ??? (???)
Code Type:       arm64 (Native)
Parent Process:  zsh [7275]
Responsible:     /Applications/iTerm.app/Contents/MacOS/iTerm2

There is more reported in the same error, but not sure if it would be relevant...

flimofly commented 3 years ago

Thanks. I also get this error, which is macOS' Daemon for the Transparency, Consent, and Control Subsystem.

<TCCDProcess: identifier=<ID of InvalidCode>, pid=16248, auid=501, euid=0, binary_path=/usr/local/Cellar/zathura/HEAD-dcaf4c6/bin/zathura> attempted to call TCCAccessRequest for kTCCServiceAccessibility without the recommended com.apple.private.tcc.manager.check-by-audit-token entitlement

Looks like this has something to do with entitlements/permissions. I've tried to run sudo zathura but that doesn't help.

flimofly commented 3 years ago

Running codesign -d --entitlements :- /usr/local/Cellar/zathura/HEAD-dcaf4c6/bin/zathura to check zathura's entitlements results in:

code object is not signed at all
zegervdv commented 3 years ago

I've just updated to Monterey and I am seeing the same issue. Even on the 0.4.8 release (after patching meson).

I'm not sure if the issue with the sandbox is related. Why would zathura even try to read from Autosave Information. Was this sandboxing expanded with Monterey, or were those errors already there on Big Sur?

flimofly commented 3 years ago

I think you're right that the sandbox issue is not causing this problem, if only because zathura is allowed to run. It just can't display the pdf. But just to be sure it would be helpful if someone who is still on Big Sur could check Console.

If it's not this I have no idea.

phye commented 3 years ago

Not sure if there're any updates from upstream? I have to that apple preview is not so keyboard friendly, even if I've applied some key remappings using karabiner: j/k works well, but I do miss the f+num key sequences to follow pdf links

zegervdv commented 3 years ago

If you install with --HEAD you should get the latest changes, but I don't think macOS compatibility is a priority for them. I'm hoping this is a GTK issue which may be solved eventually.

jvdoorn commented 3 years ago

I found a related issue on the zathura git itself: https://git.pwmt.org/pwmt/zathura/-/issues/251

jvdoorn commented 3 years ago

I have found a (temporary) fix for the display issue. I'd like to refer people to https://gitlab.gnome.org/GNOME/gtk/-/issues/4395 for more information and again to the issue on the zathura repository itself https://git.pwmt.org/pwmt/zathura/-/issues/251. I'll describe the fix below.

The issue is caused by a problem in GTK. There is a fix available for it but it has not been released yet. To compile zathura against the GTK version that includes the fix install the unofficial release (special thanks to Tolga Tarhan (@ttarhan)):

brew uninstall gtk+3 --ignore-dependencies
brew install ttarhan/gtk-fix/gtk+3

After this, recompile zathura (for completeness I have included the steps to do so):

git clone https://git.pwmt.org/pwmt/zathura.git
cd zathura
meson build
cd build
ninja
ninja install

After this you should be able to run zathura again. Once the fix has been put on the official GTK release you should revert your homebrew packages back using:

brew uninstall gtk+3 --ignore-dependencies
brew untap ttarhan/gtk-fix/gtk+3
brew install gtk+3

Hope this helps!

zegervdv commented 3 years ago

@jvdoorn thanks for finding the fix.

Some remarks though: You only need to install the gtk+3 tap manually, you can just recompile zathura via brew (you don't even seem to need the --HEAD version, 0.4.8 seems to work fine too. This will avoid you having to install zathura and plugins manually, which may be a pain to clean up later (which you also will need to do manually) if this eventually gets solved.

For me I got it to work with only these steps:

brew uninstall gtk+3 --ignore-dependencies
brew install ttarhan/gtk-fix/gtk+3

brew rm zathura-pdf-mupdf mathura
brew install zathura zathura-pdf-mupdf

I'm not even sure if reinstalling zathura is even needed, it might just be sufficient to update the gtk libraries.

idr4n commented 3 years ago

@zegervdv Your solution works for me. I'm able to install Zathura in Monterrey now with the new meson update and installing ttarhan/gtk-fix/gtk+3 solves the displaying issue as well.

I'm closing this issue therefore. Thanks a lot for the help in sorting this out!

sbarrios93 commented 3 years ago

Apparently the repo with the gtk fix does not exist anymore

> brew install ttarhan/gtk-fix/gtk+3

==> Tapping ttarhan/gtk-fix
Cloning into '/opt/homebrew/Library/Taps/ttarhan/homebrew-gtk-fix'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Failure while executing; `git clone https://github.com/ttarhan/homebrew-gtk-fix /opt/homebrew/Library/Taps/ttarhan/homebrew-gtk-fix --origin=origin --template=` exited with 128.

Could someone help me out please?

ttarhan commented 3 years ago

Hi! My temporarily fix repo is no longer needed as this patch is now in upstream Homebrew. Just “brew update” and “brew upgrade”, and you’ll be fine.