zegervdv / homebrew-zathura

Homebrew formulae to build Zathura on Mac OS X
538 stars 41 forks source link

Cannot install Zathura on macOS Monterey: Error on "ninja" #93

Closed Dorima1 closed 2 years ago

Dorima1 commented 2 years ago
Screen Shot 2022-08-14 at 10 57 31 PM

I get the following error when installing zathura using 'brew install zathura --HEAD'. What is the resolution to this?

zegervdv commented 2 years ago

Seems like upstream added a new dependency on json. Try brew install cjson and see if the compile will succeed then?

Dorima1 commented 2 years ago

Seems like upstream added a new dependency on json. Try brew install cjson and see if the compile will succeed then?

I still get the same error.

zegervdv commented 2 years ago

It works fine for me on e17dd2f. Can you share the full error from the log? Not sure if the json.h is the actual error here.

QYQSDTC commented 2 years ago

Hi @zegervdv, I met the same error while installing girara on my M1 MacBook Pro. Here's the detailed log

FAILED: libgirara-gtk3.3.dylib.p/girara_settings.c.o 
clang -Ilibgirara-gtk3.3.dylib.p -I. -I.. -Idata -I/opt/homebrew/Cellar/pcre/8.45/include -I/opt/homebrew/Cellar/glib/2.72.3/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.72.3/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/libffi/3.4.2/include -I/opt/homebrew/Cellar/glib/2.72.3/include/gio-unix-2.0 -I/opt/homebrew/Cellar/glib/2.72.3/include -I/opt/homebrew/Cellar/atk/2.38.0/include/atk-1.0 -I/opt/homebrew/Cellar/jpeg-turbo/2.1.4/include -I/opt/homebrew/Cellar/libpng/1.6.37/include/libpng16 -I/opt/homebrew/Cellar/libtiff/4.4.0_1/include -I/opt/homebrew/Cellar/gdk-pixbuf/2.42.9/include/gdk-pixbuf-2.0 -I/opt/homebrew/Cellar/libepoxy/1.5.10/include -I/opt/homebrew/opt/freetype/include/freetype2 -I/opt/homebrew/Cellar/fontconfig/2.14.0/include -I/opt/homebrew/Cellar/libxau/1.0.9/include -I/opt/homebrew/Cellar/libxdmcp/1.1.3/include -I/opt/homebrew/Cellar/libxcb/1.15/include -I/opt/homebrew/Cellar/libx11/1.8.1/include -I/opt/homebrew/Cellar/libxext/1.3.4/include -I/opt/homebrew/Cellar/libxrender/0.9.10/include -I/opt/homebrew/Cellar/pixman/0.40.0/include/pixman-1 -I/opt/homebrew/Cellar/cairo/1.16.0_5/include/cairo -I/opt/homebrew/Cellar/fribidi/1.0.12/include/fribidi -I/opt/homebrew/Cellar/graphite2/1.3.14/include -I/opt/homebrew/Cellar/harfbuzz/5.1.0/include/harfbuzz -I/opt/homebrew/Cellar/pango/1.50.9/include/pango-1.0 -I/opt/homebrew/Cellar/gtk+3/3.24.34/include/gtk-3.0 -I/opt/homebrew/Cellar/xorgproto/2022.2/include -I/opt/local/include -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=c11 -O3 '-DGETTEXT_PACKAGE="libgirara-gtk3-3"' '-DLOCALEDIR="/opt/homebrew/Cellar/girara/HEAD-e17dd2f/share/locale"' -D_DEFAULT_SOURCE -DHAVE_GETPWNAM_R -DWITH_JSON -Wmissing-declarations -Werror=implicit-function-declaration -Werror=vla -MD -MQ libgirara-gtk3.3.dylib.p/girara_settings.c.o -MF libgirara-gtk3.3.dylib.p/girara_settings.c.o.d -o libgirara-gtk3.3.dylib.p/girara_settings.c.o -c ../girara/settings.c
../girara/settings.c:8:10: fatal error: 'json.h' file not found
#include <json.h>
         ^~~~~~~~
1 error generated.
[25/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_callbacks.c.o
[26/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_session.c.o
[27/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_config.c.o
[28/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_commands.c.o
[29/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_completion.c.o
[30/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_input-history.c.o
[31/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_statusbar.c.o
[32/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_template.c.o
[33/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_utils.c.o
[34/35] Compiling C object libgirara-gtk3.3.dylib.p/girara_shortcuts.c.o
ninja: build stopped: subcommand failed.

In the last include path -I/opt/local/include there isn't json.h file. I have installed json-c and jsoncpp via MacPorts, and the corresponding json.h file is in /opt/local/include/json-c and /opt/local/include/json respectively. If installed via Homebrew, the corresponding json.h file is in /opt/homebrew/include/json-c and /opt/homebrew/include/json

CleanShot 2022-08-23 at 00 18 40

CleanShot 2022-08-23 at 00 19 06

But weird thing is that I can install smoothly on my M1 Macmini, I am not sure what's going on 😂

zegervdv commented 2 years ago

Weird, mine's a Mini too. Is your MacBook newer by any chance? It might have been a file that was included in High Sierra or Big Sur, but not in Monterey. If you upgrade it is still there, but from a clean install it isn't. Just guessing.

I think the json-c pkg may need to be added to the dependencies so its path will be added to the compile flags. You can do that via brew edit girara, this will open the formula in a text editor. At the top add depends 'json-c' and try to install again.
If that works, I'll add it in the repo.

QYQSDTC commented 2 years ago

Hi @zegervdv, yes, it works.

CleanShot 2022-08-25 at 10 38 52

CleanShot 2022-08-25 at 10 39 09 fa1fb98.png)

Dorima1 commented 2 years ago

It works for girara but not for zathura. I get a long error that I will screenshot soon.

Dorima1 commented 2 years ago

This is the error I currently have

Screen Shot 2022-08-31 at 11 15 10 AM
Dorima1 commented 2 years ago

I re-installed brew and this was the error I got.

Screen Shot 2022-08-31 at 11 35 51 AM
zegervdv commented 2 years ago

which meson version do you have? I've seen this before, where meson sometimes becomes stricter in its checking and this breaks all kinds of things

Dorima1 commented 2 years ago

This may sound like a silly question but how do I check which version of meson that I have?

zegervdv commented 2 years ago

Normally meson --version should work.

Dorima1 commented 2 years ago

0.63.1

eli-schwartz commented 2 years ago

Simply update zathura to 0.4.9

This was fixed upstream in zathura a year ago, but this tap still has a formula for an old version of zathura.

Dorima1 commented 2 years ago

What would be the command for that?

eli-schwartz commented 2 years ago

91

zegervdv commented 2 years ago

The are using the --HEAD flag, so that means they are compiling a the latest development version, i.e., newer than 0.4.9.

eli-schwartz commented 2 years ago

That's simply incorrect.

The --HEAD flag was used for the initial report, which didn't get further than girara, and was NOT used for zathura in the latest error output, which explicitly shows the command as brew install zathura and the status as "downloading ...../archive/0.4.8.tar.gz", and needs to be updated to at least 0.4.9 (or --HEAD).

None of this is a good reason to avoid merging #91 in order to update to the latest release that has a buildsystem bugfix. ;)

Dorima1 commented 2 years ago

This is what I got

Screen Shot 2022-09-06 at 11 29 09 PM
Dorima1 commented 2 years ago
Screen Shot 2022-09-06 at 11 33 16 PM
zegervdv commented 2 years ago

@eli-schwartz okay, I was assuming (my bad) that they were also using HEAD for zathura. Which you probably should be doing if you are using HEAD for girara.

As for the PR, I wanted to get the homebrew actions for generating the bottles working, but I can't figure out what is wrong with it and haven't had much time to look into it in detail.

zegervdv commented 2 years ago

@Dorima1 try brew rm zathura until there are no more versions found. If that doesn't work it seems something else installed zathura in that location and you will need to clean it up manually.

Dorima1 commented 2 years ago

I still get this as an error afterwards image

zegervdv commented 2 years ago

And what is in that directory?

Dorima1 commented 2 years ago

It finally worked! I used brew doctor then brew install zathura --HEAD. Thank you so much for your help!

zegervdv commented 2 years ago

What did you have to do to fix it? If someone else were to run into the same issue?

Dorima1 commented 2 years ago

A combination of brew install cjson and brew edit girara + depends_on 'json-c' I then used brew rm zathura to remove anything that was already in the directory, also brew doctor. I then updated zathura to 0.4.9 and re-installed and it worked.